edytor 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edytor.cjs.development.js +489 -784
- package/dist/edytor.cjs.development.js.map +1 -1
- package/dist/edytor.cjs.production.min.js +1 -1
- package/dist/edytor.cjs.production.min.js.map +1 -1
- package/dist/edytor.esm.js +480 -780
- package/dist/edytor.esm.js.map +1 -1
- package/dist/events/onKeyDown.d.ts +67 -0
- package/dist/operations/deleteText.d.ts +1 -1
- package/dist/operations/formatText.d.ts +1 -2
- package/dist/operations/splitLeaf.d.ts +2 -8
- package/dist/types.d.ts +32 -10
- package/dist/utils/common.d.ts +10 -1
- package/dist/utils/dropper.d.ts +4 -2
- package/dist/utils/index.d.ts +1 -3
- package/dist/utils/nodes.d.ts +4 -3
- package/dist/utils/{Selection/EdytorSelection.d.ts → selection.d.ts} +12 -6
- package/dist/utils/yClasses/EdytorDoc.d.ts +2 -19
- package/dist/utils/yClasses/yLeaf.d.ts +1 -4
- package/dist/utils/yClasses/yNode.d.ts +3 -3
- package/dist/yjs/index.d.ts +0 -1
- package/dist/yjs/wsProvider.d.ts +1 -11
- package/index.ts +0 -2
- package/package.json +6 -6
- package/dist/datastructure.d.ts +0 -1
- package/dist/utils/cursor.d.ts +0 -24
- package/dist/utils/getSelection.d.ts +0 -2
- package/dist/yjs/webrtcProvider.d.ts +0 -12
|
@@ -1,2 +1,69 @@
|
|
|
1
1
|
import { Editor } from "../types";
|
|
2
2
|
export declare const onKeyDown: (editor: Editor, e: KeyboardEvent) => any;
|
|
3
|
+
export declare const defaultHotkeys: ({
|
|
4
|
+
operation: string;
|
|
5
|
+
keys: string;
|
|
6
|
+
mark: {
|
|
7
|
+
bold: boolean;
|
|
8
|
+
italic?: undefined;
|
|
9
|
+
underline?: undefined;
|
|
10
|
+
code?: undefined;
|
|
11
|
+
strikethrough?: undefined;
|
|
12
|
+
highlight?: undefined;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
operation: string;
|
|
16
|
+
keys: string;
|
|
17
|
+
mark: {
|
|
18
|
+
italic: boolean;
|
|
19
|
+
bold?: undefined;
|
|
20
|
+
underline?: undefined;
|
|
21
|
+
code?: undefined;
|
|
22
|
+
strikethrough?: undefined;
|
|
23
|
+
highlight?: undefined;
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
operation: string;
|
|
27
|
+
keys: string;
|
|
28
|
+
mark: {
|
|
29
|
+
underline: boolean;
|
|
30
|
+
bold?: undefined;
|
|
31
|
+
italic?: undefined;
|
|
32
|
+
code?: undefined;
|
|
33
|
+
strikethrough?: undefined;
|
|
34
|
+
highlight?: undefined;
|
|
35
|
+
};
|
|
36
|
+
} | {
|
|
37
|
+
operation: string;
|
|
38
|
+
keys: string;
|
|
39
|
+
mark: {
|
|
40
|
+
code: boolean;
|
|
41
|
+
bold?: undefined;
|
|
42
|
+
italic?: undefined;
|
|
43
|
+
underline?: undefined;
|
|
44
|
+
strikethrough?: undefined;
|
|
45
|
+
highlight?: undefined;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
operation: string;
|
|
49
|
+
keys: string;
|
|
50
|
+
mark: {
|
|
51
|
+
strikethrough: boolean;
|
|
52
|
+
bold?: undefined;
|
|
53
|
+
italic?: undefined;
|
|
54
|
+
underline?: undefined;
|
|
55
|
+
code?: undefined;
|
|
56
|
+
highlight?: undefined;
|
|
57
|
+
};
|
|
58
|
+
} | {
|
|
59
|
+
operation: string;
|
|
60
|
+
keys: string;
|
|
61
|
+
mark: {
|
|
62
|
+
highlight: boolean;
|
|
63
|
+
bold?: undefined;
|
|
64
|
+
italic?: undefined;
|
|
65
|
+
underline?: undefined;
|
|
66
|
+
code?: undefined;
|
|
67
|
+
strikethrough?: undefined;
|
|
68
|
+
};
|
|
69
|
+
})[];
|
|
@@ -3,5 +3,5 @@ declare type deleteTextOpts = {
|
|
|
3
3
|
mode: "forward" | "backward" | "none";
|
|
4
4
|
selection?: EdytorSelection;
|
|
5
5
|
};
|
|
6
|
-
export declare const deleteText: (editor: Editor, { mode, selection }: deleteTextOpts) =>
|
|
6
|
+
export declare const deleteText: (editor: Editor, { mode, selection }: deleteTextOpts) => void;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YMap, YText } from "yjs/dist/src/internals";
|
|
2
2
|
import { Editor, Position, EdytorSelection } from "../types";
|
|
3
|
-
import { YLeaf } from "../utils";
|
|
4
3
|
export declare type formatTextOperation = {
|
|
5
4
|
at?: Position;
|
|
6
5
|
value: any;
|
|
@@ -17,5 +16,5 @@ export declare type formatAtEqualPathOperation = {
|
|
|
17
16
|
data?: object;
|
|
18
17
|
};
|
|
19
18
|
export declare const applyMarksFromParent: (parent: YMap<any>, leafs: YMap<any>[]) => void;
|
|
20
|
-
export declare const formatAtEqualPath: ({ format, value, start, end }: formatAtEqualPathOperation) => YLeaf;
|
|
19
|
+
export declare const formatAtEqualPath: ({ format, value, start, end }: formatAtEqualPathOperation) => import("../types").YLeaf;
|
|
21
20
|
export declare const formatText: (editor: Editor, mark: Record<string, any>) => number;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare type splitLeafOperation = {
|
|
4
|
-
yText: YText;
|
|
5
|
-
at: Position;
|
|
6
|
-
};
|
|
7
|
-
export declare const splitLeaf: (editor: Editor | Pick<Editor, "toYJS">, { yText, at }: splitLeafOperation) => void;
|
|
8
|
-
export {};
|
|
1
|
+
import { Editor } from "../types";
|
|
2
|
+
export declare const splitLeaf: (editor: Editor) => void;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { YArray, YMap } from "yjs/dist/src/internals";
|
|
2
|
-
import {
|
|
3
|
-
import { Dropper, EdytorSelection, jsonNode,
|
|
2
|
+
import { EdytorDoc } from ".";
|
|
3
|
+
import { Dropper, EdytorSelection, jsonNode, YNode } from "./utils";
|
|
4
|
+
import * as awarenessProtocol from "y-protocols/awareness";
|
|
4
5
|
export { EdytorSelection };
|
|
5
6
|
declare type Accessor<T> = () => T;
|
|
7
|
+
export declare type YLeaf = YMap<any>;
|
|
6
8
|
export declare type dataEdytorType = "data-edytor-block" | "data-edytor-leave";
|
|
7
9
|
export declare type attributes = {
|
|
8
10
|
id: string;
|
|
@@ -38,12 +40,35 @@ interface HotKeys {
|
|
|
38
40
|
keys: string;
|
|
39
41
|
mark: Record<string, any>;
|
|
40
42
|
}
|
|
43
|
+
declare type DNDProps = {
|
|
44
|
+
canNest?: (block: YMap<any>, path: number[]) => boolean;
|
|
45
|
+
active: boolean;
|
|
46
|
+
renderIndicator: () => any;
|
|
47
|
+
onExternalDrop?: (files: any) => any;
|
|
48
|
+
accept?: string[];
|
|
49
|
+
afterDrop?: (editor: Editor, from: any, to: any) => void;
|
|
50
|
+
};
|
|
41
51
|
export interface EditorProps extends Record<any, any> {
|
|
42
52
|
allowNesting: boolean;
|
|
53
|
+
children: any;
|
|
43
54
|
initialValue: {
|
|
44
55
|
json?: jsonNode[];
|
|
45
56
|
yarray?: YArray<any>;
|
|
46
57
|
};
|
|
58
|
+
dnd?: DNDProps;
|
|
59
|
+
collaboration: {
|
|
60
|
+
awarenessId?: string;
|
|
61
|
+
awareness?: awarenessProtocol.Awareness;
|
|
62
|
+
url: string;
|
|
63
|
+
room: string;
|
|
64
|
+
user?: {
|
|
65
|
+
color?: string;
|
|
66
|
+
name?: string;
|
|
67
|
+
id?: string | number;
|
|
68
|
+
picture?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
onMount?: (editor: Editor) => void;
|
|
47
72
|
leaves: Record<string, keyof HTMLElementTagNameMap> | Record<string, any>;
|
|
48
73
|
blocks: Record<string, keyof HTMLElementTagNameMap> | Record<string, any>;
|
|
49
74
|
defaultBlock?: string;
|
|
@@ -55,30 +80,27 @@ export interface EditorProps extends Record<any, any> {
|
|
|
55
80
|
renderBefore?: () => any;
|
|
56
81
|
renderAfter?: () => any;
|
|
57
82
|
onChange?: (editor: Editor) => void;
|
|
58
|
-
renderBlock?: ({ attributes, children, block }: renderBlockProps) => any;
|
|
59
|
-
renderLeaf?: ({ attributes, string, leaf }: renderLeafProps) => any;
|
|
60
83
|
}
|
|
84
|
+
export declare type EditorWithChildren = Pick<Editor, "children">;
|
|
61
85
|
export interface Editor {
|
|
62
86
|
allowNesting: boolean;
|
|
63
87
|
readOnly: boolean;
|
|
64
88
|
editorId: string;
|
|
65
89
|
defaultBlock: string;
|
|
90
|
+
awareness?: awarenessProtocol.Awareness;
|
|
91
|
+
dnd?: DNDProps;
|
|
66
92
|
dropper: Dropper;
|
|
67
93
|
hotkeys?: HotKeys[];
|
|
68
94
|
selection: EdytorSelection;
|
|
69
|
-
cursor: () => Cursor | undefined;
|
|
70
95
|
leaves: Record<string, keyof HTMLElementTagNameMap> | Record<string, any>;
|
|
71
96
|
blocks: Record<string, keyof HTMLElementTagNameMap> | Record<string, any>;
|
|
72
97
|
renderHandle: (({ node, attributes }: renderHandleProps) => any) | undefined;
|
|
73
98
|
undoManager: any;
|
|
74
|
-
editorRef:
|
|
75
|
-
toUpdate: () => Uint8Array;
|
|
99
|
+
editorRef: HTMLDivElement | undefined;
|
|
76
100
|
doc: EdytorDoc;
|
|
77
|
-
|
|
101
|
+
toRawText: () => string;
|
|
78
102
|
toJSON: () => jsonNode[];
|
|
79
103
|
ID_TO_NODE: Map<string, YMap<any>>;
|
|
80
|
-
ID_TO_MAP: WeakMap<any, any>;
|
|
81
|
-
MAP_TO_ID: WeakMap<any, any>;
|
|
82
104
|
children: YArray<any>;
|
|
83
105
|
}
|
|
84
106
|
export interface Value {
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { YMap } from "yjs/dist/src/internals";
|
|
1
|
+
import { YArray, YMap } from "yjs/dist/src/internals";
|
|
2
|
+
import { Editor, EditorWithChildren, YLeaf } from "../types";
|
|
2
3
|
export declare const nanoid: () => string;
|
|
3
4
|
declare type YNode = YMap<any>;
|
|
4
5
|
export declare const getNode: (node: any) => YNode;
|
|
5
6
|
export declare const getIndex: (node: YNode) => number;
|
|
6
7
|
export declare const getPath: (node: YNode) => number[];
|
|
7
8
|
export declare const getId: (node: any) => string;
|
|
9
|
+
export declare const getLeafAtPath: (editor: Editor | EditorWithChildren, [start, ...path]: number[]) => YLeaf;
|
|
10
|
+
export declare const getNodeAtPath: (editor: Editor, [start, ...path]: number[]) => YNode;
|
|
11
|
+
export declare const getContainerAtPath: (editor: Editor, path: number[]) => YArray<any>;
|
|
12
|
+
export declare const traverse: (editor: Editor | EditorWithChildren, cb: (node: YMap<any>, isText: boolean, path: number[]) => void, opts?: {
|
|
13
|
+
start?: number;
|
|
14
|
+
end?: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
export declare const toString: (editor: Editor | EditorWithChildren) => string;
|
|
8
17
|
export {};
|
package/dist/utils/dropper.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { EdytorSelection } from "../types";
|
|
1
|
+
import { Editor, EdytorSelection } from "../types";
|
|
2
2
|
import { EdytorDoc } from "./yClasses";
|
|
3
3
|
export declare class Dropper {
|
|
4
4
|
from: any;
|
|
5
5
|
to: any;
|
|
6
6
|
node: any;
|
|
7
7
|
startPath: any;
|
|
8
|
+
container: HTMLDivElement;
|
|
9
|
+
editor: Editor;
|
|
8
10
|
doc: EdytorDoc;
|
|
9
11
|
editorId: string;
|
|
10
12
|
ID_TO_NODE: Map<any, any>;
|
|
11
13
|
selection: EdytorSelection;
|
|
12
14
|
allowNesting: boolean;
|
|
13
|
-
|
|
15
|
+
init: (editor: any, container: any) => void;
|
|
14
16
|
startDrag: (node: any, e: DragEvent) => void;
|
|
15
17
|
dragEnd: () => void;
|
|
16
18
|
getHoveredNode: (target: HTMLElement) => {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export * from "./getSelection";
|
|
2
|
-
export * from "./cursor";
|
|
3
1
|
export * from "./yClasses/index";
|
|
4
2
|
export * from "./leaves";
|
|
5
3
|
export * from "./nodes";
|
|
6
4
|
export * from "./common";
|
|
7
5
|
export * from "./dropper";
|
|
8
|
-
export * from "./
|
|
6
|
+
export * from "./selection";
|
package/dist/utils/nodes.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { YArray } from "yjs/dist/src/internals";
|
|
1
|
+
import { YArray, YMap } from "yjs/dist/src/internals";
|
|
2
2
|
import { Editor } from "../types";
|
|
3
3
|
import { YNode } from "./yClasses";
|
|
4
|
-
export declare const mergeContentWithPrevLeaf: (editor: Editor) =>
|
|
4
|
+
export declare const mergeContentWithPrevLeaf: (editor: Editor) => any[];
|
|
5
5
|
export declare const mergeContentWithNextLeaf: (editor: Editor) => any;
|
|
6
6
|
export declare const deleteNode: (node: any, defaultBlock: string) => void;
|
|
7
7
|
export declare const getNodeContainer: (node: any) => YArray<YNode>;
|
|
@@ -10,4 +10,5 @@ export declare const getNodeContent: (node: any) => YArray<YNode>;
|
|
|
10
10
|
export declare const hasChildren: (node: any) => boolean;
|
|
11
11
|
export declare const isNodeEmpty: (node: any) => boolean;
|
|
12
12
|
export declare const isNodeContentEmpty: (node: any) => boolean;
|
|
13
|
-
export declare const copyNode: (node: YNode) =>
|
|
13
|
+
export declare const copyNode: (node: YNode) => YMap<any>;
|
|
14
|
+
export declare const nodeString: (node: YNode) => string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Position } from "
|
|
2
|
-
import {
|
|
1
|
+
import { Editor, Position, YLeaf } from "../types";
|
|
2
|
+
import { YNode } from ".";
|
|
3
3
|
export declare class EdytorSelection {
|
|
4
|
-
|
|
4
|
+
editor: Editor;
|
|
5
5
|
observers: ((selection: EdytorSelection) => void)[];
|
|
6
6
|
container: HTMLDivElement;
|
|
7
|
-
|
|
7
|
+
collaborationPosition: {
|
|
8
|
+
node: string;
|
|
9
|
+
leaf: string;
|
|
10
|
+
offset: number;
|
|
11
|
+
};
|
|
8
12
|
start: Position;
|
|
9
13
|
end: Position;
|
|
10
14
|
selectedText: string;
|
|
@@ -14,6 +18,8 @@ export declare class EdytorSelection {
|
|
|
14
18
|
range?: Range;
|
|
15
19
|
boundingRect?: DOMRect;
|
|
16
20
|
edges: {
|
|
21
|
+
startDocument: boolean;
|
|
22
|
+
endDocument: boolean;
|
|
17
23
|
startLeaf: boolean;
|
|
18
24
|
startNode: boolean;
|
|
19
25
|
endLeaf: boolean;
|
|
@@ -22,8 +28,8 @@ export declare class EdytorSelection {
|
|
|
22
28
|
selection?: Selection;
|
|
23
29
|
focused: boolean;
|
|
24
30
|
type?: "multinodes" | "collapsed" | "singlenode" | "multileaves" | "notInDoc";
|
|
25
|
-
constructor(
|
|
26
|
-
init: (container: any) => void;
|
|
31
|
+
constructor();
|
|
32
|
+
init: (editor: Editor, container: any) => void;
|
|
27
33
|
onFocus: () => void;
|
|
28
34
|
onBlur: () => void;
|
|
29
35
|
destroy: () => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Doc } from "yjs";
|
|
2
|
-
import {
|
|
3
|
-
import { YLeaf, YNode } from ".";
|
|
2
|
+
import { YNode } from ".";
|
|
4
3
|
export interface jsonLeaf extends Record<string, any> {
|
|
5
4
|
text: string;
|
|
6
5
|
data?: object;
|
|
@@ -11,23 +10,7 @@ export declare type jsonNode = {
|
|
|
11
10
|
data?: object;
|
|
12
11
|
children?: jsonNode[];
|
|
13
12
|
};
|
|
14
|
-
export declare const getContent: (leaf: jsonLeaf) => YLeaf;
|
|
15
13
|
export declare const getChildren: ({ type, content, children, ...props }: jsonNode) => YNode;
|
|
16
14
|
export declare class EdytorDoc extends Doc {
|
|
17
|
-
children: YArray<YNode>;
|
|
18
|
-
config: YMap<any>;
|
|
19
|
-
constructor(value?: jsonNode[]);
|
|
20
|
-
getLeafAtPath: ([start, ...path]: number[]) => YLeaf;
|
|
21
|
-
getNodeAtPath: ([start, ...path]: number[]) => YNode;
|
|
22
|
-
getContainerAtPath: (path: number[]) => YArray<any>;
|
|
23
|
-
traverse: (cb: (node: YMap<any>, isText: boolean, path: number[]) => void, opts?: {
|
|
24
|
-
start?: number;
|
|
25
|
-
end?: number;
|
|
26
|
-
}) => void;
|
|
27
|
-
toJSON: () => {
|
|
28
|
-
children: any;
|
|
29
|
-
config: any;
|
|
30
|
-
};
|
|
31
|
-
toUpdate: () => Uint8Array;
|
|
32
|
-
string: () => string;
|
|
33
15
|
}
|
|
16
|
+
export declare const DocFromJson: (value: jsonNode[], initialDoc?: Doc) => Doc;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Map } from "yjs";
|
|
2
|
-
import { YArray } from "yjs/dist/src/internals";
|
|
3
|
-
import { YLeaf } from "
|
|
2
|
+
import { YArray, YMap } from "yjs/dist/src/internals";
|
|
3
|
+
import { YLeaf } from "../../";
|
|
4
4
|
export declare type YNodeProps = {
|
|
5
5
|
data?: any;
|
|
6
6
|
content?: YLeaf[] | YArray<YLeaf>;
|
|
7
7
|
children?: YNode[] | YArray<YNode>;
|
|
8
8
|
id?: string;
|
|
9
9
|
};
|
|
10
|
+
export declare const createNode: (type: string, props?: YNodeProps) => YMap<any>;
|
|
10
11
|
export declare class YNode extends Map<any> {
|
|
11
|
-
constructor(type: string, props?: YNodeProps);
|
|
12
12
|
}
|
package/dist/yjs/index.d.ts
CHANGED
package/dist/yjs/wsProvider.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare type WebrtcProviderOptions = {
|
|
3
|
-
signaling: Array<string>;
|
|
4
|
-
password: string | null;
|
|
5
|
-
awareness: any;
|
|
6
|
-
maxConns: number;
|
|
7
|
-
filterBcConns: boolean;
|
|
8
|
-
peerOpts: any;
|
|
9
|
-
};
|
|
10
|
-
export declare const createWSProvider: (doc: Doc, room: string, opts: WebrtcProviderOptions) => Doc;
|
|
11
|
-
export {};
|
|
1
|
+
export declare const createWSProvider: (room?: any) => Promise<unknown>;
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edytor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "the core of edytor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"richtext"
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"is-hotkey": "^0.2.0",
|
|
22
|
-
"jest": "^27.2.2",
|
|
23
22
|
"nanoid": "^3.1.28",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
23
|
+
"simple-peer-light": "^9.10.0",
|
|
24
|
+
"y-protocols": "^1.0.5",
|
|
26
25
|
"y-webrtc": "^10.2.0",
|
|
27
26
|
"y-websocket": "^1.3.16",
|
|
28
|
-
"yjs": "
|
|
27
|
+
"yjs": "13.5.11"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"jest": "^27.2.
|
|
30
|
+
"jest": "^27.2.5",
|
|
31
|
+
"ts": "^0.2.2",
|
|
32
32
|
"ts-jest": "^27.0.5",
|
|
33
33
|
"tsdx": "^0.14.1"
|
|
34
34
|
}
|
package/dist/datastructure.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/cursor.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { EdytorSelection } from "../types";
|
|
2
|
-
export declare class Cursor {
|
|
3
|
-
container: HTMLDivElement;
|
|
4
|
-
selection: EdytorSelection;
|
|
5
|
-
constructor({ container, selection }: {
|
|
6
|
-
container: any;
|
|
7
|
-
selection: any;
|
|
8
|
-
});
|
|
9
|
-
getEditorOffset: (selection: Selection) => number;
|
|
10
|
-
static getCurrentCursorPosition(parentElement: HTMLElement | Node, focusNode?: Node, focusOffset?: number): number;
|
|
11
|
-
set: (offset: number) => void;
|
|
12
|
-
setRange: (offset: number, length: any) => void;
|
|
13
|
-
getRangeBoundaries: (offset: number, length: any) => {
|
|
14
|
-
startNode: ChildNode;
|
|
15
|
-
startOffset: number;
|
|
16
|
-
endNode: ChildNode;
|
|
17
|
-
endOffset: number;
|
|
18
|
-
};
|
|
19
|
-
getRangeBoundary: (node: any, chars: any, isStart: any) => [ChildNode, number];
|
|
20
|
-
static setCurrentCursorPosition(chars: any, element: any, s?: Selection): void;
|
|
21
|
-
static selectNode(node: any, startOffset: any, endOffset: any, selection: any): void;
|
|
22
|
-
static _createRange(node: any, chars: any, range: any): any;
|
|
23
|
-
static _isChildOf(node: any, parentElement: any): boolean;
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WebrtcProvider } from "y-webrtc";
|
|
2
|
-
import { Doc } from "yjs";
|
|
3
|
-
declare type WebrtcProviderOptions = {
|
|
4
|
-
signaling: Array<string>;
|
|
5
|
-
password: string | null;
|
|
6
|
-
awareness: any;
|
|
7
|
-
maxConns: number;
|
|
8
|
-
filterBcConns: boolean;
|
|
9
|
-
peerOpts: any;
|
|
10
|
-
};
|
|
11
|
-
export declare const createWebRtcProvider: (doc: Doc, room: string, opts: WebrtcProviderOptions) => WebrtcProvider;
|
|
12
|
-
export {};
|