@daasboard/doc 0.0.0-stage → 0.1.0
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/LICENSE +5 -0
- package/README.md +6 -2
- package/dist/DocumentAdapter.d.ts +41 -0
- package/dist/DocumentAdapter.js +34 -0
- package/dist/LoroPageDoc.d.ts +137 -0
- package/dist/LoroPageDoc.js +2662 -0
- package/dist/MemoryDocument.d.ts +42 -0
- package/dist/MemoryDocument.js +868 -0
- package/dist/connectors.d.ts +8 -0
- package/dist/connectors.js +44 -0
- package/dist/imageHashes.d.ts +3 -0
- package/dist/imageHashes.js +61 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +12 -0
- package/dist/normalize.d.ts +50 -0
- package/dist/normalize.js +203 -0
- package/dist/presence/RoomPresence.d.ts +107 -0
- package/dist/presence/RoomPresence.js +515 -0
- package/dist/schema.d.ts +728 -0
- package/dist/schema.js +891 -0
- package/dist/text.d.ts +80 -0
- package/dist/text.js +244 -0
- package/dist/textDelta.d.ts +27 -0
- package/dist/textDelta.js +688 -0
- package/dist/transport/WsTransport.d.ts +178 -0
- package/dist/transport/WsTransport.js +1314 -0
- package/dist/transport/connectRoom.d.ts +47 -0
- package/dist/transport/connectRoom.js +303 -0
- package/dist/transport/prefix.d.ts +4 -0
- package/dist/transport/prefix.js +27 -0
- package/dist/transport/slices.d.ts +9 -0
- package/dist/transport/slices.js +151 -0
- package/dist/transport/snapshot.d.ts +46 -0
- package/dist/transport/snapshot.js +248 -0
- package/dist/transport/token.d.ts +2 -0
- package/dist/transport/token.js +6 -0
- package/package.json +34 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Scene, SceneObject } from "@daasboard/render-core";
|
|
2
|
+
import { type DocumentAdapter, type Transaction } from "./DocumentAdapter.js";
|
|
3
|
+
import { type Problem } from "./normalize.js";
|
|
4
|
+
type Listener = Parameters<DocumentAdapter["subscribe"]>[0];
|
|
5
|
+
export interface MemoryDocumentOptions {
|
|
6
|
+
now?: () => number;
|
|
7
|
+
}
|
|
8
|
+
export declare class MemoryDocument implements DocumentAdapter {
|
|
9
|
+
readonly scene: Scene;
|
|
10
|
+
private undoStack;
|
|
11
|
+
private redoStack;
|
|
12
|
+
private listeners;
|
|
13
|
+
private readonly now;
|
|
14
|
+
private lastTyping;
|
|
15
|
+
readonly trash: Set<string>;
|
|
16
|
+
private readonly derivedHidden;
|
|
17
|
+
private attachedTo;
|
|
18
|
+
constructor(scene: Scene, opts?: MemoryDocumentOptions);
|
|
19
|
+
private trackAttachment;
|
|
20
|
+
private untrackAttachment;
|
|
21
|
+
get(id: string): SceneObject | undefined;
|
|
22
|
+
order(): readonly string[];
|
|
23
|
+
problems(): readonly Problem[];
|
|
24
|
+
canUndo(): boolean;
|
|
25
|
+
canRedo(): boolean;
|
|
26
|
+
endTyping(): void;
|
|
27
|
+
subscribe(l: Listener): () => void;
|
|
28
|
+
private emit;
|
|
29
|
+
private applyEntry;
|
|
30
|
+
private pushUndo;
|
|
31
|
+
private refreshAnchors;
|
|
32
|
+
private refreshGroups;
|
|
33
|
+
private reboundConnectors;
|
|
34
|
+
private derivedPoint;
|
|
35
|
+
private drawnPoint;
|
|
36
|
+
private visibleIndexOf;
|
|
37
|
+
private reorder;
|
|
38
|
+
transact(label: string, fn: (tx: Transaction) => void): void;
|
|
39
|
+
undo(): boolean;
|
|
40
|
+
redo(): boolean;
|
|
41
|
+
}
|
|
42
|
+
export {};
|