Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Merge PR #53792 New @ckeditor/ckeditor5-real-time-collaboration v27…
….1 by @fedemp
- Loading branch information
Showing
11 changed files
with
124 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
...r__ckeditor5-real-time-collaboration/ckeditor__ckeditor5-real-time-collaboration-tests.ts
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,23 @@ | ||
import { Users } from '@ckeditor/ckeditor5-collaboration-core/src/users'; | ||
import { Editor } from '@ckeditor/ckeditor5-core'; | ||
import RTC from '@ckeditor/ckeditor5-real-time-collaboration'; | ||
import { Collection } from '@ckeditor/ckeditor5-utils'; | ||
|
||
class MyEditor extends Editor {} | ||
const editor = new MyEditor(); | ||
|
||
new RTC.Sessions().register('', new Collection()); | ||
new RTC.Sessions().unregister(''); | ||
new RTC.Sessions().getUserRole(new Users()).startsWith(''); | ||
new RTC.Sessions().mySessionId.startsWith(''); | ||
new RTC.Sessions().getUserSessions(new RTC.Sessions().getUserBySessionId(''), '').has(''); | ||
|
||
new RTC.PresenceList(editor); | ||
|
||
new RTC.RealTimeCollaborationClient(editor); | ||
|
||
new RTC.RealTimeCollaborativeEditing(editor); | ||
|
||
new RTC.RealTimeCollaborativeComments(editor); | ||
|
||
new RTC.RealTimeCollaborativeTrackChanges(editor); |
22 changes: 22 additions & 0 deletions
22
types/ckeditor__ckeditor5-real-time-collaboration/index.d.ts
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,22 @@ | ||
// Type definitions for @ckeditor/ckeditor5-real-time-collaboration 27.1 | ||
// Project: https://ckeditor.com/docs/ckeditor5/latest/api/module_real-time-collaboration_realtimecollaborationclient.html | ||
// Definitions by: Federico Panico <https://github.com/fedemp> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 4.2 | ||
import PresenceList from './src/presencelist'; | ||
import RealTimeCollaborationClient from './src/realtimecollaborationclient'; | ||
import RealTimeCollaborativeComments from './src/realtimecollaborativecomments'; | ||
import RealTimeCollaborativeEditing from './src/realtimecollaborativeediting'; | ||
import Sessions from './src/realtimecollaborativeediting/sessions'; | ||
import RealTimeCollaborativeTrackChanges from './src/realtimecollaborativetrackchanges'; | ||
|
||
declare const _default: { | ||
PresenceList: typeof PresenceList; | ||
RealTimeCollaborationClient: typeof RealTimeCollaborationClient; | ||
RealTimeCollaborativeComments: typeof RealTimeCollaborativeComments; | ||
RealTimeCollaborativeEditing: typeof RealTimeCollaborativeEditing; | ||
Sessions: typeof Sessions; | ||
RealTimeCollaborativeTrackChanges: typeof RealTimeCollaborativeTrackChanges; | ||
}; | ||
|
||
export default _default; |
5 changes: 5 additions & 0 deletions
5
types/ckeditor__ckeditor5-real-time-collaboration/src/presencelist.d.ts
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,5 @@ | ||
import { ContextPlugin } from '@ckeditor/ckeditor5-core'; | ||
|
||
export default class PresenceList extends ContextPlugin { | ||
static readonly pluginName: 'PresenceList'; | ||
} |
8 changes: 8 additions & 0 deletions
8
types/ckeditor__ckeditor5-real-time-collaboration/src/realtimecollaborationclient.d.ts
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,8 @@ | ||
import { Plugin } from '@ckeditor/ckeditor5-core'; | ||
|
||
export default class RealTimeCollaborationClient extends Plugin { | ||
static readonly pluginName: 'RealTimeCollaborationClient'; | ||
readonly cloudDocumentVersion: number; | ||
readonly lastSyncVersion: number; | ||
readonly offset: number; | ||
} |
5 changes: 5 additions & 0 deletions
5
types/ckeditor__ckeditor5-real-time-collaboration/src/realtimecollaborativecomments.d.ts
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,5 @@ | ||
import { Plugin } from '@ckeditor/ckeditor5-core'; | ||
|
||
export default class RealTimeCollaborativeComments extends Plugin { | ||
static readonly pluginName: 'RealTimeCollaborativeComments'; | ||
} |
9 changes: 9 additions & 0 deletions
9
types/ckeditor__ckeditor5-real-time-collaboration/src/realtimecollaborativeediting.d.ts
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,9 @@ | ||
import { Plugin } from '@ckeditor/ckeditor5-core'; | ||
|
||
export default class RealTimeCollaborativeEditing extends Plugin { | ||
static readonly pluginName: 'RealTimeCollaborativeEditing'; | ||
} | ||
|
||
export interface RealTimeCollaborationConfig { | ||
channelId?: string; | ||
} |
14 changes: 14 additions & 0 deletions
14
...keditor__ckeditor5-real-time-collaboration/src/realtimecollaborativeediting/sessions.d.ts
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,14 @@ | ||
import { Users } from '@ckeditor/ckeditor5-collaboration-core/src/users'; | ||
import { Collection } from '@ckeditor/ckeditor5-utils'; | ||
|
||
export default class Sessions { | ||
readonly allConnectedUsers: Collection<Users>; | ||
readonly channelConnectedUsers: Map<string, Collection<Users>>; | ||
readonly channelSessions: Map<string, Sessions>; | ||
mySessionId: string; | ||
getUserBySessionId(sessionId: string): Users; | ||
getUserRole(user: Users): string; | ||
getUserSessions(user: Users, channelId?: string): Set<string>; | ||
register(channelId: string, serviceSessions: Collection<Sessions>): void; | ||
unregister(channelId: string): void; | ||
} |
5 changes: 5 additions & 0 deletions
5
types/ckeditor__ckeditor5-real-time-collaboration/src/realtimecollaborativetrackchanges.d.ts
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,5 @@ | ||
import { Plugin } from '@ckeditor/ckeditor5-core'; | ||
|
||
export default class RealTimeCollaborativeTrackChanges extends Plugin { | ||
static readonly pluginName: 'RealTimeCollaborativeTrackChanges'; | ||
} |
29 changes: 29 additions & 0 deletions
29
types/ckeditor__ckeditor5-real-time-collaboration/tsconfig.json
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,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true, | ||
"baseUrl": "../", | ||
"typeRoots": [ | ||
"../" | ||
], | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"paths": { | ||
"@ckeditor/*": [ | ||
"ckeditor__*" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"ckeditor__ckeditor5-real-time-collaboration-tests.ts" | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
types/ckeditor__ckeditor5-real-time-collaboration/tslint.json
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,3 @@ | ||
{ | ||
"extends": "dtslint/dt.json" | ||
} |