document-model 1.1.0-experimental.2 → 1.1.0-experimental.4
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/CHANGELOG.md +33 -0
- package/dist/browser/cjs/document-model.js +1 -1
- package/dist/browser/cjs/document.js +1 -1
- package/dist/browser/cjs/index.js +1 -1
- package/dist/{node/cjs/internal/index-CTavCc1t.js → browser/cjs/internal/index-BLpgsifL.js} +1 -1
- package/dist/browser/cjs/internal/{index-DLodkpOq.js → index-BTG_-qY6.js} +1 -1
- package/dist/browser/cjs/internal/{object-CMr-_AP8.js → object-BHB7lY3H.js} +19 -19
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +9 -7
- package/dist/browser/es/index.js +3 -3
- package/dist/browser/es/internal/index-2Qq00NLA.js +46 -0
- package/dist/browser/es/internal/{index-CL_1ivGq.js → index-BD2hB9El.js} +1 -1
- package/dist/browser/es/internal/{object-FFc9n_3I.js → object-BW-G4r5m.js} +354 -345
- package/dist/browser/src/document/reducer.d.ts +17 -0
- package/dist/node/cjs/document-model.js +1 -1
- package/dist/node/cjs/document.js +1 -1
- package/dist/node/cjs/index.js +1 -1
- package/dist/{browser/cjs/internal/index-azT4DEce.js → node/cjs/internal/index-B31DqWHj.js} +1 -1
- package/dist/node/cjs/internal/{index-CPeTtUsk.js → index-BBm_wnUa.js} +1 -1
- package/dist/node/cjs/internal/{object-DhI24-1e.js → object-CxVzP-Xe.js} +17 -17
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +10 -8
- package/dist/node/es/index.js +3 -3
- package/dist/node/es/internal/{index-A880In4b.js → index-BPCSW4M1.js} +1 -1
- package/dist/node/es/internal/index-C7I4OGkU.js +46 -0
- package/dist/node/es/internal/{object-C9n9Ijnt.js → object-C-_SkpQ0.js} +511 -502
- package/dist/node/src/document/reducer.d.ts +17 -0
- package/dist/src/document/actions/creators.d.ts +47 -0
- package/dist/src/document/actions/index.d.ts +14 -0
- package/dist/src/document/actions/types.d.ts +15 -0
- package/dist/src/document/index.d.ts +6 -0
- package/dist/src/document/object.d.ts +1210 -0
- package/dist/src/document/reducer.d.ts +60 -0
- package/dist/src/document/schema/index.d.ts +2 -0
- package/dist/src/document/schema/types.d.ts +176 -0
- package/dist/src/document/schema/zod.d.ts +113 -0
- package/dist/src/document/signal.d.ts +29 -0
- package/dist/src/document/types.d.ts +255 -0
- package/dist/src/document/utils/base.d.ts +86 -0
- package/dist/src/document/utils/document-helpers.d.ts +53 -0
- package/dist/src/document/utils/file.d.ts +48 -0
- package/dist/src/document/utils/index.d.ts +5 -0
- package/dist/src/document/utils/node.d.ts +9 -0
- package/dist/src/document/utils/validation.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/header.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/module.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation-error.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation-example.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/state.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/versioning.d.ts +7 -0
- package/dist/src/document-model/custom/utils.d.ts +7 -0
- package/dist/src/document-model/gen/actions.d.ts +15 -0
- package/dist/src/document-model/gen/creators.d.ts +7 -0
- package/dist/src/document-model/gen/document-model.d.ts +2 -0
- package/dist/src/document-model/gen/header/actions.d.ts +9 -0
- package/dist/src/document-model/gen/header/creators.d.ts +8 -0
- package/dist/src/document-model/gen/header/object.d.ts +12 -0
- package/dist/src/document-model/gen/header/operations.d.ts +10 -0
- package/dist/src/document-model/gen/index.d.ts +5 -0
- package/dist/src/document-model/gen/module/actions.d.ts +8 -0
- package/dist/src/document-model/gen/module/creators.d.ts +7 -0
- package/dist/src/document-model/gen/module/object.d.ts +11 -0
- package/dist/src/document-model/gen/module/operations.d.ts +9 -0
- package/dist/src/document-model/gen/object.d.ts +28 -0
- package/dist/src/document-model/gen/operation/actions.d.ts +13 -0
- package/dist/src/document-model/gen/operation/creators.d.ts +12 -0
- package/dist/src/document-model/gen/operation/object.d.ts +16 -0
- package/dist/src/document-model/gen/operation/operations.d.ts +14 -0
- package/dist/src/document-model/gen/operation-error/actions.d.ts +10 -0
- package/dist/src/document-model/gen/operation-error/creators.d.ts +9 -0
- package/dist/src/document-model/gen/operation-error/object.d.ts +13 -0
- package/dist/src/document-model/gen/operation-error/operations.d.ts +11 -0
- package/dist/src/document-model/gen/operation-example/actions.d.ts +7 -0
- package/dist/src/document-model/gen/operation-example/creators.d.ts +6 -0
- package/dist/src/document-model/gen/operation-example/object.d.ts +10 -0
- package/dist/src/document-model/gen/operation-example/operations.d.ts +8 -0
- package/dist/src/document-model/gen/reducer.d.ts +5 -0
- package/dist/src/document-model/gen/schema/index.d.ts +2 -0
- package/dist/src/document-model/gen/schema/types.d.ts +453 -0
- package/dist/src/document-model/gen/schema/zod.d.ts +453 -0
- package/dist/src/document-model/gen/state/actions.d.ts +9 -0
- package/dist/src/document-model/gen/state/creators.d.ts +8 -0
- package/dist/src/document-model/gen/state/object.d.ts +12 -0
- package/dist/src/document-model/gen/state/operations.d.ts +10 -0
- package/dist/src/document-model/gen/types.d.ts +8 -0
- package/dist/src/document-model/gen/utils.d.ts +6 -0
- package/dist/src/document-model/gen/versioning/actions.d.ts +8 -0
- package/dist/src/document-model/gen/versioning/creators.d.ts +7 -0
- package/dist/src/document-model/gen/versioning/object.d.ts +11 -0
- package/dist/src/document-model/gen/versioning/operations.d.ts +9 -0
- package/dist/src/document-model/index.d.ts +80 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +1 -1
- package/dist/browser/es/internal/index-BzNpRs2a.js +0 -44
- package/dist/node/es/internal/index-8lUz8qED.js +0 -44
|
@@ -0,0 +1,1210 @@
|
|
|
1
|
+
import type { BaseAction } from './actions/types';
|
|
2
|
+
import type { SignalDispatch } from './signal';
|
|
3
|
+
import type { Action, AttachmentRef, Document, ExtendedState, OperationScope, Reducer, ReducerOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* This is an abstract class representing a document and provides methods
|
|
6
|
+
* for creating and manipulating documents.
|
|
7
|
+
* @typeparam T - The type of data stored in the document.
|
|
8
|
+
* @typeparam A - The type of action the document can take.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
11
|
+
protected _document: Document<T, A, L>;
|
|
12
|
+
private _reducer;
|
|
13
|
+
private _signalDispatch?;
|
|
14
|
+
/**
|
|
15
|
+
* Constructs a BaseDocument instance with an initial state.
|
|
16
|
+
* @param reducer - The reducer function that updates the state.
|
|
17
|
+
* @param document - The initial state of the document.
|
|
18
|
+
*/
|
|
19
|
+
constructor(reducer: Reducer<T, A, L>, document: Document<T, A, L>, signalDispatch?: SignalDispatch);
|
|
20
|
+
/**
|
|
21
|
+
* Dispatches an action to update the state of the document.
|
|
22
|
+
* @param action - The action to dispatch.
|
|
23
|
+
* @returns The Document instance.
|
|
24
|
+
*/
|
|
25
|
+
protected dispatch(action: A | BaseAction, options?: ReducerOptions): this;
|
|
26
|
+
/**
|
|
27
|
+
* Saves the state of the document to a file.
|
|
28
|
+
* @param path - The file path where the state should be saved.
|
|
29
|
+
* @param extension - The file extension to use when saving the state.
|
|
30
|
+
* @returns The file path where the state was saved.
|
|
31
|
+
*/
|
|
32
|
+
protected saveToFile(path: string, extension: string, name?: string): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Loads the state of the document from a file.
|
|
35
|
+
* @param path - The file path where the state is stored.
|
|
36
|
+
*/
|
|
37
|
+
loadFromFile(path: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Loads the state of the document from a file and returns it.
|
|
40
|
+
* @param path - The file path where the state is stored.
|
|
41
|
+
* @param reducer - The reducer function that updates the state.
|
|
42
|
+
* @returns The state of the document.
|
|
43
|
+
*/
|
|
44
|
+
protected static stateFromFile<T, A extends Action, L>(path: string, reducer: Reducer<T, A, L>): Promise<Document<T, A, L>>;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the current state of the document.
|
|
47
|
+
*/
|
|
48
|
+
get state(): {
|
|
49
|
+
readonly global: import("immer").Immutable<T>;
|
|
50
|
+
readonly local: import("immer").Immutable<L>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Gets the list of operations performed on the document.
|
|
54
|
+
*/
|
|
55
|
+
get operations(): {
|
|
56
|
+
readonly global: readonly ({
|
|
57
|
+
readonly type: "LOAD_STATE";
|
|
58
|
+
readonly input: {
|
|
59
|
+
readonly operations: number;
|
|
60
|
+
readonly state: {
|
|
61
|
+
readonly data?: unknown;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly scope: OperationScope;
|
|
66
|
+
readonly attachments?: readonly {
|
|
67
|
+
readonly data: string;
|
|
68
|
+
readonly mimeType: string;
|
|
69
|
+
readonly extension?: string | null | undefined;
|
|
70
|
+
readonly fileName?: string | null | undefined;
|
|
71
|
+
readonly hash: string;
|
|
72
|
+
}[] | undefined;
|
|
73
|
+
readonly context?: {
|
|
74
|
+
readonly signer?: {
|
|
75
|
+
readonly user: {
|
|
76
|
+
readonly address: string;
|
|
77
|
+
readonly networkId: string;
|
|
78
|
+
readonly chainId: number;
|
|
79
|
+
};
|
|
80
|
+
readonly app: {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly key: string;
|
|
83
|
+
};
|
|
84
|
+
readonly signature: string;
|
|
85
|
+
} | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
readonly index: number;
|
|
88
|
+
readonly timestamp: string;
|
|
89
|
+
readonly hash: string;
|
|
90
|
+
readonly skip: number;
|
|
91
|
+
readonly error?: string | undefined;
|
|
92
|
+
readonly resultingState?: unknown;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "PRUNE";
|
|
95
|
+
readonly input: {
|
|
96
|
+
readonly end?: import("./types").InputMaybe<number>;
|
|
97
|
+
readonly start?: import("./types").InputMaybe<number>;
|
|
98
|
+
};
|
|
99
|
+
readonly scope: OperationScope;
|
|
100
|
+
readonly attachments?: readonly {
|
|
101
|
+
readonly data: string;
|
|
102
|
+
readonly mimeType: string;
|
|
103
|
+
readonly extension?: string | null | undefined;
|
|
104
|
+
readonly fileName?: string | null | undefined;
|
|
105
|
+
readonly hash: string;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
readonly context?: {
|
|
108
|
+
readonly signer?: {
|
|
109
|
+
readonly user: {
|
|
110
|
+
readonly address: string;
|
|
111
|
+
readonly networkId: string;
|
|
112
|
+
readonly chainId: number;
|
|
113
|
+
};
|
|
114
|
+
readonly app: {
|
|
115
|
+
readonly name: string;
|
|
116
|
+
readonly key: string;
|
|
117
|
+
};
|
|
118
|
+
readonly signature: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
readonly index: number;
|
|
122
|
+
readonly timestamp: string;
|
|
123
|
+
readonly hash: string;
|
|
124
|
+
readonly skip: number;
|
|
125
|
+
readonly error?: string | undefined;
|
|
126
|
+
readonly resultingState?: unknown;
|
|
127
|
+
} | {
|
|
128
|
+
readonly type: "REDO";
|
|
129
|
+
readonly input: number;
|
|
130
|
+
readonly scope: OperationScope;
|
|
131
|
+
readonly attachments?: readonly {
|
|
132
|
+
readonly data: string;
|
|
133
|
+
readonly mimeType: string;
|
|
134
|
+
readonly extension?: string | null | undefined;
|
|
135
|
+
readonly fileName?: string | null | undefined;
|
|
136
|
+
readonly hash: string;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
readonly context?: {
|
|
139
|
+
readonly signer?: {
|
|
140
|
+
readonly user: {
|
|
141
|
+
readonly address: string;
|
|
142
|
+
readonly networkId: string;
|
|
143
|
+
readonly chainId: number;
|
|
144
|
+
};
|
|
145
|
+
readonly app: {
|
|
146
|
+
readonly name: string;
|
|
147
|
+
readonly key: string;
|
|
148
|
+
};
|
|
149
|
+
readonly signature: string;
|
|
150
|
+
} | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
readonly index: number;
|
|
153
|
+
readonly timestamp: string;
|
|
154
|
+
readonly hash: string;
|
|
155
|
+
readonly skip: number;
|
|
156
|
+
readonly error?: string | undefined;
|
|
157
|
+
readonly resultingState?: unknown;
|
|
158
|
+
} | {
|
|
159
|
+
readonly type: "SET_NAME";
|
|
160
|
+
readonly input: string;
|
|
161
|
+
readonly scope: OperationScope;
|
|
162
|
+
readonly attachments?: readonly {
|
|
163
|
+
readonly data: string;
|
|
164
|
+
readonly mimeType: string;
|
|
165
|
+
readonly extension?: string | null | undefined;
|
|
166
|
+
readonly fileName?: string | null | undefined;
|
|
167
|
+
readonly hash: string;
|
|
168
|
+
}[] | undefined;
|
|
169
|
+
readonly context?: {
|
|
170
|
+
readonly signer?: {
|
|
171
|
+
readonly user: {
|
|
172
|
+
readonly address: string;
|
|
173
|
+
readonly networkId: string;
|
|
174
|
+
readonly chainId: number;
|
|
175
|
+
};
|
|
176
|
+
readonly app: {
|
|
177
|
+
readonly name: string;
|
|
178
|
+
readonly key: string;
|
|
179
|
+
};
|
|
180
|
+
readonly signature: string;
|
|
181
|
+
} | undefined;
|
|
182
|
+
} | undefined;
|
|
183
|
+
readonly index: number;
|
|
184
|
+
readonly timestamp: string;
|
|
185
|
+
readonly hash: string;
|
|
186
|
+
readonly skip: number;
|
|
187
|
+
readonly error?: string | undefined;
|
|
188
|
+
readonly resultingState?: unknown;
|
|
189
|
+
} | {
|
|
190
|
+
readonly type: "UNDO";
|
|
191
|
+
readonly input: number;
|
|
192
|
+
readonly scope: OperationScope;
|
|
193
|
+
readonly attachments?: readonly {
|
|
194
|
+
readonly data: string;
|
|
195
|
+
readonly mimeType: string;
|
|
196
|
+
readonly extension?: string | null | undefined;
|
|
197
|
+
readonly fileName?: string | null | undefined;
|
|
198
|
+
readonly hash: string;
|
|
199
|
+
}[] | undefined;
|
|
200
|
+
readonly context?: {
|
|
201
|
+
readonly signer?: {
|
|
202
|
+
readonly user: {
|
|
203
|
+
readonly address: string;
|
|
204
|
+
readonly networkId: string;
|
|
205
|
+
readonly chainId: number;
|
|
206
|
+
};
|
|
207
|
+
readonly app: {
|
|
208
|
+
readonly name: string;
|
|
209
|
+
readonly key: string;
|
|
210
|
+
};
|
|
211
|
+
readonly signature: string;
|
|
212
|
+
} | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
readonly index: number;
|
|
215
|
+
readonly timestamp: string;
|
|
216
|
+
readonly hash: string;
|
|
217
|
+
readonly skip: number;
|
|
218
|
+
readonly error?: string | undefined;
|
|
219
|
+
readonly resultingState?: unknown;
|
|
220
|
+
} | {
|
|
221
|
+
readonly type: "NOOP";
|
|
222
|
+
readonly input: unknown;
|
|
223
|
+
readonly scope: OperationScope;
|
|
224
|
+
readonly attachments?: readonly {
|
|
225
|
+
readonly data: string;
|
|
226
|
+
readonly mimeType: string;
|
|
227
|
+
readonly extension?: string | null | undefined;
|
|
228
|
+
readonly fileName?: string | null | undefined;
|
|
229
|
+
readonly hash: string;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
readonly context?: {
|
|
232
|
+
readonly signer?: {
|
|
233
|
+
readonly user: {
|
|
234
|
+
readonly address: string;
|
|
235
|
+
readonly networkId: string;
|
|
236
|
+
readonly chainId: number;
|
|
237
|
+
};
|
|
238
|
+
readonly app: {
|
|
239
|
+
readonly name: string;
|
|
240
|
+
readonly key: string;
|
|
241
|
+
};
|
|
242
|
+
readonly signature: string;
|
|
243
|
+
} | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
readonly index: number;
|
|
246
|
+
readonly timestamp: string;
|
|
247
|
+
readonly hash: string;
|
|
248
|
+
readonly skip: number;
|
|
249
|
+
readonly error?: string | undefined;
|
|
250
|
+
readonly resultingState?: unknown;
|
|
251
|
+
} | import("immer").Immutable<A & {
|
|
252
|
+
index: number;
|
|
253
|
+
timestamp: string;
|
|
254
|
+
hash: string;
|
|
255
|
+
skip: number;
|
|
256
|
+
error?: string | undefined;
|
|
257
|
+
resultingState?: unknown;
|
|
258
|
+
}>)[];
|
|
259
|
+
readonly local: readonly ({
|
|
260
|
+
readonly type: "LOAD_STATE";
|
|
261
|
+
readonly input: {
|
|
262
|
+
readonly operations: number;
|
|
263
|
+
readonly state: {
|
|
264
|
+
readonly data?: unknown;
|
|
265
|
+
readonly name: string;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
readonly scope: OperationScope;
|
|
269
|
+
readonly attachments?: readonly {
|
|
270
|
+
readonly data: string;
|
|
271
|
+
readonly mimeType: string;
|
|
272
|
+
readonly extension?: string | null | undefined;
|
|
273
|
+
readonly fileName?: string | null | undefined;
|
|
274
|
+
readonly hash: string;
|
|
275
|
+
}[] | undefined;
|
|
276
|
+
readonly context?: {
|
|
277
|
+
readonly signer?: {
|
|
278
|
+
readonly user: {
|
|
279
|
+
readonly address: string;
|
|
280
|
+
readonly networkId: string;
|
|
281
|
+
readonly chainId: number;
|
|
282
|
+
};
|
|
283
|
+
readonly app: {
|
|
284
|
+
readonly name: string;
|
|
285
|
+
readonly key: string;
|
|
286
|
+
};
|
|
287
|
+
readonly signature: string;
|
|
288
|
+
} | undefined;
|
|
289
|
+
} | undefined;
|
|
290
|
+
readonly index: number;
|
|
291
|
+
readonly timestamp: string;
|
|
292
|
+
readonly hash: string;
|
|
293
|
+
readonly skip: number;
|
|
294
|
+
readonly error?: string | undefined;
|
|
295
|
+
readonly resultingState?: unknown;
|
|
296
|
+
} | {
|
|
297
|
+
readonly type: "PRUNE";
|
|
298
|
+
readonly input: {
|
|
299
|
+
readonly end?: import("./types").InputMaybe<number>;
|
|
300
|
+
readonly start?: import("./types").InputMaybe<number>;
|
|
301
|
+
};
|
|
302
|
+
readonly scope: OperationScope;
|
|
303
|
+
readonly attachments?: readonly {
|
|
304
|
+
readonly data: string;
|
|
305
|
+
readonly mimeType: string;
|
|
306
|
+
readonly extension?: string | null | undefined;
|
|
307
|
+
readonly fileName?: string | null | undefined;
|
|
308
|
+
readonly hash: string;
|
|
309
|
+
}[] | undefined;
|
|
310
|
+
readonly context?: {
|
|
311
|
+
readonly signer?: {
|
|
312
|
+
readonly user: {
|
|
313
|
+
readonly address: string;
|
|
314
|
+
readonly networkId: string;
|
|
315
|
+
readonly chainId: number;
|
|
316
|
+
};
|
|
317
|
+
readonly app: {
|
|
318
|
+
readonly name: string;
|
|
319
|
+
readonly key: string;
|
|
320
|
+
};
|
|
321
|
+
readonly signature: string;
|
|
322
|
+
} | undefined;
|
|
323
|
+
} | undefined;
|
|
324
|
+
readonly index: number;
|
|
325
|
+
readonly timestamp: string;
|
|
326
|
+
readonly hash: string;
|
|
327
|
+
readonly skip: number;
|
|
328
|
+
readonly error?: string | undefined;
|
|
329
|
+
readonly resultingState?: unknown;
|
|
330
|
+
} | {
|
|
331
|
+
readonly type: "REDO";
|
|
332
|
+
readonly input: number;
|
|
333
|
+
readonly scope: OperationScope;
|
|
334
|
+
readonly attachments?: readonly {
|
|
335
|
+
readonly data: string;
|
|
336
|
+
readonly mimeType: string;
|
|
337
|
+
readonly extension?: string | null | undefined;
|
|
338
|
+
readonly fileName?: string | null | undefined;
|
|
339
|
+
readonly hash: string;
|
|
340
|
+
}[] | undefined;
|
|
341
|
+
readonly context?: {
|
|
342
|
+
readonly signer?: {
|
|
343
|
+
readonly user: {
|
|
344
|
+
readonly address: string;
|
|
345
|
+
readonly networkId: string;
|
|
346
|
+
readonly chainId: number;
|
|
347
|
+
};
|
|
348
|
+
readonly app: {
|
|
349
|
+
readonly name: string;
|
|
350
|
+
readonly key: string;
|
|
351
|
+
};
|
|
352
|
+
readonly signature: string;
|
|
353
|
+
} | undefined;
|
|
354
|
+
} | undefined;
|
|
355
|
+
readonly index: number;
|
|
356
|
+
readonly timestamp: string;
|
|
357
|
+
readonly hash: string;
|
|
358
|
+
readonly skip: number;
|
|
359
|
+
readonly error?: string | undefined;
|
|
360
|
+
readonly resultingState?: unknown;
|
|
361
|
+
} | {
|
|
362
|
+
readonly type: "SET_NAME";
|
|
363
|
+
readonly input: string;
|
|
364
|
+
readonly scope: OperationScope;
|
|
365
|
+
readonly attachments?: readonly {
|
|
366
|
+
readonly data: string;
|
|
367
|
+
readonly mimeType: string;
|
|
368
|
+
readonly extension?: string | null | undefined;
|
|
369
|
+
readonly fileName?: string | null | undefined;
|
|
370
|
+
readonly hash: string;
|
|
371
|
+
}[] | undefined;
|
|
372
|
+
readonly context?: {
|
|
373
|
+
readonly signer?: {
|
|
374
|
+
readonly user: {
|
|
375
|
+
readonly address: string;
|
|
376
|
+
readonly networkId: string;
|
|
377
|
+
readonly chainId: number;
|
|
378
|
+
};
|
|
379
|
+
readonly app: {
|
|
380
|
+
readonly name: string;
|
|
381
|
+
readonly key: string;
|
|
382
|
+
};
|
|
383
|
+
readonly signature: string;
|
|
384
|
+
} | undefined;
|
|
385
|
+
} | undefined;
|
|
386
|
+
readonly index: number;
|
|
387
|
+
readonly timestamp: string;
|
|
388
|
+
readonly hash: string;
|
|
389
|
+
readonly skip: number;
|
|
390
|
+
readonly error?: string | undefined;
|
|
391
|
+
readonly resultingState?: unknown;
|
|
392
|
+
} | {
|
|
393
|
+
readonly type: "UNDO";
|
|
394
|
+
readonly input: number;
|
|
395
|
+
readonly scope: OperationScope;
|
|
396
|
+
readonly attachments?: readonly {
|
|
397
|
+
readonly data: string;
|
|
398
|
+
readonly mimeType: string;
|
|
399
|
+
readonly extension?: string | null | undefined;
|
|
400
|
+
readonly fileName?: string | null | undefined;
|
|
401
|
+
readonly hash: string;
|
|
402
|
+
}[] | undefined;
|
|
403
|
+
readonly context?: {
|
|
404
|
+
readonly signer?: {
|
|
405
|
+
readonly user: {
|
|
406
|
+
readonly address: string;
|
|
407
|
+
readonly networkId: string;
|
|
408
|
+
readonly chainId: number;
|
|
409
|
+
};
|
|
410
|
+
readonly app: {
|
|
411
|
+
readonly name: string;
|
|
412
|
+
readonly key: string;
|
|
413
|
+
};
|
|
414
|
+
readonly signature: string;
|
|
415
|
+
} | undefined;
|
|
416
|
+
} | undefined;
|
|
417
|
+
readonly index: number;
|
|
418
|
+
readonly timestamp: string;
|
|
419
|
+
readonly hash: string;
|
|
420
|
+
readonly skip: number;
|
|
421
|
+
readonly error?: string | undefined;
|
|
422
|
+
readonly resultingState?: unknown;
|
|
423
|
+
} | {
|
|
424
|
+
readonly type: "NOOP";
|
|
425
|
+
readonly input: unknown;
|
|
426
|
+
readonly scope: OperationScope;
|
|
427
|
+
readonly attachments?: readonly {
|
|
428
|
+
readonly data: string;
|
|
429
|
+
readonly mimeType: string;
|
|
430
|
+
readonly extension?: string | null | undefined;
|
|
431
|
+
readonly fileName?: string | null | undefined;
|
|
432
|
+
readonly hash: string;
|
|
433
|
+
}[] | undefined;
|
|
434
|
+
readonly context?: {
|
|
435
|
+
readonly signer?: {
|
|
436
|
+
readonly user: {
|
|
437
|
+
readonly address: string;
|
|
438
|
+
readonly networkId: string;
|
|
439
|
+
readonly chainId: number;
|
|
440
|
+
};
|
|
441
|
+
readonly app: {
|
|
442
|
+
readonly name: string;
|
|
443
|
+
readonly key: string;
|
|
444
|
+
};
|
|
445
|
+
readonly signature: string;
|
|
446
|
+
} | undefined;
|
|
447
|
+
} | undefined;
|
|
448
|
+
readonly index: number;
|
|
449
|
+
readonly timestamp: string;
|
|
450
|
+
readonly hash: string;
|
|
451
|
+
readonly skip: number;
|
|
452
|
+
readonly error?: string | undefined;
|
|
453
|
+
readonly resultingState?: unknown;
|
|
454
|
+
} | import("immer").Immutable<A & {
|
|
455
|
+
index: number;
|
|
456
|
+
timestamp: string;
|
|
457
|
+
hash: string;
|
|
458
|
+
skip: number;
|
|
459
|
+
error?: string | undefined;
|
|
460
|
+
resultingState?: unknown;
|
|
461
|
+
}>)[];
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Gets the name of the document.
|
|
465
|
+
*/
|
|
466
|
+
get name(): string;
|
|
467
|
+
/**
|
|
468
|
+
* Gets the type of document.
|
|
469
|
+
*/
|
|
470
|
+
get documentType(): string;
|
|
471
|
+
/**
|
|
472
|
+
* Gets the timestamp of the date the document was created.
|
|
473
|
+
*/
|
|
474
|
+
get created(): string;
|
|
475
|
+
/**
|
|
476
|
+
* Gets the timestamp of the date the document was last modified.
|
|
477
|
+
*/
|
|
478
|
+
get lastModified(): string;
|
|
479
|
+
/**
|
|
480
|
+
* Gets the global revision number of the document.
|
|
481
|
+
*/
|
|
482
|
+
get revision(): number;
|
|
483
|
+
getRevision(scope: OperationScope): number;
|
|
484
|
+
/**
|
|
485
|
+
* Gets the initial state of the document.
|
|
486
|
+
*/
|
|
487
|
+
get initialState(): {
|
|
488
|
+
readonly name: string;
|
|
489
|
+
readonly revision: {
|
|
490
|
+
readonly global: number;
|
|
491
|
+
readonly local: number;
|
|
492
|
+
};
|
|
493
|
+
readonly documentType: string;
|
|
494
|
+
readonly created: string;
|
|
495
|
+
readonly lastModified: string;
|
|
496
|
+
readonly state: {
|
|
497
|
+
readonly global: import("immer").Immutable<T>;
|
|
498
|
+
readonly local: import("immer").Immutable<L>;
|
|
499
|
+
};
|
|
500
|
+
readonly attachments: {
|
|
501
|
+
readonly [x: string]: {
|
|
502
|
+
readonly data: string;
|
|
503
|
+
readonly mimeType: string;
|
|
504
|
+
readonly extension?: string | null | undefined;
|
|
505
|
+
readonly fileName?: string | null | undefined;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* Returns the current document as an object
|
|
511
|
+
*/
|
|
512
|
+
toDocument(): {
|
|
513
|
+
readonly name: string;
|
|
514
|
+
readonly revision: {
|
|
515
|
+
readonly global: number;
|
|
516
|
+
readonly local: number;
|
|
517
|
+
};
|
|
518
|
+
readonly documentType: string;
|
|
519
|
+
readonly created: string;
|
|
520
|
+
readonly lastModified: string;
|
|
521
|
+
readonly state: {
|
|
522
|
+
readonly global: import("immer").Immutable<T>;
|
|
523
|
+
readonly local: import("immer").Immutable<L>;
|
|
524
|
+
};
|
|
525
|
+
readonly attachments: {
|
|
526
|
+
readonly [x: string]: {
|
|
527
|
+
readonly data: string;
|
|
528
|
+
readonly mimeType: string;
|
|
529
|
+
readonly extension?: string | null | undefined;
|
|
530
|
+
readonly fileName?: string | null | undefined;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
readonly operations: {
|
|
534
|
+
readonly global: readonly ({
|
|
535
|
+
readonly type: "LOAD_STATE";
|
|
536
|
+
readonly input: {
|
|
537
|
+
readonly operations: number;
|
|
538
|
+
readonly state: {
|
|
539
|
+
readonly data?: unknown;
|
|
540
|
+
readonly name: string;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
readonly scope: OperationScope;
|
|
544
|
+
readonly attachments?: readonly {
|
|
545
|
+
readonly data: string;
|
|
546
|
+
readonly mimeType: string;
|
|
547
|
+
readonly extension?: string | null | undefined;
|
|
548
|
+
readonly fileName?: string | null | undefined;
|
|
549
|
+
readonly hash: string;
|
|
550
|
+
}[] | undefined;
|
|
551
|
+
readonly context?: {
|
|
552
|
+
readonly signer?: {
|
|
553
|
+
readonly user: {
|
|
554
|
+
readonly address: string;
|
|
555
|
+
readonly networkId: string;
|
|
556
|
+
readonly chainId: number;
|
|
557
|
+
};
|
|
558
|
+
readonly app: {
|
|
559
|
+
readonly name: string;
|
|
560
|
+
readonly key: string;
|
|
561
|
+
};
|
|
562
|
+
readonly signature: string;
|
|
563
|
+
} | undefined;
|
|
564
|
+
} | undefined;
|
|
565
|
+
readonly index: number;
|
|
566
|
+
readonly timestamp: string;
|
|
567
|
+
readonly hash: string;
|
|
568
|
+
readonly skip: number;
|
|
569
|
+
readonly error?: string | undefined;
|
|
570
|
+
readonly resultingState?: unknown;
|
|
571
|
+
} | {
|
|
572
|
+
readonly type: "PRUNE";
|
|
573
|
+
readonly input: {
|
|
574
|
+
readonly end?: import("./types").InputMaybe<number>;
|
|
575
|
+
readonly start?: import("./types").InputMaybe<number>;
|
|
576
|
+
};
|
|
577
|
+
readonly scope: OperationScope;
|
|
578
|
+
readonly attachments?: readonly {
|
|
579
|
+
readonly data: string;
|
|
580
|
+
readonly mimeType: string;
|
|
581
|
+
readonly extension?: string | null | undefined;
|
|
582
|
+
readonly fileName?: string | null | undefined;
|
|
583
|
+
readonly hash: string;
|
|
584
|
+
}[] | undefined;
|
|
585
|
+
readonly context?: {
|
|
586
|
+
readonly signer?: {
|
|
587
|
+
readonly user: {
|
|
588
|
+
readonly address: string;
|
|
589
|
+
readonly networkId: string;
|
|
590
|
+
readonly chainId: number;
|
|
591
|
+
};
|
|
592
|
+
readonly app: {
|
|
593
|
+
readonly name: string;
|
|
594
|
+
readonly key: string;
|
|
595
|
+
};
|
|
596
|
+
readonly signature: string;
|
|
597
|
+
} | undefined;
|
|
598
|
+
} | undefined;
|
|
599
|
+
readonly index: number;
|
|
600
|
+
readonly timestamp: string;
|
|
601
|
+
readonly hash: string;
|
|
602
|
+
readonly skip: number;
|
|
603
|
+
readonly error?: string | undefined;
|
|
604
|
+
readonly resultingState?: unknown;
|
|
605
|
+
} | {
|
|
606
|
+
readonly type: "REDO";
|
|
607
|
+
readonly input: number;
|
|
608
|
+
readonly scope: OperationScope;
|
|
609
|
+
readonly attachments?: readonly {
|
|
610
|
+
readonly data: string;
|
|
611
|
+
readonly mimeType: string;
|
|
612
|
+
readonly extension?: string | null | undefined;
|
|
613
|
+
readonly fileName?: string | null | undefined;
|
|
614
|
+
readonly hash: string;
|
|
615
|
+
}[] | undefined;
|
|
616
|
+
readonly context?: {
|
|
617
|
+
readonly signer?: {
|
|
618
|
+
readonly user: {
|
|
619
|
+
readonly address: string;
|
|
620
|
+
readonly networkId: string;
|
|
621
|
+
readonly chainId: number;
|
|
622
|
+
};
|
|
623
|
+
readonly app: {
|
|
624
|
+
readonly name: string;
|
|
625
|
+
readonly key: string;
|
|
626
|
+
};
|
|
627
|
+
readonly signature: string;
|
|
628
|
+
} | undefined;
|
|
629
|
+
} | undefined;
|
|
630
|
+
readonly index: number;
|
|
631
|
+
readonly timestamp: string;
|
|
632
|
+
readonly hash: string;
|
|
633
|
+
readonly skip: number;
|
|
634
|
+
readonly error?: string | undefined;
|
|
635
|
+
readonly resultingState?: unknown;
|
|
636
|
+
} | {
|
|
637
|
+
readonly type: "SET_NAME";
|
|
638
|
+
readonly input: string;
|
|
639
|
+
readonly scope: OperationScope;
|
|
640
|
+
readonly attachments?: readonly {
|
|
641
|
+
readonly data: string;
|
|
642
|
+
readonly mimeType: string;
|
|
643
|
+
readonly extension?: string | null | undefined;
|
|
644
|
+
readonly fileName?: string | null | undefined;
|
|
645
|
+
readonly hash: string;
|
|
646
|
+
}[] | undefined;
|
|
647
|
+
readonly context?: {
|
|
648
|
+
readonly signer?: {
|
|
649
|
+
readonly user: {
|
|
650
|
+
readonly address: string;
|
|
651
|
+
readonly networkId: string;
|
|
652
|
+
readonly chainId: number;
|
|
653
|
+
};
|
|
654
|
+
readonly app: {
|
|
655
|
+
readonly name: string;
|
|
656
|
+
readonly key: string;
|
|
657
|
+
};
|
|
658
|
+
readonly signature: string;
|
|
659
|
+
} | undefined;
|
|
660
|
+
} | undefined;
|
|
661
|
+
readonly index: number;
|
|
662
|
+
readonly timestamp: string;
|
|
663
|
+
readonly hash: string;
|
|
664
|
+
readonly skip: number;
|
|
665
|
+
readonly error?: string | undefined;
|
|
666
|
+
readonly resultingState?: unknown;
|
|
667
|
+
} | {
|
|
668
|
+
readonly type: "UNDO";
|
|
669
|
+
readonly input: number;
|
|
670
|
+
readonly scope: OperationScope;
|
|
671
|
+
readonly attachments?: readonly {
|
|
672
|
+
readonly data: string;
|
|
673
|
+
readonly mimeType: string;
|
|
674
|
+
readonly extension?: string | null | undefined;
|
|
675
|
+
readonly fileName?: string | null | undefined;
|
|
676
|
+
readonly hash: string;
|
|
677
|
+
}[] | undefined;
|
|
678
|
+
readonly context?: {
|
|
679
|
+
readonly signer?: {
|
|
680
|
+
readonly user: {
|
|
681
|
+
readonly address: string;
|
|
682
|
+
readonly networkId: string;
|
|
683
|
+
readonly chainId: number;
|
|
684
|
+
};
|
|
685
|
+
readonly app: {
|
|
686
|
+
readonly name: string;
|
|
687
|
+
readonly key: string;
|
|
688
|
+
};
|
|
689
|
+
readonly signature: string;
|
|
690
|
+
} | undefined;
|
|
691
|
+
} | undefined;
|
|
692
|
+
readonly index: number;
|
|
693
|
+
readonly timestamp: string;
|
|
694
|
+
readonly hash: string;
|
|
695
|
+
readonly skip: number;
|
|
696
|
+
readonly error?: string | undefined;
|
|
697
|
+
readonly resultingState?: unknown;
|
|
698
|
+
} | {
|
|
699
|
+
readonly type: "NOOP";
|
|
700
|
+
readonly input: unknown;
|
|
701
|
+
readonly scope: OperationScope;
|
|
702
|
+
readonly attachments?: readonly {
|
|
703
|
+
readonly data: string;
|
|
704
|
+
readonly mimeType: string;
|
|
705
|
+
readonly extension?: string | null | undefined;
|
|
706
|
+
readonly fileName?: string | null | undefined;
|
|
707
|
+
readonly hash: string;
|
|
708
|
+
}[] | undefined;
|
|
709
|
+
readonly context?: {
|
|
710
|
+
readonly signer?: {
|
|
711
|
+
readonly user: {
|
|
712
|
+
readonly address: string;
|
|
713
|
+
readonly networkId: string;
|
|
714
|
+
readonly chainId: number;
|
|
715
|
+
};
|
|
716
|
+
readonly app: {
|
|
717
|
+
readonly name: string;
|
|
718
|
+
readonly key: string;
|
|
719
|
+
};
|
|
720
|
+
readonly signature: string;
|
|
721
|
+
} | undefined;
|
|
722
|
+
} | undefined;
|
|
723
|
+
readonly index: number;
|
|
724
|
+
readonly timestamp: string;
|
|
725
|
+
readonly hash: string;
|
|
726
|
+
readonly skip: number;
|
|
727
|
+
readonly error?: string | undefined;
|
|
728
|
+
readonly resultingState?: unknown;
|
|
729
|
+
} | import("immer").Immutable<A & {
|
|
730
|
+
index: number;
|
|
731
|
+
timestamp: string;
|
|
732
|
+
hash: string;
|
|
733
|
+
skip: number;
|
|
734
|
+
error?: string | undefined;
|
|
735
|
+
resultingState?: unknown;
|
|
736
|
+
}>)[];
|
|
737
|
+
readonly local: readonly ({
|
|
738
|
+
readonly type: "LOAD_STATE";
|
|
739
|
+
readonly input: {
|
|
740
|
+
readonly operations: number;
|
|
741
|
+
readonly state: {
|
|
742
|
+
readonly data?: unknown;
|
|
743
|
+
readonly name: string;
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
readonly scope: OperationScope;
|
|
747
|
+
readonly attachments?: readonly {
|
|
748
|
+
readonly data: string;
|
|
749
|
+
readonly mimeType: string;
|
|
750
|
+
readonly extension?: string | null | undefined;
|
|
751
|
+
readonly fileName?: string | null | undefined;
|
|
752
|
+
readonly hash: string;
|
|
753
|
+
}[] | undefined;
|
|
754
|
+
readonly context?: {
|
|
755
|
+
readonly signer?: {
|
|
756
|
+
readonly user: {
|
|
757
|
+
readonly address: string;
|
|
758
|
+
readonly networkId: string;
|
|
759
|
+
readonly chainId: number;
|
|
760
|
+
};
|
|
761
|
+
readonly app: {
|
|
762
|
+
readonly name: string;
|
|
763
|
+
readonly key: string;
|
|
764
|
+
};
|
|
765
|
+
readonly signature: string;
|
|
766
|
+
} | undefined;
|
|
767
|
+
} | undefined;
|
|
768
|
+
readonly index: number;
|
|
769
|
+
readonly timestamp: string;
|
|
770
|
+
readonly hash: string;
|
|
771
|
+
readonly skip: number;
|
|
772
|
+
readonly error?: string | undefined;
|
|
773
|
+
readonly resultingState?: unknown;
|
|
774
|
+
} | {
|
|
775
|
+
readonly type: "PRUNE";
|
|
776
|
+
readonly input: {
|
|
777
|
+
readonly end?: import("./types").InputMaybe<number>;
|
|
778
|
+
readonly start?: import("./types").InputMaybe<number>;
|
|
779
|
+
};
|
|
780
|
+
readonly scope: OperationScope;
|
|
781
|
+
readonly attachments?: readonly {
|
|
782
|
+
readonly data: string;
|
|
783
|
+
readonly mimeType: string;
|
|
784
|
+
readonly extension?: string | null | undefined;
|
|
785
|
+
readonly fileName?: string | null | undefined;
|
|
786
|
+
readonly hash: string;
|
|
787
|
+
}[] | undefined;
|
|
788
|
+
readonly context?: {
|
|
789
|
+
readonly signer?: {
|
|
790
|
+
readonly user: {
|
|
791
|
+
readonly address: string;
|
|
792
|
+
readonly networkId: string;
|
|
793
|
+
readonly chainId: number;
|
|
794
|
+
};
|
|
795
|
+
readonly app: {
|
|
796
|
+
readonly name: string;
|
|
797
|
+
readonly key: string;
|
|
798
|
+
};
|
|
799
|
+
readonly signature: string;
|
|
800
|
+
} | undefined;
|
|
801
|
+
} | undefined;
|
|
802
|
+
readonly index: number;
|
|
803
|
+
readonly timestamp: string;
|
|
804
|
+
readonly hash: string;
|
|
805
|
+
readonly skip: number;
|
|
806
|
+
readonly error?: string | undefined;
|
|
807
|
+
readonly resultingState?: unknown;
|
|
808
|
+
} | {
|
|
809
|
+
readonly type: "REDO";
|
|
810
|
+
readonly input: number;
|
|
811
|
+
readonly scope: OperationScope;
|
|
812
|
+
readonly attachments?: readonly {
|
|
813
|
+
readonly data: string;
|
|
814
|
+
readonly mimeType: string;
|
|
815
|
+
readonly extension?: string | null | undefined;
|
|
816
|
+
readonly fileName?: string | null | undefined;
|
|
817
|
+
readonly hash: string;
|
|
818
|
+
}[] | undefined;
|
|
819
|
+
readonly context?: {
|
|
820
|
+
readonly signer?: {
|
|
821
|
+
readonly user: {
|
|
822
|
+
readonly address: string;
|
|
823
|
+
readonly networkId: string;
|
|
824
|
+
readonly chainId: number;
|
|
825
|
+
};
|
|
826
|
+
readonly app: {
|
|
827
|
+
readonly name: string;
|
|
828
|
+
readonly key: string;
|
|
829
|
+
};
|
|
830
|
+
readonly signature: string;
|
|
831
|
+
} | undefined;
|
|
832
|
+
} | undefined;
|
|
833
|
+
readonly index: number;
|
|
834
|
+
readonly timestamp: string;
|
|
835
|
+
readonly hash: string;
|
|
836
|
+
readonly skip: number;
|
|
837
|
+
readonly error?: string | undefined;
|
|
838
|
+
readonly resultingState?: unknown;
|
|
839
|
+
} | {
|
|
840
|
+
readonly type: "SET_NAME";
|
|
841
|
+
readonly input: string;
|
|
842
|
+
readonly scope: OperationScope;
|
|
843
|
+
readonly attachments?: readonly {
|
|
844
|
+
readonly data: string;
|
|
845
|
+
readonly mimeType: string;
|
|
846
|
+
readonly extension?: string | null | undefined;
|
|
847
|
+
readonly fileName?: string | null | undefined;
|
|
848
|
+
readonly hash: string;
|
|
849
|
+
}[] | undefined;
|
|
850
|
+
readonly context?: {
|
|
851
|
+
readonly signer?: {
|
|
852
|
+
readonly user: {
|
|
853
|
+
readonly address: string;
|
|
854
|
+
readonly networkId: string;
|
|
855
|
+
readonly chainId: number;
|
|
856
|
+
};
|
|
857
|
+
readonly app: {
|
|
858
|
+
readonly name: string;
|
|
859
|
+
readonly key: string;
|
|
860
|
+
};
|
|
861
|
+
readonly signature: string;
|
|
862
|
+
} | undefined;
|
|
863
|
+
} | undefined;
|
|
864
|
+
readonly index: number;
|
|
865
|
+
readonly timestamp: string;
|
|
866
|
+
readonly hash: string;
|
|
867
|
+
readonly skip: number;
|
|
868
|
+
readonly error?: string | undefined;
|
|
869
|
+
readonly resultingState?: unknown;
|
|
870
|
+
} | {
|
|
871
|
+
readonly type: "UNDO";
|
|
872
|
+
readonly input: number;
|
|
873
|
+
readonly scope: OperationScope;
|
|
874
|
+
readonly attachments?: readonly {
|
|
875
|
+
readonly data: string;
|
|
876
|
+
readonly mimeType: string;
|
|
877
|
+
readonly extension?: string | null | undefined;
|
|
878
|
+
readonly fileName?: string | null | undefined;
|
|
879
|
+
readonly hash: string;
|
|
880
|
+
}[] | undefined;
|
|
881
|
+
readonly context?: {
|
|
882
|
+
readonly signer?: {
|
|
883
|
+
readonly user: {
|
|
884
|
+
readonly address: string;
|
|
885
|
+
readonly networkId: string;
|
|
886
|
+
readonly chainId: number;
|
|
887
|
+
};
|
|
888
|
+
readonly app: {
|
|
889
|
+
readonly name: string;
|
|
890
|
+
readonly key: string;
|
|
891
|
+
};
|
|
892
|
+
readonly signature: string;
|
|
893
|
+
} | undefined;
|
|
894
|
+
} | undefined;
|
|
895
|
+
readonly index: number;
|
|
896
|
+
readonly timestamp: string;
|
|
897
|
+
readonly hash: string;
|
|
898
|
+
readonly skip: number;
|
|
899
|
+
readonly error?: string | undefined;
|
|
900
|
+
readonly resultingState?: unknown;
|
|
901
|
+
} | {
|
|
902
|
+
readonly type: "NOOP";
|
|
903
|
+
readonly input: unknown;
|
|
904
|
+
readonly scope: OperationScope;
|
|
905
|
+
readonly attachments?: readonly {
|
|
906
|
+
readonly data: string;
|
|
907
|
+
readonly mimeType: string;
|
|
908
|
+
readonly extension?: string | null | undefined;
|
|
909
|
+
readonly fileName?: string | null | undefined;
|
|
910
|
+
readonly hash: string;
|
|
911
|
+
}[] | undefined;
|
|
912
|
+
readonly context?: {
|
|
913
|
+
readonly signer?: {
|
|
914
|
+
readonly user: {
|
|
915
|
+
readonly address: string;
|
|
916
|
+
readonly networkId: string;
|
|
917
|
+
readonly chainId: number;
|
|
918
|
+
};
|
|
919
|
+
readonly app: {
|
|
920
|
+
readonly name: string;
|
|
921
|
+
readonly key: string;
|
|
922
|
+
};
|
|
923
|
+
readonly signature: string;
|
|
924
|
+
} | undefined;
|
|
925
|
+
} | undefined;
|
|
926
|
+
readonly index: number;
|
|
927
|
+
readonly timestamp: string;
|
|
928
|
+
readonly hash: string;
|
|
929
|
+
readonly skip: number;
|
|
930
|
+
readonly error?: string | undefined;
|
|
931
|
+
readonly resultingState?: unknown;
|
|
932
|
+
} | import("immer").Immutable<A & {
|
|
933
|
+
index: number;
|
|
934
|
+
timestamp: string;
|
|
935
|
+
hash: string;
|
|
936
|
+
skip: number;
|
|
937
|
+
error?: string | undefined;
|
|
938
|
+
resultingState?: unknown;
|
|
939
|
+
}>)[];
|
|
940
|
+
};
|
|
941
|
+
readonly initialState: {
|
|
942
|
+
readonly name: string;
|
|
943
|
+
readonly revision: {
|
|
944
|
+
readonly global: number;
|
|
945
|
+
readonly local: number;
|
|
946
|
+
};
|
|
947
|
+
readonly documentType: string;
|
|
948
|
+
readonly created: string;
|
|
949
|
+
readonly lastModified: string;
|
|
950
|
+
readonly state: {
|
|
951
|
+
readonly global: import("immer").Immutable<T>;
|
|
952
|
+
readonly local: import("immer").Immutable<L>;
|
|
953
|
+
};
|
|
954
|
+
readonly attachments: {
|
|
955
|
+
readonly [x: string]: {
|
|
956
|
+
readonly data: string;
|
|
957
|
+
readonly mimeType: string;
|
|
958
|
+
readonly extension?: string | null | undefined;
|
|
959
|
+
readonly fileName?: string | null | undefined;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
readonly clipboard: readonly ({
|
|
964
|
+
readonly type: "LOAD_STATE";
|
|
965
|
+
readonly input: {
|
|
966
|
+
readonly operations: number;
|
|
967
|
+
readonly state: {
|
|
968
|
+
readonly data?: unknown;
|
|
969
|
+
readonly name: string;
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
readonly scope: OperationScope;
|
|
973
|
+
readonly attachments?: readonly {
|
|
974
|
+
readonly data: string;
|
|
975
|
+
readonly mimeType: string;
|
|
976
|
+
readonly extension?: string | null | undefined;
|
|
977
|
+
readonly fileName?: string | null | undefined;
|
|
978
|
+
readonly hash: string;
|
|
979
|
+
}[] | undefined;
|
|
980
|
+
readonly context?: {
|
|
981
|
+
readonly signer?: {
|
|
982
|
+
readonly user: {
|
|
983
|
+
readonly address: string;
|
|
984
|
+
readonly networkId: string;
|
|
985
|
+
readonly chainId: number;
|
|
986
|
+
};
|
|
987
|
+
readonly app: {
|
|
988
|
+
readonly name: string;
|
|
989
|
+
readonly key: string;
|
|
990
|
+
};
|
|
991
|
+
readonly signature: string;
|
|
992
|
+
} | undefined;
|
|
993
|
+
} | undefined;
|
|
994
|
+
readonly index: number;
|
|
995
|
+
readonly timestamp: string;
|
|
996
|
+
readonly hash: string;
|
|
997
|
+
readonly skip: number;
|
|
998
|
+
readonly error?: string | undefined;
|
|
999
|
+
readonly resultingState?: unknown;
|
|
1000
|
+
} | {
|
|
1001
|
+
readonly type: "PRUNE";
|
|
1002
|
+
readonly input: {
|
|
1003
|
+
readonly end?: import("./types").InputMaybe<number>;
|
|
1004
|
+
readonly start?: import("./types").InputMaybe<number>;
|
|
1005
|
+
};
|
|
1006
|
+
readonly scope: OperationScope;
|
|
1007
|
+
readonly attachments?: readonly {
|
|
1008
|
+
readonly data: string;
|
|
1009
|
+
readonly mimeType: string;
|
|
1010
|
+
readonly extension?: string | null | undefined;
|
|
1011
|
+
readonly fileName?: string | null | undefined;
|
|
1012
|
+
readonly hash: string;
|
|
1013
|
+
}[] | undefined;
|
|
1014
|
+
readonly context?: {
|
|
1015
|
+
readonly signer?: {
|
|
1016
|
+
readonly user: {
|
|
1017
|
+
readonly address: string;
|
|
1018
|
+
readonly networkId: string;
|
|
1019
|
+
readonly chainId: number;
|
|
1020
|
+
};
|
|
1021
|
+
readonly app: {
|
|
1022
|
+
readonly name: string;
|
|
1023
|
+
readonly key: string;
|
|
1024
|
+
};
|
|
1025
|
+
readonly signature: string;
|
|
1026
|
+
} | undefined;
|
|
1027
|
+
} | undefined;
|
|
1028
|
+
readonly index: number;
|
|
1029
|
+
readonly timestamp: string;
|
|
1030
|
+
readonly hash: string;
|
|
1031
|
+
readonly skip: number;
|
|
1032
|
+
readonly error?: string | undefined;
|
|
1033
|
+
readonly resultingState?: unknown;
|
|
1034
|
+
} | {
|
|
1035
|
+
readonly type: "REDO";
|
|
1036
|
+
readonly input: number;
|
|
1037
|
+
readonly scope: OperationScope;
|
|
1038
|
+
readonly attachments?: readonly {
|
|
1039
|
+
readonly data: string;
|
|
1040
|
+
readonly mimeType: string;
|
|
1041
|
+
readonly extension?: string | null | undefined;
|
|
1042
|
+
readonly fileName?: string | null | undefined;
|
|
1043
|
+
readonly hash: string;
|
|
1044
|
+
}[] | undefined;
|
|
1045
|
+
readonly context?: {
|
|
1046
|
+
readonly signer?: {
|
|
1047
|
+
readonly user: {
|
|
1048
|
+
readonly address: string;
|
|
1049
|
+
readonly networkId: string;
|
|
1050
|
+
readonly chainId: number;
|
|
1051
|
+
};
|
|
1052
|
+
readonly app: {
|
|
1053
|
+
readonly name: string;
|
|
1054
|
+
readonly key: string;
|
|
1055
|
+
};
|
|
1056
|
+
readonly signature: string;
|
|
1057
|
+
} | undefined;
|
|
1058
|
+
} | undefined;
|
|
1059
|
+
readonly index: number;
|
|
1060
|
+
readonly timestamp: string;
|
|
1061
|
+
readonly hash: string;
|
|
1062
|
+
readonly skip: number;
|
|
1063
|
+
readonly error?: string | undefined;
|
|
1064
|
+
readonly resultingState?: unknown;
|
|
1065
|
+
} | {
|
|
1066
|
+
readonly type: "SET_NAME";
|
|
1067
|
+
readonly input: string;
|
|
1068
|
+
readonly scope: OperationScope;
|
|
1069
|
+
readonly attachments?: readonly {
|
|
1070
|
+
readonly data: string;
|
|
1071
|
+
readonly mimeType: string;
|
|
1072
|
+
readonly extension?: string | null | undefined;
|
|
1073
|
+
readonly fileName?: string | null | undefined;
|
|
1074
|
+
readonly hash: string;
|
|
1075
|
+
}[] | undefined;
|
|
1076
|
+
readonly context?: {
|
|
1077
|
+
readonly signer?: {
|
|
1078
|
+
readonly user: {
|
|
1079
|
+
readonly address: string;
|
|
1080
|
+
readonly networkId: string;
|
|
1081
|
+
readonly chainId: number;
|
|
1082
|
+
};
|
|
1083
|
+
readonly app: {
|
|
1084
|
+
readonly name: string;
|
|
1085
|
+
readonly key: string;
|
|
1086
|
+
};
|
|
1087
|
+
readonly signature: string;
|
|
1088
|
+
} | undefined;
|
|
1089
|
+
} | undefined;
|
|
1090
|
+
readonly index: number;
|
|
1091
|
+
readonly timestamp: string;
|
|
1092
|
+
readonly hash: string;
|
|
1093
|
+
readonly skip: number;
|
|
1094
|
+
readonly error?: string | undefined;
|
|
1095
|
+
readonly resultingState?: unknown;
|
|
1096
|
+
} | {
|
|
1097
|
+
readonly type: "UNDO";
|
|
1098
|
+
readonly input: number;
|
|
1099
|
+
readonly scope: OperationScope;
|
|
1100
|
+
readonly attachments?: readonly {
|
|
1101
|
+
readonly data: string;
|
|
1102
|
+
readonly mimeType: string;
|
|
1103
|
+
readonly extension?: string | null | undefined;
|
|
1104
|
+
readonly fileName?: string | null | undefined;
|
|
1105
|
+
readonly hash: string;
|
|
1106
|
+
}[] | undefined;
|
|
1107
|
+
readonly context?: {
|
|
1108
|
+
readonly signer?: {
|
|
1109
|
+
readonly user: {
|
|
1110
|
+
readonly address: string;
|
|
1111
|
+
readonly networkId: string;
|
|
1112
|
+
readonly chainId: number;
|
|
1113
|
+
};
|
|
1114
|
+
readonly app: {
|
|
1115
|
+
readonly name: string;
|
|
1116
|
+
readonly key: string;
|
|
1117
|
+
};
|
|
1118
|
+
readonly signature: string;
|
|
1119
|
+
} | undefined;
|
|
1120
|
+
} | undefined;
|
|
1121
|
+
readonly index: number;
|
|
1122
|
+
readonly timestamp: string;
|
|
1123
|
+
readonly hash: string;
|
|
1124
|
+
readonly skip: number;
|
|
1125
|
+
readonly error?: string | undefined;
|
|
1126
|
+
readonly resultingState?: unknown;
|
|
1127
|
+
} | {
|
|
1128
|
+
readonly type: "NOOP";
|
|
1129
|
+
readonly input: unknown;
|
|
1130
|
+
readonly scope: OperationScope;
|
|
1131
|
+
readonly attachments?: readonly {
|
|
1132
|
+
readonly data: string;
|
|
1133
|
+
readonly mimeType: string;
|
|
1134
|
+
readonly extension?: string | null | undefined;
|
|
1135
|
+
readonly fileName?: string | null | undefined;
|
|
1136
|
+
readonly hash: string;
|
|
1137
|
+
}[] | undefined;
|
|
1138
|
+
readonly context?: {
|
|
1139
|
+
readonly signer?: {
|
|
1140
|
+
readonly user: {
|
|
1141
|
+
readonly address: string;
|
|
1142
|
+
readonly networkId: string;
|
|
1143
|
+
readonly chainId: number;
|
|
1144
|
+
};
|
|
1145
|
+
readonly app: {
|
|
1146
|
+
readonly name: string;
|
|
1147
|
+
readonly key: string;
|
|
1148
|
+
};
|
|
1149
|
+
readonly signature: string;
|
|
1150
|
+
} | undefined;
|
|
1151
|
+
} | undefined;
|
|
1152
|
+
readonly index: number;
|
|
1153
|
+
readonly timestamp: string;
|
|
1154
|
+
readonly hash: string;
|
|
1155
|
+
readonly skip: number;
|
|
1156
|
+
readonly error?: string | undefined;
|
|
1157
|
+
readonly resultingState?: unknown;
|
|
1158
|
+
} | import("immer").Immutable<A & {
|
|
1159
|
+
index: number;
|
|
1160
|
+
timestamp: string;
|
|
1161
|
+
hash: string;
|
|
1162
|
+
skip: number;
|
|
1163
|
+
error?: string | undefined;
|
|
1164
|
+
resultingState?: unknown;
|
|
1165
|
+
}>)[];
|
|
1166
|
+
};
|
|
1167
|
+
/**
|
|
1168
|
+
* Gets the attachment associated with the given key.
|
|
1169
|
+
* @param attachment - The key of the attachment to retrieve.
|
|
1170
|
+
*/
|
|
1171
|
+
getAttachment(attachment: AttachmentRef): import("./types").Attachment;
|
|
1172
|
+
/**
|
|
1173
|
+
* Sets the name of the document.
|
|
1174
|
+
* @param name - The new name of the document.
|
|
1175
|
+
*/
|
|
1176
|
+
setName(name: string): this;
|
|
1177
|
+
/**
|
|
1178
|
+
* Reverts a number of actions from the document.
|
|
1179
|
+
* @param count - The number of actions to revert.
|
|
1180
|
+
*/
|
|
1181
|
+
undo(count: number): this;
|
|
1182
|
+
/**
|
|
1183
|
+
* Reapplies a number of actions to the document.
|
|
1184
|
+
* @param count - The number of actions to reapply.
|
|
1185
|
+
*/
|
|
1186
|
+
redo(count: number): this;
|
|
1187
|
+
/**
|
|
1188
|
+
* Removes a range of operations from the document.
|
|
1189
|
+
* @param start - The starting index of the range to remove.
|
|
1190
|
+
* @param end - The ending index of the range to remove.
|
|
1191
|
+
*/
|
|
1192
|
+
prune(start?: number | undefined, end?: number | undefined): this;
|
|
1193
|
+
/**
|
|
1194
|
+
* Loads a document state and a set of operations.
|
|
1195
|
+
* @param state - The state to load.
|
|
1196
|
+
* @param operations - The operations to apply to the document.
|
|
1197
|
+
*/
|
|
1198
|
+
loadState(state: Pick<ExtendedState<T, L>, 'state' | 'name'>, operations: number): this;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Applies multiple mixins to a base class.
|
|
1202
|
+
* Used to have separate mixins to group methods by actions.
|
|
1203
|
+
*
|
|
1204
|
+
* @remarks
|
|
1205
|
+
* {@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}
|
|
1206
|
+
*
|
|
1207
|
+
* @param derivedCtor - The class to apply the mixins to.
|
|
1208
|
+
* @param constructors - The constructors of the mixins.
|
|
1209
|
+
*/
|
|
1210
|
+
export declare function applyMixins(derivedCtor: any, constructors: any[]): void;
|