document-model 1.0.36 → 1.0.37
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.
|
@@ -9,6 +9,20 @@ export { z } from './schema';
|
|
|
9
9
|
export type * from './schema/types';
|
|
10
10
|
export type { FileInput } from './utils';
|
|
11
11
|
export type { Immutable } from 'immer';
|
|
12
|
+
export type ActionSigner = {
|
|
13
|
+
user: {
|
|
14
|
+
address: string;
|
|
15
|
+
chainId: string;
|
|
16
|
+
};
|
|
17
|
+
app: {
|
|
18
|
+
name: string;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
signature: string;
|
|
22
|
+
};
|
|
23
|
+
export type ActionContext = {
|
|
24
|
+
signer?: ActionSigner;
|
|
25
|
+
};
|
|
12
26
|
/**
|
|
13
27
|
* Defines the basic structure of an action.
|
|
14
28
|
*
|
|
@@ -23,6 +37,8 @@ export type Action<T extends string = string, I = unknown, S extends OperationSc
|
|
|
23
37
|
scope: S;
|
|
24
38
|
/** The attachments included in the action. */
|
|
25
39
|
attachments?: AttachmentInput[] | undefined;
|
|
40
|
+
/** The context of the action. */
|
|
41
|
+
context?: ActionContext;
|
|
26
42
|
};
|
|
27
43
|
export type ActionWithAttachment<T extends string = string, I = unknown, S extends OperationScope = OperationScope> = Action<T, I, S> & {
|
|
28
44
|
attachments: AttachmentInput[];
|
|
@@ -186,15 +202,26 @@ export type DocumentModel<S = unknown, A extends Action = Action, L = unknown, C
|
|
|
186
202
|
utils: DocumentModelUtils<S, A, L>;
|
|
187
203
|
documentModel: DocumentModelState;
|
|
188
204
|
};
|
|
205
|
+
export type ENSInfo = {
|
|
206
|
+
name?: string;
|
|
207
|
+
avatarUrl?: string;
|
|
208
|
+
};
|
|
209
|
+
export type User = {
|
|
210
|
+
address: `0x${string}`;
|
|
211
|
+
networkId: string;
|
|
212
|
+
chainId: number;
|
|
213
|
+
ens?: ENSInfo;
|
|
214
|
+
};
|
|
189
215
|
export type EditorContext = {
|
|
190
216
|
theme: 'light' | 'dark';
|
|
191
217
|
debug?: boolean;
|
|
218
|
+
user?: User;
|
|
192
219
|
};
|
|
193
220
|
export type ActionErrorCallback = (error: unknown) => void;
|
|
194
221
|
export type EditorProps<S, A extends Action, L> = {
|
|
195
222
|
document: Document<S, A, L>;
|
|
196
223
|
dispatch: (action: A | BaseAction, onErrorCallback?: ActionErrorCallback) => void;
|
|
197
|
-
|
|
224
|
+
context: EditorContext;
|
|
198
225
|
error?: unknown;
|
|
199
226
|
};
|
|
200
227
|
export type Editor<S = unknown, A extends Action = Action, L = unknown> = {
|
|
@@ -9,6 +9,20 @@ export { z } from './schema';
|
|
|
9
9
|
export type * from './schema/types';
|
|
10
10
|
export type { FileInput } from './utils';
|
|
11
11
|
export type { Immutable } from 'immer';
|
|
12
|
+
export type ActionSigner = {
|
|
13
|
+
user: {
|
|
14
|
+
address: string;
|
|
15
|
+
chainId: string;
|
|
16
|
+
};
|
|
17
|
+
app: {
|
|
18
|
+
name: string;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
signature: string;
|
|
22
|
+
};
|
|
23
|
+
export type ActionContext = {
|
|
24
|
+
signer?: ActionSigner;
|
|
25
|
+
};
|
|
12
26
|
/**
|
|
13
27
|
* Defines the basic structure of an action.
|
|
14
28
|
*
|
|
@@ -23,6 +37,8 @@ export type Action<T extends string = string, I = unknown, S extends OperationSc
|
|
|
23
37
|
scope: S;
|
|
24
38
|
/** The attachments included in the action. */
|
|
25
39
|
attachments?: AttachmentInput[] | undefined;
|
|
40
|
+
/** The context of the action. */
|
|
41
|
+
context?: ActionContext;
|
|
26
42
|
};
|
|
27
43
|
export type ActionWithAttachment<T extends string = string, I = unknown, S extends OperationScope = OperationScope> = Action<T, I, S> & {
|
|
28
44
|
attachments: AttachmentInput[];
|
|
@@ -186,15 +202,26 @@ export type DocumentModel<S = unknown, A extends Action = Action, L = unknown, C
|
|
|
186
202
|
utils: DocumentModelUtils<S, A, L>;
|
|
187
203
|
documentModel: DocumentModelState;
|
|
188
204
|
};
|
|
205
|
+
export type ENSInfo = {
|
|
206
|
+
name?: string;
|
|
207
|
+
avatarUrl?: string;
|
|
208
|
+
};
|
|
209
|
+
export type User = {
|
|
210
|
+
address: `0x${string}`;
|
|
211
|
+
networkId: string;
|
|
212
|
+
chainId: number;
|
|
213
|
+
ens?: ENSInfo;
|
|
214
|
+
};
|
|
189
215
|
export type EditorContext = {
|
|
190
216
|
theme: 'light' | 'dark';
|
|
191
217
|
debug?: boolean;
|
|
218
|
+
user?: User;
|
|
192
219
|
};
|
|
193
220
|
export type ActionErrorCallback = (error: unknown) => void;
|
|
194
221
|
export type EditorProps<S, A extends Action, L> = {
|
|
195
222
|
document: Document<S, A, L>;
|
|
196
223
|
dispatch: (action: A | BaseAction, onErrorCallback?: ActionErrorCallback) => void;
|
|
197
|
-
|
|
224
|
+
context: EditorContext;
|
|
198
225
|
error?: unknown;
|
|
199
226
|
};
|
|
200
227
|
export type Editor<S = unknown, A extends Action = Action, L = unknown> = {
|