@netless/fastboard-ui 0.3.16 → 0.3.17-beta.1
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/dist/full.d.ts +176 -0
- package/dist/full.js +15513 -0
- package/dist/full.js.map +1 -0
- package/dist/full.mjs +15497 -0
- package/dist/full.mjs.map +1 -0
- package/package.json +8 -4
package/dist/full.d.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { FastboardApp, FastboardPlayer } from '@netless/fastboard-core/full';
|
|
2
|
+
import { SvelteComponentTyped } from 'svelte/internal';
|
|
3
|
+
export { SvelteComponentTyped } from 'svelte/internal';
|
|
4
|
+
|
|
5
|
+
interface SvelteAction<T = void> {
|
|
6
|
+
(node: HTMLElement, parameters: T): void | {
|
|
7
|
+
update?: (parameters: T) => void;
|
|
8
|
+
destroy?: () => void;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type Theme = "light" | "dark";
|
|
12
|
+
type Language = "en" | "zh-CN";
|
|
13
|
+
type IconType = "normal" | "disable";
|
|
14
|
+
type GenericIcon<K extends string, E extends string = IconType> = {
|
|
15
|
+
[key in K]: {
|
|
16
|
+
[kind in E]: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type I18nData<T extends string> = Record<Language, Record<T, string>>;
|
|
20
|
+
type ToolbarItem = "clicker" | "selector" | "pencil" | "text" | "shapes" | "eraser" | "clear" | "hand" | "laserPointer";
|
|
21
|
+
interface ToolbarConfig {
|
|
22
|
+
/** @default "left" */
|
|
23
|
+
placement?: "left" | "right";
|
|
24
|
+
/** @default ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] */
|
|
25
|
+
items?: ToolbarItem[];
|
|
26
|
+
/**
|
|
27
|
+
* Note: updating this option does not take effect when the element was mounted.
|
|
28
|
+
* Make sure to set this option in `UI.mount(div, { configs: { toolbar: { collapsed: true } } })`.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
collapsed?: boolean;
|
|
32
|
+
/** Control the last button which opens apps stock on toolbar. */
|
|
33
|
+
apps?: {
|
|
34
|
+
enable?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface FastboardUIConfig {
|
|
38
|
+
toolbar?: {
|
|
39
|
+
enable?: boolean;
|
|
40
|
+
} & ToolbarConfig;
|
|
41
|
+
redo_undo?: {
|
|
42
|
+
enable?: boolean;
|
|
43
|
+
};
|
|
44
|
+
zoom_control?: {
|
|
45
|
+
enable?: boolean;
|
|
46
|
+
};
|
|
47
|
+
page_control?: {
|
|
48
|
+
enable?: boolean;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface ReplayFastboardUIConfig {
|
|
52
|
+
player_control?: {
|
|
53
|
+
enable?: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare interface RedoUndoProps {
|
|
58
|
+
app?: FastboardApp | null;
|
|
59
|
+
theme?: Theme;
|
|
60
|
+
language?: Language;
|
|
61
|
+
icons?: GenericIcon<"undo" | "redo">;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class RedoUndo extends SvelteComponentTyped<RedoUndoProps> {}
|
|
65
|
+
|
|
66
|
+
declare interface PageControlProps {
|
|
67
|
+
app?: FastboardApp | null;
|
|
68
|
+
theme?: Theme;
|
|
69
|
+
language?: Language;
|
|
70
|
+
icons?: GenericIcon<"prev" | "next" | "add">;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare class PageControl extends SvelteComponentTyped<PageControlProps> {}
|
|
74
|
+
|
|
75
|
+
declare interface ZoomControlProps {
|
|
76
|
+
app?: FastboardApp | null;
|
|
77
|
+
theme?: Theme;
|
|
78
|
+
language?: Language;
|
|
79
|
+
icons?: GenericIcon<"plus" | "minus" | "reset">;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class ZoomControl extends SvelteComponentTyped<ZoomControlProps> {}
|
|
83
|
+
|
|
84
|
+
declare interface ToolbarProps {
|
|
85
|
+
app?: FastboardApp | null;
|
|
86
|
+
theme?: Theme;
|
|
87
|
+
language?: Language;
|
|
88
|
+
config?: ToolbarConfig;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare class Toolbar extends SvelteComponentTyped<ToolbarProps> {}
|
|
92
|
+
|
|
93
|
+
declare interface PlayerControlProps {
|
|
94
|
+
player?: FastboardPlayer | null;
|
|
95
|
+
theme?: Theme;
|
|
96
|
+
language?: Language;
|
|
97
|
+
icons?: GenericIcon<"play" | "pause" | "loading">;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare class PlayerControl extends SvelteComponentTyped<PlayerControlProps> {}
|
|
101
|
+
|
|
102
|
+
declare interface ReplayFastboardProps {
|
|
103
|
+
player?: FastboardPlayer | null;
|
|
104
|
+
theme?: Theme;
|
|
105
|
+
language?: Language;
|
|
106
|
+
containerRef?: (container: HTMLDivElement | null) => void;
|
|
107
|
+
config?: ReplayFastboardUIConfig;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class ReplayFastboard extends SvelteComponentTyped<ReplayFastboardProps> {}
|
|
111
|
+
|
|
112
|
+
declare interface FastboardProps {
|
|
113
|
+
app?: FastboardApp | null;
|
|
114
|
+
theme?: Theme;
|
|
115
|
+
language?: Language;
|
|
116
|
+
/**
|
|
117
|
+
* Note: updating this option does not take effect when the element was mounted.
|
|
118
|
+
* Make sure to set this option in `UI.mount(div, { containerRef })`.
|
|
119
|
+
*/
|
|
120
|
+
containerRef?: (container: HTMLDivElement | null) => void;
|
|
121
|
+
config?: FastboardUIConfig;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare class Fastboard extends SvelteComponentTyped<FastboardProps> {}
|
|
125
|
+
|
|
126
|
+
interface UI {
|
|
127
|
+
/** render UI to div */
|
|
128
|
+
mount(div: Element, props?: FastboardProps): UI;
|
|
129
|
+
/** update UI (theme, language, etc.) */
|
|
130
|
+
update(props?: FastboardProps): void;
|
|
131
|
+
/** remove UI */
|
|
132
|
+
destroy(): void;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @example
|
|
136
|
+
* let ui = createUI(fastboardApp, document.getElementById("whiteboard"));
|
|
137
|
+
* ui.update({ theme: "dark" })
|
|
138
|
+
*/
|
|
139
|
+
declare function createUI(app?: FastboardApp | null, div?: Element): UI;
|
|
140
|
+
interface ReplayUI {
|
|
141
|
+
/** render UI to div */
|
|
142
|
+
mount(div: Element, props?: ReplayFastboardProps): ReplayUI;
|
|
143
|
+
/** update UI (theme, language, etc.) */
|
|
144
|
+
update(props?: ReplayFastboardProps): void;
|
|
145
|
+
/** remove UI */
|
|
146
|
+
destroy(): void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @example
|
|
150
|
+
* let ui = createReplayUI(fastboardPlayer, document.getElementById("whiteboard"));
|
|
151
|
+
* ui.update({ theme: "dark" })
|
|
152
|
+
*/
|
|
153
|
+
declare function createReplayUI(player?: FastboardPlayer | null, div?: Element): ReplayUI;
|
|
154
|
+
|
|
155
|
+
interface AppInToolbar {
|
|
156
|
+
kind: string;
|
|
157
|
+
icon: string;
|
|
158
|
+
label: string;
|
|
159
|
+
onClick: (app: FastboardApp) => void;
|
|
160
|
+
}
|
|
161
|
+
declare class AppsInToolbar {
|
|
162
|
+
private _data;
|
|
163
|
+
_listeners: Array<(data: AppInToolbar[]) => void>;
|
|
164
|
+
constructor(_data: AppInToolbar[]);
|
|
165
|
+
get data(): AppInToolbar[];
|
|
166
|
+
get length(): number;
|
|
167
|
+
subscribe(fn: (data: AppInToolbar[]) => void): () => void;
|
|
168
|
+
push(...data: AppInToolbar[]): void;
|
|
169
|
+
insert(data: AppInToolbar, index: number): void;
|
|
170
|
+
delete(filter: (data: AppInToolbar) => boolean): void;
|
|
171
|
+
clear(): void;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare const apps: AppsInToolbar;
|
|
175
|
+
|
|
176
|
+
export { AppInToolbar, AppsInToolbar, Fastboard, FastboardProps, FastboardUIConfig, GenericIcon, I18nData, IconType, Language, PageControl, PageControlProps, PlayerControl, PlayerControlProps, RedoUndo, RedoUndoProps, ReplayFastboard, ReplayFastboardProps, ReplayFastboardUIConfig, ReplayUI, SvelteAction, Theme, Toolbar, ToolbarConfig, ToolbarItem, ToolbarProps, UI, ZoomControl, ZoomControlProps, apps, createReplayUI, createUI };
|