@yudaocode/univer-boards 0.0.0-stage → 1.6.219

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.
@@ -0,0 +1,168 @@
1
+ import { FBase, IEventBase, FUniver } from '@univerjs/core/facade';
2
+ import { BoardUnitModel, IBoardUnitData, IBoardElement, IBoardFrameElement, BoardElementType, BoardAlignmentMode, IExportBoardMermaidOptions, IExportBoardSvgOptions, IExportBoardPdfOptions, IExportBoardPptxOptions, IImportCsvStickiesOptions, IBoardViewport, IBoardVotingLeaderboardEntry, IImportDocTilerOptions, BoardExportFormat } from '@yudaocode/univer-boards';
3
+ import { Injector, ICommandService, ICreateUnitOptions } from '@univerjs/core';
4
+
5
+ declare class FBoard extends FBase {
6
+ private readonly _model;
7
+ protected readonly _injector: Injector;
8
+ private readonly _commandService;
9
+ constructor(_model: BoardUnitModel, _injector: Injector, _commandService: ICommandService);
10
+ getId(): string;
11
+ getName(): string;
12
+ setName(name: string): this;
13
+ getModel(): BoardUnitModel;
14
+ getSnapshot(): IBoardUnitData;
15
+ save(): IBoardUnitData;
16
+ getElements(): IBoardElement[];
17
+ getElementById(id: string): IBoardElement | undefined;
18
+ getFrames(): IBoardFrameElement[];
19
+ addElements(elements: Array<Partial<IBoardElement> & {
20
+ type: BoardElementType;
21
+ }>): boolean;
22
+ updateElement(id: string, patch: Partial<IBoardElement> & Record<string, unknown>): boolean;
23
+ deleteElements(elementIds: string[]): boolean;
24
+ alignElements(alignment: BoardAlignmentMode, elementIds?: string[]): boolean;
25
+ groupInFrame(elementIds: string[], title?: string): boolean;
26
+ addMindmapChild(parentId: string, text?: string): boolean;
27
+ addMindmapSibling(nodeId: string, text?: string): boolean;
28
+ layoutMindmap(rootId?: string): boolean;
29
+ voteSticky(elementId: string, voterId?: string): boolean;
30
+ importMermaid(mermaidCode: string, options?: {
31
+ originX?: number;
32
+ originY?: number;
33
+ replaceExisting?: boolean;
34
+ }): boolean;
35
+ toMermaid(options?: IExportBoardMermaidOptions): string;
36
+ exportSvg(options?: IExportBoardSvgOptions): string;
37
+ exportPdf(options?: IExportBoardPdfOptions): Promise<Uint8Array>;
38
+ exportPptx(options?: IExportBoardPptxOptions): Uint8Array;
39
+ exportCsv(): string;
40
+ exportRasterDataUrl(format?: 'png' | 'jpeg', scale?: number): Promise<string>;
41
+ importCsvStickies(csvText: string, options?: IImportCsvStickiesOptions): boolean;
42
+ setViewport(viewport: Partial<IBoardViewport>): boolean;
43
+ addComment(x: number, y: number, text: string, author?: string): boolean;
44
+ replaceSnapshot(snapshot: IBoardUnitData): boolean;
45
+ selectElements(ids: string[]): this;
46
+ startPrivateBrainstorm(options?: {
47
+ hideAuthorNames?: boolean;
48
+ facilitatorId?: string;
49
+ }): boolean;
50
+ revealPrivateBrainstorm(): boolean;
51
+ stopPrivateBrainstorm(): boolean;
52
+ startVotingSession(options?: {
53
+ title?: string;
54
+ maxVotesPerUser?: number;
55
+ allowMultiplePerSticky?: boolean;
56
+ targetFrameId?: string;
57
+ }): boolean;
58
+ castSessionVote(elementId: string, voterId?: string, unvote?: boolean): boolean;
59
+ endVotingSession(): boolean;
60
+ getVotingLeaderboard(targetFrameId?: string): IBoardVotingLeaderboardEntry[];
61
+ importDocumentPages(fileBytes: Uint8Array, options?: IImportDocTilerOptions & {
62
+ fileName?: string;
63
+ format?: 'pdf' | 'pptx';
64
+ replaceExisting?: boolean;
65
+ }): Promise<boolean>;
66
+ }
67
+
68
+ interface IBoardLoadedEventParams extends IEventBase {
69
+ board: FBoard;
70
+ unitId: string;
71
+ }
72
+ interface IBoardDisposedEventParams extends IEventBase {
73
+ unitId: string;
74
+ }
75
+ interface IBoardSelectionChangedEventParams extends IEventBase {
76
+ board: FBoard;
77
+ unitId: string;
78
+ elementIds: string[];
79
+ }
80
+ interface IBoardExportedEventParams extends IEventBase {
81
+ board?: FBoard;
82
+ unitId: string;
83
+ format: BoardExportFormat;
84
+ byteLength: number;
85
+ }
86
+ interface IFBoardEventNameMixin {
87
+ readonly BoardLoaded: 'BoardLoaded';
88
+ readonly BoardDisposed: 'BoardDisposed';
89
+ readonly BoardSelectionChanged: 'BoardSelectionChanged';
90
+ readonly BoardExported: 'BoardExported';
91
+ }
92
+ declare class FEventNameBoardsMixin implements IFBoardEventNameMixin {
93
+ get BoardLoaded(): 'BoardLoaded';
94
+ get BoardDisposed(): 'BoardDisposed';
95
+ get BoardSelectionChanged(): 'BoardSelectionChanged';
96
+ get BoardExported(): 'BoardExported';
97
+ }
98
+ interface IBoardEventParamConfig {
99
+ BoardLoaded: IBoardLoadedEventParams;
100
+ BoardDisposed: IBoardDisposedEventParams;
101
+ BoardSelectionChanged: IBoardSelectionChangedEventParams;
102
+ BoardExported: IBoardExportedEventParams;
103
+ }
104
+ declare module '@univerjs/core/facade' {
105
+ interface FEventName extends IFBoardEventNameMixin {
106
+ }
107
+ interface IEventParamConfig extends IBoardEventParamConfig {
108
+ }
109
+ }
110
+
111
+ interface IFUniverBoardsMixin {
112
+ /**
113
+ * Creates a new `UNIVER_BOARD` unit and returns its `FBoard` facade instance.
114
+ */
115
+ createBoard(data?: Partial<IBoardUnitData>, options?: ICreateUnitOptions): FBoard;
116
+ /**
117
+ * Returns the currently active `FBoard` facade instance, or `null` if none is active.
118
+ */
119
+ getActiveBoard(): FBoard | null;
120
+ /**
121
+ * Returns the `FBoard` facade instance for `unitId`, or `null` if not found.
122
+ */
123
+ getBoard(unitId: string): FBoard | null;
124
+ /**
125
+ * Parses Mermaid diagram syntax and inserts native editable elements into the target or active board.
126
+ */
127
+ importBoardMermaid(mermaidCode: string, options?: {
128
+ unitId?: string;
129
+ originX?: number;
130
+ originY?: number;
131
+ replaceExisting?: boolean;
132
+ }): boolean;
133
+ /**
134
+ * Exports the specified or active board to standalone crisp `.svg` markup.
135
+ */
136
+ exportBoardSvg(unitIdOrOptions?: string | IExportBoardSvgOptions, options?: IExportBoardSvgOptions): string;
137
+ /**
138
+ * Exports the specified or active board to vector `.pdf` bytes (`Uint8Array`).
139
+ */
140
+ exportBoardPdf(unitIdOrOptions?: string | IExportBoardPdfOptions, options?: IExportBoardPdfOptions): Promise<Uint8Array>;
141
+ /**
142
+ * Exports the specified or active board to native OpenXML `.pptx` bytes (`Uint8Array`).
143
+ */
144
+ exportBoardPptx(unitIdOrOptions?: string | IExportBoardPptxOptions, options?: IExportBoardPptxOptions): Uint8Array;
145
+ }
146
+ declare class FUniverBoardsMixin extends FUniver implements IFUniverBoardsMixin {
147
+ private _boardEventsWired?;
148
+ private _ensureBoardEventWiring;
149
+ _initialize(injector: Injector): void;
150
+ createBoard(data?: Partial<IBoardUnitData>, options?: ICreateUnitOptions): FBoard;
151
+ getActiveBoard(): FBoard | null;
152
+ getBoard(unitId: string): FBoard | null;
153
+ importBoardMermaid(mermaidCode: string, options?: {
154
+ unitId?: string;
155
+ originX?: number;
156
+ originY?: number;
157
+ replaceExisting?: boolean;
158
+ }): boolean;
159
+ exportBoardSvg(unitIdOrOptions?: string | IExportBoardSvgOptions, options?: IExportBoardSvgOptions): string;
160
+ exportBoardPdf(unitIdOrOptions?: string | IExportBoardPdfOptions, options?: IExportBoardPdfOptions): Promise<Uint8Array>;
161
+ exportBoardPptx(unitIdOrOptions?: string | IExportBoardPptxOptions, options?: IExportBoardPptxOptions): Uint8Array;
162
+ }
163
+ declare module '@univerjs/core/facade' {
164
+ interface FUniver extends IFUniverBoardsMixin {
165
+ }
166
+ }
167
+
168
+ export { FBoard, FEventNameBoardsMixin, FUniverBoardsMixin, type IBoardDisposedEventParams, type IBoardEventParamConfig, type IBoardExportedEventParams, type IBoardLoadedEventParams, type IBoardSelectionChangedEventParams, type IFBoardEventNameMixin, type IFUniverBoardsMixin };