-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Migrate modules related to
room
template to TypeScript (#25881)
- Loading branch information
Showing
121 changed files
with
3,500 additions
and
3,578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,6 @@ export const emoji = { | |
}, | ||
}, | ||
}, | ||
/** @type {Record<string, unknown>} */ | ||
list: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { IMessage, IRoom } from '@rocket.chat/core-typings'; | ||
import { Mongo } from 'meteor/mongo'; | ||
|
||
class ChatMessageCollection extends Mongo.Collection<IMessage & { ignored?: boolean }> { | ||
constructor() { | ||
super(null); | ||
} | ||
|
||
setReactions(messageId: IMessage['_id'], reactions: IMessage['reactions']) { | ||
return this.update({ _id: messageId }, { $set: { reactions } }); | ||
} | ||
|
||
unsetReactions(messageId: IMessage['_id']) { | ||
return this.update({ _id: messageId }, { $unset: { reactions: 1 } }); | ||
} | ||
|
||
findOneByRoomIdAndMessageId(rid: IRoom['_id'], messageId: IMessage['_id'], options?: Mongo.Options<IMessage>) { | ||
const query = { | ||
rid, | ||
_id: messageId, | ||
}; | ||
|
||
return this.findOne(query, options); | ||
} | ||
} | ||
|
||
// TODO: check if we can dodge these missing typings from Meteor Collection Hooks | ||
export const ChatMessage = new ChatMessageCollection() as unknown as Mongo.Collection<IMessage & { ignored?: boolean }> & { | ||
direct: Mongo.Collection<IMessage, IMessage>; | ||
|
||
queries: unknown[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.