-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port user|room|event|bridge stores to Typescript #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
src/components/bridge-store.ts
Outdated
* @param {Object} query | ||
* @param {Function} transformFn | ||
* @param {Deferred=} defer | ||
* @return {Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Object} query | |
* @param {Function} transformFn | |
* @param {Deferred=} defer | |
* @return {Promise} | |
* @param query | |
* @param transformFn | |
* @param defer |
src/components/bridge-store.ts
Outdated
* @param {string} fieldName The field name. Use dot notation for nested objects. | ||
* @param {boolean} sparse Allow sparse entries (undefined won't cause a key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} fieldName The field name. Use dot notation for nested objects. | |
* @param {boolean} sparse Allow sparse entries (undefined won't cause a key | |
* @param fieldName The field name. Use dot notation for nested objects. | |
* @param sparse Allow sparse entries (undefined won't cause a key |
src/components/bridge-store.ts
Outdated
public setUnique(fieldName: string, sparse: boolean) { | ||
sparse = sparse || false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public setUnique(fieldName: string, sparse: boolean) { | |
sparse = sparse || false; | |
public setUnique(fieldName: string, sparse = false) { |
src/components/bridge-store.ts
Outdated
* @param {Function} func The function which will be called with a single document | ||
* object. Guaranteed not to be null. | ||
* @return {Function} A <code>transformFn</code> function to pass to the standard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Function} func The function which will be called with a single document | |
* object. Guaranteed not to be null. | |
* @return {Function} A <code>transformFn</code> function to pass to the standard | |
* @param func The function which will be called with a single document | |
* object. Guaranteed not to be null. | |
* @return A <code>transformFn</code> function to pass to the standard |
src/components/bridge-store.ts
Outdated
/** | ||
* Bridge store base class | ||
* @constructor | ||
* @param {Datastore} db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Datastore} db |
src/components/event-bridge-store.ts
Outdated
* @param {string} roomId The ID of the room. | ||
* @param {string} eventId The ID of the event. | ||
* @return {?StoredEvent} A promise which resolves to the StoredEvent or null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} roomId The ID of the room. | |
* @param {string} eventId The ID of the event. | |
* @return {?StoredEvent} A promise which resolves to the StoredEvent or null. | |
* @param roomId The ID of the room. | |
* @param eventId The ID of the event. | |
* @return A promise which resolves to the StoredEvent or null. |
src/components/event-bridge-store.ts
Outdated
* @param {StoredEvent} event The event to remove. | ||
* @return {Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {StoredEvent} event The event to remove. | |
* @return {Promise} | |
* @param event The event to remove. |
src/components/event-bridge-store.ts
Outdated
* @param {string} roomId The ID of the room. | ||
* @param {string} eventId The ID of the event. | ||
* @return {Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} roomId The ID of the room. | |
* @param {string} eventId The ID of the event. | |
* @return {Promise} | |
* @param roomId The ID of the room. | |
* @param eventId The ID of the event. |
src/components/event-bridge-store.ts
Outdated
* @param {string} roomId The ID of the room. | ||
* @param {string} eventId The ID of the event. | ||
* @return {Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} roomId The ID of the room. | |
* @param {string} eventId The ID of the event. | |
* @return {Promise} | |
* @param roomId The ID of the room. | |
* @param eventId The ID of the event. |
src/components/event-bridge-store.ts
Outdated
* Construct a store suitable for event mapping information. Data is stored | ||
* as {@link StoredEvent}s. | ||
* @constructor | ||
* @param {Datastore} db The connected NEDB database instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Datastore} db The connected NEDB database instance | |
* @param db The connected NEDB database instance |
src/components/room-bridge-store.ts
Outdated
* @param {Datastore} db The connected NEDB database instance | ||
* @param {Object} opts Options for this store. | ||
* @property {string} delimiter The delimiter between matrix and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {Datastore} db The connected NEDB database instance | |
* @param {Object} opts Options for this store. | |
* @property {string} delimiter The delimiter between matrix and | |
* @param db The connected NEDB database instance |
src/components/room-bridge-store.ts
Outdated
import { RemoteRoom } from "../models/rooms/remote"; | ||
|
||
export class RoomBridgeStore extends BridgeStore { | ||
private readonly delimiter = " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private readonly delimiter = " "; | |
public delimiter = " "; |
src/components/room-bridge-store.ts
Outdated
* @param {RoomBridgeStore~Entry} entry | ||
* @return {Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {RoomBridgeStore~Entry} entry | |
* @return {Promise} | |
* @param entry |
src/components/room-bridge-store.ts
Outdated
* @param {String} id The ID of the entry to retrieve. | ||
* @return {?RoomBridgeStore~Entry} A promise which resolves to the entry or null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {String} id The ID of the entry to retrieve. | |
* @return {?RoomBridgeStore~Entry} A promise which resolves to the entry or null. | |
* @param id The ID of the entry to retrieve. | |
* @return A promise which resolves to the entry or null. |
src/components/room-bridge-store.ts
Outdated
* @param {string} matrixId | ||
* @return {RoomBridgeStore~Entry[]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} matrixId | |
* @return {RoomBridgeStore~Entry[]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed things
9e494ae
to
20b59de
Compare
20b59de
to
a59e068
Compare
This is a rather gargantuan PR, but it's mostly just typescriptification. The tests were modified to remove dependence on Bluebird, so this change is breaking, as we use pure promises here now.