Skip to content
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

New @ckeditor/ckeditor5-real-time-collaboration v27.1 #53792

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions types/ckeditor__ckeditor5-core/src/editor/editorconfig.d.ts
Expand Up @@ -12,15 +12,14 @@ import { ImageConfig } from '@ckeditor/ckeditor5-image/src/image';
import { TextPartLanguageOption } from '@ckeditor/ckeditor5-language/src/textpartlanguage';
import { LinkConfig } from '@ckeditor/ckeditor5-link/src/link';
import { PaginationConfig } from '@ckeditor/ckeditor5-pagination/src/pagination';
import { RealTimeCollaborationConfig } from '@ckeditor/ckeditor5-real-time-collaboration/src/realtimecollaborativeediting';
import { TableConfig } from '@ckeditor/ckeditor5-table/src/table';
import { TrackChangesConfig } from '@ckeditor/ckeditor5-track-changes/src/trackchanges';
import { TypingConfig } from '@ckeditor/ckeditor5-typing/src/typing';
import { WordCountConfig } from '@ckeditor/ckeditor5-word-count/src/wordcount';
import ContextPlugin from '../contextplugin';
import Plugin, { PluginInterface } from '../plugin';

// TODO: import {RealTimeCollaborationConfig} from "@ckeditor/ckeditor5-real-time-collaboration/src/realtimecollaborativeediting";
type RealTimeCollaborationConfig = any;
// TODO: import {CommentsConfig} from "@ckeditor/ckeditor5-comments/src/comments";
type CommentsConfig = any;
// import {FontBackgroundColorConfig} from "@ckeditor/ckeditor5-font/src/fontbackgroundcolor";
Expand Down
@@ -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 types/ckeditor__ckeditor5-real-time-collaboration/index.d.ts
@@ -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;
@@ -0,0 +1,5 @@
import { ContextPlugin } from '@ckeditor/ckeditor5-core';

export default class PresenceList extends ContextPlugin {
static readonly pluginName: 'PresenceList';
}
@@ -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;
}
@@ -0,0 +1,5 @@
import { Plugin } from '@ckeditor/ckeditor5-core';

export default class RealTimeCollaborativeComments extends Plugin {
static readonly pluginName: 'RealTimeCollaborativeComments';
}
@@ -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;
}
@@ -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;
}
@@ -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 types/ckeditor__ckeditor5-real-time-collaboration/tsconfig.json
@@ -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 types/ckeditor__ckeditor5-real-time-collaboration/tslint.json
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}