pixiboardjs 0.1.0-alpha.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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/VERSIONING.md +24 -0
- package/dist/browser.d.ts +657 -0
- package/dist/browser.js +5513 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +3812 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +2 -0
- package/dist/node.js +3812 -0
- package/dist/node.js.map +1 -0
- package/dist/types-DnR8yhxj.d.ts +702 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/etc/pixiboardjs-browser.api.md +1435 -0
- package/etc/pixiboardjs-node.api.md +761 -0
- package/etc/pixiboardjs-types.api.md +669 -0
- package/etc/pixiboardjs.api.md +761 -0
- package/package.json +82 -0
|
@@ -0,0 +1,761 @@
|
|
|
1
|
+
## API Report File for "pixiboardjs"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @public (undocumented)
|
|
8
|
+
export class AssetUnavailableError extends CapabilityError {
|
|
9
|
+
constructor(assetId: string, variant?: string);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// @public (undocumented)
|
|
13
|
+
export type BoardCapabilities = {
|
|
14
|
+
availability: {
|
|
15
|
+
preview: boolean;
|
|
16
|
+
capture: boolean;
|
|
17
|
+
};
|
|
18
|
+
document: {
|
|
19
|
+
snapshot(options?: RequestOptions): Promise<Readonly<BoardDocument>>;
|
|
20
|
+
load(input: unknown, options?: DocumentLoadOptions_2 & WriteOptions): Promise<{
|
|
21
|
+
changed: boolean;
|
|
22
|
+
revision: number;
|
|
23
|
+
changeSet: BoardChangeSet;
|
|
24
|
+
requestId?: string;
|
|
25
|
+
}>;
|
|
26
|
+
validate(input: unknown, options?: RequestOptions): Promise<BoardDocument>;
|
|
27
|
+
};
|
|
28
|
+
nodes: {
|
|
29
|
+
read(input?: ReadNodesInput, options?: RequestOptions): Promise<ReadNodesResult>;
|
|
30
|
+
create(input: {
|
|
31
|
+
nodes: readonly CreateNodeInput[];
|
|
32
|
+
}, options?: WriteOptions): Promise<WriteResult>;
|
|
33
|
+
update(input: {
|
|
34
|
+
nodes: readonly UpdateNodeInput[];
|
|
35
|
+
}, options?: WriteOptions): Promise<WriteResult>;
|
|
36
|
+
delete(input: {
|
|
37
|
+
nodeIds: readonly string[];
|
|
38
|
+
}, options?: WriteOptions): Promise<WriteResult>;
|
|
39
|
+
};
|
|
40
|
+
assets: {
|
|
41
|
+
read(input?: {
|
|
42
|
+
ids?: readonly string[];
|
|
43
|
+
kinds?: readonly string[];
|
|
44
|
+
limit?: number;
|
|
45
|
+
cursor?: string;
|
|
46
|
+
}, options?: RequestOptions): Promise<ReadAssetsResult>;
|
|
47
|
+
upsert(input: {
|
|
48
|
+
assets: readonly AssetRecord[];
|
|
49
|
+
}, options?: WriteOptions): Promise<WriteResult>;
|
|
50
|
+
remove(input: {
|
|
51
|
+
assetIds: readonly string[];
|
|
52
|
+
}, options?: WriteOptions): Promise<WriteResult>;
|
|
53
|
+
};
|
|
54
|
+
selection: {
|
|
55
|
+
get(options?: RequestOptions): Promise<readonly string[]>;
|
|
56
|
+
set(nodeIds: readonly string[], options?: WriteOptions): Promise<{
|
|
57
|
+
nodeIds: readonly string[];
|
|
58
|
+
requestId?: string;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
viewport: {
|
|
62
|
+
get(options?: RequestOptions): Promise<ViewportSnapshot>;
|
|
63
|
+
set(viewport: ViewportSnapshot, options?: WriteOptions): Promise<{
|
|
64
|
+
viewport: ViewportSnapshot;
|
|
65
|
+
requestId?: string;
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
history: {
|
|
69
|
+
canUndo(): boolean;
|
|
70
|
+
canRedo(): boolean;
|
|
71
|
+
clear(): void;
|
|
72
|
+
undo(options?: WriteOptions): BoardChangeSet | undefined;
|
|
73
|
+
redo(options?: WriteOptions): BoardChangeSet | undefined;
|
|
74
|
+
};
|
|
75
|
+
preview: {
|
|
76
|
+
get(input: {
|
|
77
|
+
nodeId: string;
|
|
78
|
+
maxWidth?: number;
|
|
79
|
+
maxHeight?: number;
|
|
80
|
+
frameNumber?: number;
|
|
81
|
+
fps?: number;
|
|
82
|
+
}, options?: RequestOptions): Promise<PreviewResult>;
|
|
83
|
+
};
|
|
84
|
+
capture: {
|
|
85
|
+
available: boolean;
|
|
86
|
+
capture(input: JsonValue, options?: RequestOptions): Promise<CaptureResult>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// @public (undocumented)
|
|
91
|
+
export type BoardChangeEvent = {
|
|
92
|
+
revision: number;
|
|
93
|
+
changeSet: BoardChangeSet;
|
|
94
|
+
documentUpdate: BoardDocumentUpdate;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// @public (undocumented)
|
|
98
|
+
export class BoardDestroyedError extends CapabilityError {
|
|
99
|
+
constructor(message?: string);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// @public (undocumented)
|
|
103
|
+
export type BoardDocument = {
|
|
104
|
+
schemaVersion: number;
|
|
105
|
+
revision: number;
|
|
106
|
+
nodes: BoardNode[];
|
|
107
|
+
assets: AssetRecord[];
|
|
108
|
+
viewport?: ViewportSnapshot;
|
|
109
|
+
metadata?: Record<string, JsonValue>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// @public (undocumented)
|
|
113
|
+
export type BoardDocumentUpdate = {
|
|
114
|
+
revision: number;
|
|
115
|
+
changedNodes: ReadonlyArray<Readonly<BoardNode>>;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// @public (undocumented)
|
|
119
|
+
export type BoardLifecycleState = "created" | "mounting" | "ready" | "destroying" | "destroyed";
|
|
120
|
+
|
|
121
|
+
// @public (undocumented)
|
|
122
|
+
export type BoardNode<Props extends JsonValue = JsonValue> = {
|
|
123
|
+
id: string;
|
|
124
|
+
type: string;
|
|
125
|
+
typeVersion: number;
|
|
126
|
+
name?: string;
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
width: number;
|
|
130
|
+
height: number;
|
|
131
|
+
rotation: number;
|
|
132
|
+
zIndex: number;
|
|
133
|
+
locked?: boolean;
|
|
134
|
+
visible?: boolean;
|
|
135
|
+
assetRefs?: Record<string, AssetRef>;
|
|
136
|
+
props: Props;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// @public (undocumented)
|
|
140
|
+
export type BoardNodeCreateInput<Props extends JsonValue = JsonValue> = Omit<BoardNode<Props>, "id" | "typeVersion" | "rotation" | "zIndex" | "props"> & {
|
|
141
|
+
id?: string;
|
|
142
|
+
typeVersion?: number;
|
|
143
|
+
rotation?: number;
|
|
144
|
+
zIndex?: number;
|
|
145
|
+
props?: Props;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// @public (undocumented)
|
|
149
|
+
export type BoardNodePatch<Props extends JsonValue = JsonValue> = Partial<Pick<BoardNode<Props>, "name" | "x" | "y" | "width" | "height" | "rotation" | "zIndex" | "locked" | "visible" | "assetRefs" | "props">>;
|
|
150
|
+
|
|
151
|
+
// @public (undocumented)
|
|
152
|
+
export type BoardRuntimePorts = {
|
|
153
|
+
events?: BrowserEventPort;
|
|
154
|
+
createResizeObserver?: (callback: ResizeObserverCallback) => ResizeObserverPort;
|
|
155
|
+
ticker?: TickerPort;
|
|
156
|
+
onKeyboardEvent?: (event: Event) => void;
|
|
157
|
+
onClipboardEvent?: (event: Event) => void;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// @public (undocumented)
|
|
161
|
+
export type BrowserEventPort = {
|
|
162
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
|
|
163
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// @public (undocumented)
|
|
167
|
+
export class CapabilityError extends Error {
|
|
168
|
+
constructor(code: CapabilityErrorCode, message: string, details?: Readonly<Record<string, unknown>>);
|
|
169
|
+
// (undocumented)
|
|
170
|
+
readonly brand = "@pixi-board/capabilities:CapabilityError";
|
|
171
|
+
// Warning: (ae-forgotten-export) The symbol "CapabilityErrorCode" needs to be exported by the entry point node.d.ts
|
|
172
|
+
//
|
|
173
|
+
// (undocumented)
|
|
174
|
+
readonly code: CapabilityErrorCode;
|
|
175
|
+
// (undocumented)
|
|
176
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
177
|
+
// (undocumented)
|
|
178
|
+
readonly name = "CapabilityError";
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// @public (undocumented)
|
|
182
|
+
export class CapabilityUnavailableError extends CapabilityError {
|
|
183
|
+
constructor(capability: string);
|
|
184
|
+
// (undocumented)
|
|
185
|
+
readonly capability: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// @public (undocumented)
|
|
189
|
+
export type CaptureInput = {
|
|
190
|
+
target: "viewport";
|
|
191
|
+
format?: "png" | "jpeg";
|
|
192
|
+
scale?: number;
|
|
193
|
+
} | {
|
|
194
|
+
target: "node";
|
|
195
|
+
nodeId: string;
|
|
196
|
+
format?: "png" | "jpeg";
|
|
197
|
+
scale?: number;
|
|
198
|
+
} | {
|
|
199
|
+
target: "bounds";
|
|
200
|
+
bounds: WorldBounds;
|
|
201
|
+
format?: "png" | "jpeg";
|
|
202
|
+
scale?: number;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// @public (undocumented)
|
|
206
|
+
export type CaptureResult = {
|
|
207
|
+
dataUrl: string;
|
|
208
|
+
mimeType: string;
|
|
209
|
+
width?: number;
|
|
210
|
+
height?: number;
|
|
211
|
+
revision: number;
|
|
212
|
+
requestId?: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// @public (undocumented)
|
|
216
|
+
export type ChangeOrigin = "api" | "ui" | "plugin" | "agent" | "history" | "load" | (string & {});
|
|
217
|
+
|
|
218
|
+
// @public (undocumented)
|
|
219
|
+
export function createPixiBoard(options?: PixiBoardOptions): Promise<PixiBoard>;
|
|
220
|
+
|
|
221
|
+
// @public (undocumented)
|
|
222
|
+
export type CustomDisplayFactory = {
|
|
223
|
+
createContainer(): CustomDisplayObject;
|
|
224
|
+
createRect?(width: number, height: number, fill: number | string): CustomDisplayObject;
|
|
225
|
+
createText?(text: string, style?: Record<string, unknown>): CustomDisplayObject;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// @public (undocumented)
|
|
229
|
+
export type CustomDisplayObject = {
|
|
230
|
+
visible?: boolean;
|
|
231
|
+
x?: number;
|
|
232
|
+
y?: number;
|
|
233
|
+
rotation?: number;
|
|
234
|
+
zIndex?: number;
|
|
235
|
+
addChild?(child: CustomDisplayObject): void;
|
|
236
|
+
removeChild?(child: CustomDisplayObject): void;
|
|
237
|
+
destroy?(options?: unknown): void;
|
|
238
|
+
[key: string]: unknown;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// @public (undocumented)
|
|
242
|
+
export type CustomNodeDataDefinition<Props extends JsonValue = JsonValue> = Omit<CustomNodeDefinition<Props>, "renderer">;
|
|
243
|
+
|
|
244
|
+
// @public (undocumented)
|
|
245
|
+
export type CustomNodeDefinition<Props extends JsonValue = JsonValue, State = unknown> = {
|
|
246
|
+
type: string;
|
|
247
|
+
version: number;
|
|
248
|
+
defaults?: Partial<Props>;
|
|
249
|
+
validate(value: unknown): Props;
|
|
250
|
+
getBounds(node: BoardNode<Props>): WorldBounds;
|
|
251
|
+
resize?: CustomResizePolicy<Props>;
|
|
252
|
+
renderer?: CustomNodeRenderer<Props, State>;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// @public (undocumented)
|
|
256
|
+
export type CustomNodeRenderer<Props extends JsonValue = JsonValue, State = unknown> = {
|
|
257
|
+
create(node: Readonly<BoardNode<Props>>, context: CustomNodeRendererContext): CustomNodeView<State> | Promise<CustomNodeView<State>>;
|
|
258
|
+
update(view: CustomNodeView<State>, node: Readonly<BoardNode<Props>>, context: CustomNodeRendererContext): void | Promise<void>;
|
|
259
|
+
destroy(view: CustomNodeView<State>, context: CustomNodeRendererContext): void;
|
|
260
|
+
hitTest?(node: Readonly<BoardNode<Props>>, worldPoint: Point): boolean;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// @public (undocumented)
|
|
264
|
+
export type CustomNodeRendererContext = {
|
|
265
|
+
assets: {
|
|
266
|
+
acquireTexture(ref: {
|
|
267
|
+
assetId: string;
|
|
268
|
+
variant?: "original" | "preview" | "waveform";
|
|
269
|
+
}, options?: Record<string, unknown>): Promise<CustomTextureLease>;
|
|
270
|
+
};
|
|
271
|
+
invalidate(): void;
|
|
272
|
+
signal: AbortSignal;
|
|
273
|
+
lod: {
|
|
274
|
+
level?: number;
|
|
275
|
+
scale?: number;
|
|
276
|
+
};
|
|
277
|
+
diagnostics: {
|
|
278
|
+
creates: number;
|
|
279
|
+
updates: number;
|
|
280
|
+
destroys: number;
|
|
281
|
+
lateUpdates: number;
|
|
282
|
+
};
|
|
283
|
+
display: CustomDisplayFactory;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// @public (undocumented)
|
|
287
|
+
export type CustomNodeRendererRegistry = {
|
|
288
|
+
register(type: string, renderer: CustomNodeRenderer, options?: NodeTypeRegistrationOptions): () => void;
|
|
289
|
+
get(type: string): CustomNodeRenderer | undefined;
|
|
290
|
+
has(type: string): boolean;
|
|
291
|
+
list(): string[];
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// @public (undocumented)
|
|
295
|
+
export type CustomNodeView<State = unknown> = {
|
|
296
|
+
displayObject: CustomDisplayObject;
|
|
297
|
+
state: State;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
// @public (undocumented)
|
|
301
|
+
export type CustomResizePolicy<Props extends JsonValue> = {
|
|
302
|
+
mode: "free";
|
|
303
|
+
} | {
|
|
304
|
+
mode: "aspect-ratio";
|
|
305
|
+
ratio?: number;
|
|
306
|
+
} | {
|
|
307
|
+
mode: "fixed";
|
|
308
|
+
} | {
|
|
309
|
+
mode: "custom";
|
|
310
|
+
resize(input: {
|
|
311
|
+
node: Readonly<BoardNode<Props>>;
|
|
312
|
+
width: number;
|
|
313
|
+
height: number;
|
|
314
|
+
}): BoardNodePatch<Props>;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// @public (undocumented)
|
|
318
|
+
export type CustomTextureLease = {
|
|
319
|
+
texture?: unknown;
|
|
320
|
+
release?: () => void;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
// @public (undocumented)
|
|
324
|
+
export type DocumentLoadOptions = {
|
|
325
|
+
replaceHistory?: boolean;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// @public (undocumented)
|
|
329
|
+
export type DocumentPersistence = {
|
|
330
|
+
load?(options?: {
|
|
331
|
+
signal?: AbortSignal;
|
|
332
|
+
}): Promise<BoardDocument | null>;
|
|
333
|
+
save?(document: BoardDocument, options?: {
|
|
334
|
+
signal?: AbortSignal;
|
|
335
|
+
}): Promise<void>;
|
|
336
|
+
destroy?(): void | Promise<void>;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
// Warning: (ae-forgotten-export) The symbol "PixiBoardCoreError" needs to be exported by the entry point node.d.ts
|
|
340
|
+
//
|
|
341
|
+
// @public (undocumented)
|
|
342
|
+
export class DocumentValidationError extends PixiBoardCoreError {
|
|
343
|
+
constructor(message: string, options?: {
|
|
344
|
+
cause?: unknown;
|
|
345
|
+
});
|
|
346
|
+
// (undocumented)
|
|
347
|
+
readonly cause?: unknown;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// @public (undocumented)
|
|
351
|
+
export type HistoryChangeEvent = {
|
|
352
|
+
canUndo: boolean;
|
|
353
|
+
canRedo: boolean;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// Warning: (ae-forgotten-export) The symbol "JsonPrimitive" needs to be exported by the entry point node.d.ts
|
|
357
|
+
//
|
|
358
|
+
// @public (undocumented)
|
|
359
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
360
|
+
[key: string]: JsonValue;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// @public
|
|
364
|
+
export type NodeGeometry = {
|
|
365
|
+
x: number;
|
|
366
|
+
y: number;
|
|
367
|
+
width: number;
|
|
368
|
+
height: number;
|
|
369
|
+
rotation: number;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
// @public (undocumented)
|
|
373
|
+
export interface NodeHandle<Props extends JsonValue = JsonValue> {
|
|
374
|
+
// (undocumented)
|
|
375
|
+
getAttrs(): Readonly<BoardNode<Props>>;
|
|
376
|
+
// (undocumented)
|
|
377
|
+
height(): number;
|
|
378
|
+
// (undocumented)
|
|
379
|
+
height(value: number): this;
|
|
380
|
+
// (undocumented)
|
|
381
|
+
readonly id: string;
|
|
382
|
+
// (undocumented)
|
|
383
|
+
on<EventName extends keyof NodeHandleEventMap>(eventName: EventName, listener: (event: NodeHandleEventMap[EventName]) => void): () => void;
|
|
384
|
+
// (undocumented)
|
|
385
|
+
remove(): void;
|
|
386
|
+
// (undocumented)
|
|
387
|
+
rotation(): number;
|
|
388
|
+
// (undocumented)
|
|
389
|
+
rotation(value: number): this;
|
|
390
|
+
// (undocumented)
|
|
391
|
+
setAttrs(patch: BoardNodePatch<Props>): this;
|
|
392
|
+
// (undocumented)
|
|
393
|
+
visible(): boolean;
|
|
394
|
+
// (undocumented)
|
|
395
|
+
visible(value: boolean): this;
|
|
396
|
+
// (undocumented)
|
|
397
|
+
width(): number;
|
|
398
|
+
// (undocumented)
|
|
399
|
+
width(value: number): this;
|
|
400
|
+
// (undocumented)
|
|
401
|
+
x(): number;
|
|
402
|
+
// (undocumented)
|
|
403
|
+
x(value: number): this;
|
|
404
|
+
// (undocumented)
|
|
405
|
+
y(): number;
|
|
406
|
+
// (undocumented)
|
|
407
|
+
y(value: number): this;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// @public (undocumented)
|
|
411
|
+
export type NodeHandleEventMap = {
|
|
412
|
+
change: BoardChangeEvent;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
// @public (undocumented)
|
|
416
|
+
export type NodeInput<Props extends JsonValue = JsonValue> = BoardNodeCreateInput<Props>;
|
|
417
|
+
|
|
418
|
+
// @public (undocumented)
|
|
419
|
+
export type NodeListFilter = {
|
|
420
|
+
ids?: string[];
|
|
421
|
+
types?: string[];
|
|
422
|
+
type?: string;
|
|
423
|
+
bounds?: WorldBounds;
|
|
424
|
+
visible?: boolean;
|
|
425
|
+
selected?: boolean;
|
|
426
|
+
limit?: number;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// @public (undocumented)
|
|
430
|
+
export class NodeNotFoundError extends PixiBoardCoreError {
|
|
431
|
+
constructor(nodeId: string);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// @public (undocumented)
|
|
435
|
+
export type NodePatch<Props extends JsonValue = JsonValue> = BoardNodePatch<Props>;
|
|
436
|
+
|
|
437
|
+
// @public (undocumented)
|
|
438
|
+
export type NodeQuery = NodeListFilter;
|
|
439
|
+
|
|
440
|
+
// @public (undocumented)
|
|
441
|
+
export type NodeResizeRequest = {
|
|
442
|
+
handle: ResizeHandle;
|
|
443
|
+
deltaWorld: Point;
|
|
444
|
+
origin?: NodeGeometry;
|
|
445
|
+
minWidth?: number;
|
|
446
|
+
minHeight?: number;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// @public (undocumented)
|
|
450
|
+
export type NodeTypeDefinition<Props extends JsonValue = JsonValue> = CustomNodeDataDefinition<Props>;
|
|
451
|
+
|
|
452
|
+
// @public (undocumented)
|
|
453
|
+
export class NodeTypeNotRegisteredError extends PixiBoardCoreError {
|
|
454
|
+
constructor(type: string);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// @public (undocumented)
|
|
458
|
+
export type NodeTypeRegistrationDisposer = () => Promise<void>;
|
|
459
|
+
|
|
460
|
+
// @public (undocumented)
|
|
461
|
+
export type NodeTypeRegistrationOptions = {
|
|
462
|
+
replace?: boolean;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
// @public (undocumented)
|
|
466
|
+
export class NodeValidationError extends PixiBoardCoreError {
|
|
467
|
+
constructor(message: string, options?: {
|
|
468
|
+
nodeId?: string;
|
|
469
|
+
nodeType?: string;
|
|
470
|
+
cause?: unknown;
|
|
471
|
+
});
|
|
472
|
+
// (undocumented)
|
|
473
|
+
readonly cause?: unknown;
|
|
474
|
+
// (undocumented)
|
|
475
|
+
readonly nodeId?: string;
|
|
476
|
+
// (undocumented)
|
|
477
|
+
readonly nodeType?: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// @public (undocumented)
|
|
481
|
+
export class PermissionDeniedError extends CapabilityError {
|
|
482
|
+
constructor(message?: string, details?: Readonly<Record<string, unknown>>);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// @public (undocumented)
|
|
486
|
+
export interface PixiBoard {
|
|
487
|
+
// (undocumented)
|
|
488
|
+
readonly capabilities: BoardCapabilities;
|
|
489
|
+
// (undocumented)
|
|
490
|
+
capture(input: CaptureInput, options?: RequestOptions): Promise<CaptureResult>;
|
|
491
|
+
// (undocumented)
|
|
492
|
+
destroy(): Promise<void>;
|
|
493
|
+
// (undocumented)
|
|
494
|
+
readonly document: {
|
|
495
|
+
snapshot(): Readonly<BoardDocument>;
|
|
496
|
+
toJSON(): BoardDocument;
|
|
497
|
+
load(input: unknown, options?: DocumentLoadOptions): Promise<void>;
|
|
498
|
+
validate(input: unknown): BoardDocument;
|
|
499
|
+
};
|
|
500
|
+
// (undocumented)
|
|
501
|
+
find(filter?: NodeQuery): ReadonlyArray<Readonly<BoardNode>>;
|
|
502
|
+
// (undocumented)
|
|
503
|
+
findOne(selector: string): Readonly<BoardNode> | undefined;
|
|
504
|
+
// (undocumented)
|
|
505
|
+
focus(): void;
|
|
506
|
+
// (undocumented)
|
|
507
|
+
readonly history: {
|
|
508
|
+
canUndo(): boolean;
|
|
509
|
+
canRedo(): boolean;
|
|
510
|
+
undo(): BoardChangeEvent["changeSet"] | undefined;
|
|
511
|
+
redo(): BoardChangeEvent["changeSet"] | undefined;
|
|
512
|
+
clear(): void;
|
|
513
|
+
};
|
|
514
|
+
// (undocumented)
|
|
515
|
+
node<Props extends JsonValue = JsonValue>(nodeId: string): NodeHandle<Props>;
|
|
516
|
+
// (undocumented)
|
|
517
|
+
readonly nodes: {
|
|
518
|
+
create<Props extends JsonValue>(input: BoardNodeCreateInput<Props>): Promise<NodeHandle<Props>>;
|
|
519
|
+
update<Props extends JsonValue>(nodeId: string, patch: BoardNodePatch<Props>): NodeHandle<Props>;
|
|
520
|
+
resize<Props extends JsonValue>(nodeId: string, request: NodeResizeRequest): NodeHandle<Props>;
|
|
521
|
+
remove(nodeId: string): void;
|
|
522
|
+
get<Props extends JsonValue = JsonValue>(nodeId: string): Readonly<BoardNode<Props>> | undefined;
|
|
523
|
+
list(filter?: NodeListFilter): ReadonlyArray<Readonly<BoardNode>>;
|
|
524
|
+
};
|
|
525
|
+
// (undocumented)
|
|
526
|
+
readonly nodeTypes: {
|
|
527
|
+
register<Props extends JsonValue, State = unknown>(definition: PublicNodeTypeDefinition<Props, State>, options?: NodeTypeRegistrationOptions): Promise<NodeTypeRegistrationDisposer>;
|
|
528
|
+
has(type: string): boolean;
|
|
529
|
+
get(type: string): CustomNodeDataDefinition | undefined;
|
|
530
|
+
list(): ReadonlyArray<CustomNodeDataDefinition>;
|
|
531
|
+
};
|
|
532
|
+
// (undocumented)
|
|
533
|
+
on<EventName extends keyof PublicBoardEventMap>(eventName: EventName, listener: (event: PublicBoardEventMap[EventName]) => void): () => void;
|
|
534
|
+
// (undocumented)
|
|
535
|
+
readonly ready: Promise<void>;
|
|
536
|
+
// (undocumented)
|
|
537
|
+
readonly selection: {
|
|
538
|
+
get(): string[];
|
|
539
|
+
set(nodeIds: Iterable<string>): void;
|
|
540
|
+
toggle(nodeId: string): void;
|
|
541
|
+
clear(): void;
|
|
542
|
+
onChange(listener: (event: SelectionChangeEvent) => void): () => void;
|
|
543
|
+
};
|
|
544
|
+
// (undocumented)
|
|
545
|
+
readonly signal: AbortSignal;
|
|
546
|
+
// (undocumented)
|
|
547
|
+
readonly state: BoardLifecycleState;
|
|
548
|
+
// (undocumented)
|
|
549
|
+
transaction<Result>(label: string, operation: () => Result, options?: TransactionOptions): Result;
|
|
550
|
+
readonly transform: {
|
|
551
|
+
handles(): ReadonlyArray<TransformHandlePlacement>;
|
|
552
|
+
bounds(): TransformBounds | undefined;
|
|
553
|
+
begin(handle: ResizeHandle): TransformSession | undefined;
|
|
554
|
+
active(): boolean;
|
|
555
|
+
};
|
|
556
|
+
// (undocumented)
|
|
557
|
+
readonly viewport: {
|
|
558
|
+
get(): ViewportSnapshot;
|
|
559
|
+
set(value: ViewportSnapshot): void;
|
|
560
|
+
panBy(deltaX: number, deltaY: number): void;
|
|
561
|
+
zoomAt(screenPoint: Point, factor: number): void;
|
|
562
|
+
fitNodes(nodeIds: string[]): void;
|
|
563
|
+
fitBounds(bounds: WorldBounds): void;
|
|
564
|
+
toWorld(point: Point): Point;
|
|
565
|
+
toScreen(point: Point): Point;
|
|
566
|
+
};
|
|
567
|
+
visibleNodeIds(): ReadonlySet<string> | undefined;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// @public (undocumented)
|
|
571
|
+
export type PixiBoardOptions = {
|
|
572
|
+
container?: Element | null;
|
|
573
|
+
document?: unknown;
|
|
574
|
+
headless?: boolean;
|
|
575
|
+
persistence?: DocumentPersistence;
|
|
576
|
+
interactions?: {
|
|
577
|
+
pointer?: boolean;
|
|
578
|
+
keyboard?: boolean;
|
|
579
|
+
clipboard?: boolean;
|
|
580
|
+
};
|
|
581
|
+
transform?: {
|
|
582
|
+
minWidth?: number;
|
|
583
|
+
minHeight?: number;
|
|
584
|
+
};
|
|
585
|
+
ports?: BoardRuntimePorts;
|
|
586
|
+
virtualization?: {
|
|
587
|
+
enabled?: boolean;
|
|
588
|
+
padding?: number;
|
|
589
|
+
};
|
|
590
|
+
core?: Omit<BoardCoreOptions, "document">;
|
|
591
|
+
renderer?: PublicRendererOptions;
|
|
592
|
+
rendererFactory?: (options: PublicRendererOptions) => RuntimeRenderer;
|
|
593
|
+
preview?: PreviewService;
|
|
594
|
+
capture?: CaptureService;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
// @public (undocumented)
|
|
598
|
+
export type PixiBoardRendererOptions = PublicRendererOptions;
|
|
599
|
+
|
|
600
|
+
// @public (undocumented)
|
|
601
|
+
export type Point = {
|
|
602
|
+
x: number;
|
|
603
|
+
y: number;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
// @public (undocumented)
|
|
607
|
+
export type PublicBoardEventMap = {
|
|
608
|
+
change: BoardChangeEvent;
|
|
609
|
+
"selection:change": SelectionChangeEvent;
|
|
610
|
+
"viewport:change": ViewportChangeEvent;
|
|
611
|
+
"history:change": HistoryChangeEvent;
|
|
612
|
+
"assets:change": BoardChangeEvent;
|
|
613
|
+
"capability:change": {
|
|
614
|
+
capability: string;
|
|
615
|
+
available: boolean;
|
|
616
|
+
};
|
|
617
|
+
"render:complete": RenderCompleteEvent;
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// @public (undocumented)
|
|
621
|
+
export type PublicNodeTypeDefinition<Props extends JsonValue = JsonValue, State = unknown> = CustomNodeDefinition<Props, State>;
|
|
622
|
+
|
|
623
|
+
// @public (undocumented)
|
|
624
|
+
export type PublicRendererOptions = {
|
|
625
|
+
registry?: CustomNodeRendererRegistry;
|
|
626
|
+
[key: string]: unknown;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
// @public (undocumented)
|
|
630
|
+
export type RenderCompleteEvent = {
|
|
631
|
+
revision: number;
|
|
632
|
+
frameId: number;
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
// @public (undocumented)
|
|
636
|
+
export type RendererApplyResult = "applied" | "rebuild-required";
|
|
637
|
+
|
|
638
|
+
// @public (undocumented)
|
|
639
|
+
export const RESIZE_HANDLES: readonly ResizeHandle[];
|
|
640
|
+
|
|
641
|
+
// @public
|
|
642
|
+
export type ResizeHandle = "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" | "w";
|
|
643
|
+
|
|
644
|
+
// @public
|
|
645
|
+
export function resizeHandleAxes(handle: ResizeHandle): {
|
|
646
|
+
horizontal: -1 | 0 | 1;
|
|
647
|
+
vertical: -1 | 0 | 1;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
// @public
|
|
651
|
+
export function resizeHandleCursor(handle: ResizeHandle, rotation?: number): string;
|
|
652
|
+
|
|
653
|
+
// @public (undocumented)
|
|
654
|
+
export type ResizeObserverPort = {
|
|
655
|
+
observe(target: Element): void;
|
|
656
|
+
disconnect(): void;
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
// @public (undocumented)
|
|
660
|
+
export type RuntimeRenderer = {
|
|
661
|
+
init(): Promise<void>;
|
|
662
|
+
rebuild(snapshot: Readonly<BoardDocument>): Promise<void>;
|
|
663
|
+
apply(update: BoardDocumentUpdate, changeSet: BoardChangeEvent["changeSet"]): Promise<RendererApplyResult>;
|
|
664
|
+
setVisibleBounds?(bounds: WorldBounds | undefined, scale?: number): Promise<void>;
|
|
665
|
+
visibleNodeIds?(): ReadonlySet<string> | undefined;
|
|
666
|
+
refreshRegisteredTypes?(): Promise<void>;
|
|
667
|
+
destroy(): Promise<void>;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
// @public (undocumented)
|
|
671
|
+
export type SelectionChangeEvent = {
|
|
672
|
+
nodeIds: string[];
|
|
673
|
+
previousNodeIds: string[];
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
// @public (undocumented)
|
|
677
|
+
export type TickerPort = {
|
|
678
|
+
add(listener: () => void): void;
|
|
679
|
+
remove(listener: () => void): void;
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
// @public (undocumented)
|
|
683
|
+
export class TransactionConflictError extends PixiBoardCoreError {
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// @public (undocumented)
|
|
687
|
+
export type TransactionOptions = {
|
|
688
|
+
origin?: ChangeOrigin;
|
|
689
|
+
coalesceKey?: string;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
// @public (undocumented)
|
|
693
|
+
export type TransactionOrigin = ChangeOrigin;
|
|
694
|
+
|
|
695
|
+
// @public
|
|
696
|
+
export type TransformBounds = {
|
|
697
|
+
x: number;
|
|
698
|
+
y: number;
|
|
699
|
+
width: number;
|
|
700
|
+
height: number;
|
|
701
|
+
rotation: number;
|
|
702
|
+
nodeIds: string[];
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
// @public
|
|
706
|
+
export type TransformHandlePlacement = {
|
|
707
|
+
handle: ResizeHandle;
|
|
708
|
+
world: Point;
|
|
709
|
+
cursor: string;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
// @public (undocumented)
|
|
713
|
+
export type TransformSession = {
|
|
714
|
+
readonly handle: ResizeHandle;
|
|
715
|
+
update(deltaWorld: Point): void;
|
|
716
|
+
commit(): void;
|
|
717
|
+
cancel(): void;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
// @public (undocumented)
|
|
721
|
+
export type ViewportChangeEvent = {
|
|
722
|
+
viewport: ViewportSnapshot;
|
|
723
|
+
previousViewport: ViewportSnapshot;
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
// @public (undocumented)
|
|
727
|
+
export type ViewportSnapshot = {
|
|
728
|
+
scale: number;
|
|
729
|
+
offset: Point;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
// @public (undocumented)
|
|
733
|
+
export type WorldBounds = {
|
|
734
|
+
minX: number;
|
|
735
|
+
minY: number;
|
|
736
|
+
maxX: number;
|
|
737
|
+
maxY: number;
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
// Warnings were encountered during analysis:
|
|
741
|
+
//
|
|
742
|
+
// dist/types-DnR8yhxj.d.ts:45:5 - (ae-forgotten-export) The symbol "AssetRef" needs to be exported by the entry point node.d.ts
|
|
743
|
+
// dist/types-DnR8yhxj.d.ts:271:9 - (ae-forgotten-export) The symbol "RequestOptions" needs to be exported by the entry point node.d.ts
|
|
744
|
+
// dist/types-DnR8yhxj.d.ts:272:9 - (ae-forgotten-export) The symbol "DocumentLoadOptions_2" needs to be exported by the entry point node.d.ts
|
|
745
|
+
// dist/types-DnR8yhxj.d.ts:272:9 - (ae-forgotten-export) The symbol "WriteOptions" needs to be exported by the entry point node.d.ts
|
|
746
|
+
// dist/types-DnR8yhxj.d.ts:275:13 - (ae-forgotten-export) The symbol "BoardChangeSet" needs to be exported by the entry point node.d.ts
|
|
747
|
+
// dist/types-DnR8yhxj.d.ts:281:9 - (ae-forgotten-export) The symbol "ReadNodesInput" needs to be exported by the entry point node.d.ts
|
|
748
|
+
// dist/types-DnR8yhxj.d.ts:281:9 - (ae-forgotten-export) The symbol "ReadNodesResult" needs to be exported by the entry point node.d.ts
|
|
749
|
+
// dist/types-DnR8yhxj.d.ts:282:9 - (ae-forgotten-export) The symbol "WriteResult" needs to be exported by the entry point node.d.ts
|
|
750
|
+
// dist/types-DnR8yhxj.d.ts:283:13 - (ae-forgotten-export) The symbol "CreateNodeInput" needs to be exported by the entry point node.d.ts
|
|
751
|
+
// dist/types-DnR8yhxj.d.ts:286:13 - (ae-forgotten-export) The symbol "UpdateNodeInput" needs to be exported by the entry point node.d.ts
|
|
752
|
+
// dist/types-DnR8yhxj.d.ts:293:9 - (ae-forgotten-export) The symbol "ReadAssetsResult" needs to be exported by the entry point node.d.ts
|
|
753
|
+
// dist/types-DnR8yhxj.d.ts:300:13 - (ae-forgotten-export) The symbol "AssetRecord" needs to be exported by the entry point node.d.ts
|
|
754
|
+
// dist/types-DnR8yhxj.d.ts:328:9 - (ae-forgotten-export) The symbol "PreviewResult" needs to be exported by the entry point node.d.ts
|
|
755
|
+
// dist/types-DnR8yhxj.d.ts:508:5 - (ae-forgotten-export) The symbol "BoardCoreOptions" needs to be exported by the entry point node.d.ts
|
|
756
|
+
// dist/types-DnR8yhxj.d.ts:511:5 - (ae-forgotten-export) The symbol "PreviewService" needs to be exported by the entry point node.d.ts
|
|
757
|
+
// dist/types-DnR8yhxj.d.ts:512:5 - (ae-forgotten-export) The symbol "CaptureService" needs to be exported by the entry point node.d.ts
|
|
758
|
+
|
|
759
|
+
// (No @packageDocumentation comment for this package)
|
|
760
|
+
|
|
761
|
+
```
|