@netless/window-manager 1.0.0-canary.75 → 1.0.0-canary.77

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.
@@ -8,7 +8,7 @@ import type { AppManager } from "../AppManager";
8
8
  import type { AppProxy } from "./AppProxy";
9
9
  import type { MagixEventAddListener, MagixEventDispatcher, MagixEventRemoveListener } from "./MagixEvent";
10
10
  import { WhiteBoardView } from "./WhiteboardView";
11
- export declare type CreateWhiteBoardViewParams = {
11
+ export type CreateWhiteBoardViewParams = {
12
12
  size?: number;
13
13
  syncCamera?: boolean;
14
14
  };
@@ -1,6 +1,6 @@
1
1
  import type { Displayer, ScenesCallbacksNode, View } from "white-web-sdk";
2
2
  import type { PageState } from "../Page";
3
- export declare type AppPageStateParams = {
3
+ export type AppPageStateParams = {
4
4
  displayer: Displayer;
5
5
  scenePath: string | undefined;
6
6
  view: View | undefined;
@@ -11,7 +11,7 @@ import type { NetlessApp } from "../typings";
11
11
  import type { ReadonlyTeleBox } from "@netless/telebox-insider";
12
12
  import type { PageRemoveService, PageState } from "../Page";
13
13
  import type { AppState } from "./type";
14
- export declare type AppEmitter = Emittery<AppEmitterEvent>;
14
+ export type AppEmitter = Emittery<AppEmitterEvent>;
15
15
  export declare class AppProxy implements PageRemoveService {
16
16
  private params;
17
17
  private manager;
@@ -20,10 +20,10 @@ export interface MagixEventMessage<TPayloads = any, TEvent extends MagixEventTyp
20
20
  scope: `${WhiteScope}`;
21
21
  phase: `${WhiteEventPhase}`;
22
22
  }
23
- export declare type MagixEventTypes<TPayloads = any> = Extract<keyof TPayloads, string>;
24
- export declare type MagixEventPayload<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = TPayloads[TEvent];
25
- export declare type MagixEventDispatcher<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, payload: TPayloads[TEvent]) => void;
26
- export declare type MagixEventHandler<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = (message: MagixEventMessage<TPayloads, TEvent>) => void;
27
- export declare type MagixEventListenerDisposer = () => void;
28
- export declare type MagixEventAddListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler: MagixEventHandler<TPayloads, TEvent>, options?: MagixEventListenerOptions | undefined) => MagixEventListenerDisposer;
29
- export declare type MagixEventRemoveListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler?: MagixEventHandler<TPayloads, TEvent>) => void;
23
+ export type MagixEventTypes<TPayloads = any> = Extract<keyof TPayloads, string>;
24
+ export type MagixEventPayload<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = TPayloads[TEvent];
25
+ export type MagixEventDispatcher<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, payload: TPayloads[TEvent]) => void;
26
+ export type MagixEventHandler<TPayloads = any, TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>> = (message: MagixEventMessage<TPayloads, TEvent>) => void;
27
+ export type MagixEventListenerDisposer = () => void;
28
+ export type MagixEventAddListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler: MagixEventHandler<TPayloads, TEvent>, options?: MagixEventListenerOptions | undefined) => MagixEventListenerDisposer;
29
+ export type MagixEventRemoveListener<TPayloads = any> = <TEvent extends MagixEventTypes<TPayloads> = MagixEventTypes<TPayloads>>(event: TEvent, handler?: MagixEventHandler<TPayloads, TEvent>) => void;
@@ -5,8 +5,8 @@ import type { AppContext } from "./AppContext";
5
5
  import type { View } from "white-web-sdk";
6
6
  import type { TeleBoxRect } from "@netless/telebox-insider";
7
7
  import type { ICamera, ISize } from "../AttributesDelegate";
8
- export declare type WhiteBoardViewCamera = Omit<ICamera, "id">;
9
- export declare type WhiteBoardViewRect = Omit<ISize, "id">;
8
+ export type WhiteBoardViewCamera = Omit<ICamera, "id">;
9
+ export type WhiteBoardViewRect = Omit<ISize, "id">;
10
10
  export declare class WhiteBoardView implements PageController {
11
11
  view: View;
12
12
  protected appContext: AppContext;
@@ -1,4 +1,4 @@
1
- export declare type AppState = {
1
+ export type AppState = {
2
2
  id: string;
3
3
  focus?: boolean;
4
4
  SceneIndex?: number;
@@ -18,28 +18,28 @@ export declare enum Fields {
18
18
  Camera = "camera",
19
19
  Size = "size"
20
20
  }
21
- export declare type Apps = {
21
+ export type Apps = {
22
22
  [key: string]: AppSyncAttributes;
23
23
  };
24
- export declare type Position = {
24
+ export type Position = {
25
25
  x: number;
26
26
  y: number;
27
27
  type: PositionType;
28
28
  id?: string;
29
29
  };
30
- export declare type PositionType = "main" | "app";
31
- export declare type StoreContext = {
30
+ export type PositionType = "main" | "app";
31
+ export type StoreContext = {
32
32
  getAttributes: () => any;
33
33
  safeUpdateAttributes: (keys: string[], value: any) => void;
34
34
  safeSetAttributes: (attributes: any) => void;
35
35
  };
36
- export declare type ICamera = {
36
+ export type ICamera = {
37
37
  id: string;
38
38
  centerX: number | null;
39
39
  centerY: number | null;
40
40
  scale: number;
41
41
  };
42
- export declare type ISize = Size & {
42
+ export type ISize = Size & {
43
43
  id: string;
44
44
  };
45
45
  export declare class AttributesDelegate {
@@ -77,7 +77,7 @@ export declare class AttributesDelegate {
77
77
  cleanCursor(uid: string): void;
78
78
  setMainViewFocusPath(mainView: View): void;
79
79
  }
80
- export declare type Cursors = {
80
+ export type Cursors = {
81
81
  [key: string]: Cursor;
82
82
  };
83
83
  export declare const store: AttributesDelegate;
@@ -1,34 +1,34 @@
1
1
  import type { TELE_BOX_STATE } from "@netless/telebox-insider";
2
2
  import Emittery from "emittery";
3
- export declare type BoxMovePayload = {
3
+ export type BoxMovePayload = {
4
4
  appId: string;
5
5
  x: number;
6
6
  y: number;
7
7
  };
8
- export declare type BoxFocusPayload = {
8
+ export type BoxFocusPayload = {
9
9
  appId: string;
10
10
  };
11
- export declare type BoxResizePayload = {
11
+ export type BoxResizePayload = {
12
12
  appId: string;
13
13
  width: number;
14
14
  height: number;
15
15
  x?: number;
16
16
  y?: number;
17
17
  };
18
- export declare type BoxClosePayload = {
18
+ export type BoxClosePayload = {
19
19
  appId: string;
20
20
  error?: Error;
21
21
  };
22
- export declare type BoxStateChangePayload = {
22
+ export type BoxStateChangePayload = {
23
23
  appId: string;
24
24
  state: TELE_BOX_STATE;
25
25
  };
26
- export declare type BoxEvent = {
26
+ export type BoxEvent = {
27
27
  move: BoxMovePayload;
28
28
  focus: BoxFocusPayload;
29
29
  resize: BoxResizePayload;
30
30
  close: BoxClosePayload;
31
31
  boxStateChange: BoxStateChangePayload;
32
32
  };
33
- export declare type BoxEmitterType = Emittery<BoxEvent>;
33
+ export type BoxEmitterType = Emittery<BoxEvent>;
34
34
  export declare const boxEmitter: BoxEmitterType;
@@ -13,7 +13,7 @@ import type { EmitterType } from "./InternalEmitter";
13
13
  import type { AppState } from "./App/type";
14
14
  import { ReadonlyVal } from "value-enhancer";
15
15
  export { TELE_BOX_STATE };
16
- export declare type CreateBoxParams = {
16
+ export type CreateBoxParams = {
17
17
  appId: string;
18
18
  app: NetlessApp;
19
19
  view?: View;
@@ -22,26 +22,26 @@ export declare type CreateBoxParams = {
22
22
  canOperate?: boolean;
23
23
  smartPosition?: boolean;
24
24
  };
25
- declare type AppId = {
25
+ type AppId = {
26
26
  appId: string;
27
27
  };
28
- declare type MoveBoxParams = AppId & {
28
+ type MoveBoxParams = AppId & {
29
29
  x: number;
30
30
  y: number;
31
31
  };
32
- declare type ResizeBoxParams = AppId & {
32
+ type ResizeBoxParams = AppId & {
33
33
  width: number;
34
34
  height: number;
35
35
  skipUpdate: boolean;
36
36
  };
37
- declare type SetBoxMinSizeParams = AppId & {
37
+ type SetBoxMinSizeParams = AppId & {
38
38
  minWidth: number;
39
39
  minHeight: number;
40
40
  };
41
- declare type SetBoxTitleParams = AppId & {
41
+ type SetBoxTitleParams = AppId & {
42
42
  title: string;
43
43
  };
44
- export declare type CreateTeleBoxManagerConfig = {
44
+ export type CreateTeleBoxManagerConfig = {
45
45
  collectorContainer?: HTMLElement;
46
46
  collectorStyles?: Partial<CSSStyleDeclaration>;
47
47
  prefersColorScheme?: TeleBoxColorScheme;
@@ -53,7 +53,7 @@ export declare type CreateTeleBoxManagerConfig = {
53
53
  defaultBoxStageStyle?: string | null;
54
54
  theme?: TeleBoxManagerThemeConfig;
55
55
  };
56
- export declare type BoxManagerContext = {
56
+ export type BoxManagerContext = {
57
57
  safeSetAttributes: (attributes: any) => void;
58
58
  updateAppState: (appId: string, field: AppAttributes, value: any) => void;
59
59
  emitter: EmitterType;
@@ -3,7 +3,7 @@ import type { Position } from "../AttributesDelegate";
3
3
  import type { RoomMember } from "white-web-sdk";
4
4
  import type { CursorManager } from "./index";
5
5
  import type { AppManager } from "../AppManager";
6
- export declare type Payload = {
6
+ export type Payload = {
7
7
  [key: string]: any;
8
8
  };
9
9
  export declare class Cursor {
@@ -0,0 +1 @@
1
+ export { SvelteComponentTyped as default } from 'svelte/internal';
@@ -4,11 +4,11 @@ import type { PositionType } from "../AttributesDelegate";
4
4
  import type { RoomMember, View } from "white-web-sdk";
5
5
  import type { AppManager } from "../AppManager";
6
6
  import { Val } from "value-enhancer";
7
- export declare type EventType = {
7
+ export type EventType = {
8
8
  type: PositionType;
9
9
  id?: string;
10
10
  };
11
- export declare type MoveCursorParams = {
11
+ export type MoveCursorParams = {
12
12
  uid: string;
13
13
  x: number;
14
14
  y: number;
package/dist/Helper.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare const setupWrapper: (root: HTMLElement, target: HTMLElement) => {
6
6
  };
7
7
  export declare const checkVersion: () => void;
8
8
  export declare const findMemberByUid: (room: Room | undefined, uid: string) => RoomMember | undefined;
9
- export declare type Member = RoomMember & {
9
+ export type Member = RoomMember & {
10
10
  uid: string;
11
11
  };
12
12
  export declare const serializeRoomMembers: (members: readonly RoomMember[]) => any[];
@@ -2,11 +2,11 @@ import Emittery from "emittery";
2
2
  import type { TeleBoxRect } from "@netless/telebox-insider";
3
3
  import type { CursorMovePayload } from "./index";
4
4
  import type { MemberState } from "white-web-sdk";
5
- export declare type RemoveSceneParams = {
5
+ export type RemoveSceneParams = {
6
6
  scenePath: string;
7
7
  index?: number;
8
8
  };
9
- export declare type EmitterEvent = {
9
+ export type EmitterEvent = {
10
10
  onCreated: undefined;
11
11
  error: Error;
12
12
  seekStart: undefined;
@@ -32,5 +32,5 @@ export declare type EmitterEvent = {
32
32
  containerSizeRatioUpdate: number;
33
33
  memberStateChange: MemberState;
34
34
  };
35
- export declare type EmitterType = Emittery<EmitterEvent>;
35
+ export type EmitterType = Emittery<EmitterEvent>;
36
36
  export declare const emitter: EmitterType;
@@ -1,9 +1,9 @@
1
1
  import type { SceneDefinition } from "white-web-sdk";
2
- export declare type AddPageParams = {
2
+ export type AddPageParams = {
3
3
  after?: boolean;
4
4
  scene?: SceneDefinition | SceneDefinition[];
5
5
  };
6
- export declare type PageState = {
6
+ export type PageState = {
7
7
  index: number;
8
8
  length: number;
9
9
  pages: string[];
@@ -1,6 +1,6 @@
1
1
  import type { Room } from "white-web-sdk";
2
2
  import type { EmitterType } from "./InternalEmitter";
3
- export declare type ReconnectRefresherContext = {
3
+ export type ReconnectRefresherContext = {
4
4
  emitter: EmitterType;
5
5
  };
6
6
  export declare class ReconnectRefresher {
@@ -1,6 +1,6 @@
1
1
  import type { View } from "white-web-sdk";
2
2
  import type { AppProxy } from "./App";
3
- export declare type RedoUndoContext = {
3
+ export type RedoUndoContext = {
4
4
  mainView: () => View;
5
5
  focus: () => string | undefined;
6
6
  getAppProxy: (id: string) => AppProxy | undefined;
@@ -1,16 +1,16 @@
1
1
  import Emittery from "emittery";
2
2
  import type { NetlessApp, RegisterEvents, RegisterParams } from "../typings";
3
- export declare type LoadAppEvent = {
3
+ export type LoadAppEvent = {
4
4
  kind: string;
5
5
  status: "start" | "success" | "failed";
6
6
  reason?: string;
7
7
  };
8
- export declare type SyncRegisterAppPayload = {
8
+ export type SyncRegisterAppPayload = {
9
9
  kind: string;
10
10
  src: string;
11
11
  name: string | undefined;
12
12
  };
13
- export declare type SyncRegisterApp = (payload: SyncRegisterAppPayload) => void;
13
+ export type SyncRegisterApp = (payload: SyncRegisterAppPayload) => void;
14
14
  export declare class AppRegister {
15
15
  kindEmitters: Map<string, Emittery<RegisterEvents>>;
16
16
  registered: Map<string, RegisterParams>;
@@ -1,5 +1,5 @@
1
1
  import type { AppRegister } from "./index";
2
- export declare type Item = {
2
+ export type Item = {
3
3
  kind: string;
4
4
  url: string;
5
5
  sourceCode: string;
@@ -1,4 +1,4 @@
1
- export declare type Invoker<T = any> = () => Promise<T | undefined>;
1
+ export type Invoker<T = any> = () => Promise<T | undefined>;
2
2
  export declare class AppCreateQueue {
3
3
  private list;
4
4
  private currentInvoker;
@@ -1,7 +1,7 @@
1
1
  import type { TeleBoxRect } from "@netless/telebox-insider";
2
2
  import type { View } from "white-web-sdk";
3
3
  import type { ICamera, ISize } from "../AttributesDelegate";
4
- export declare type SaveCamera = (camera: ICamera) => void;
4
+ export type SaveCamera = (camera: ICamera) => void;
5
5
  export declare class CameraSynchronizer {
6
6
  protected saveCamera: SaveCamera;
7
7
  remoteCamera?: ICamera;
@@ -3,7 +3,7 @@ import type { ReadonlyVal } from "value-enhancer";
3
3
  import type { AppManager } from "../AppManager";
4
4
  import type { ScrollStorage } from "../storage";
5
5
  import type { View } from "white-web-sdk";
6
- export declare type ScrollState = {
6
+ export type ScrollState = {
7
7
  scrollTop: number;
8
8
  page: number;
9
9
  maxScrollPage: number;
@@ -4,7 +4,7 @@ import type { ReadonlyVal } from "value-enhancer";
4
4
  import type { ICamera, ISize } from "../AttributesDelegate";
5
5
  import type { TeleBoxRect } from "@netless/telebox-insider";
6
6
  import type { ManagerViewMode } from "../typings";
7
- export declare type ViewSyncContext = {
7
+ export type ViewSyncContext = {
8
8
  uid: string;
9
9
  camera$: Val<ICamera | undefined, boolean>;
10
10
  size$: Val<ISize | undefined>;
@@ -5,7 +5,7 @@ import type { LoadAppEvent } from "./Register";
5
5
  import type { PageState } from "./Page";
6
6
  import type { ISize } from "./AttributesDelegate";
7
7
  import type { ScrollState } from "./View/ScrollMode";
8
- export declare type PublicEvent = {
8
+ export type PublicEvent = {
9
9
  mainViewModeChange: ViewVisionMode;
10
10
  boxStateChange: `${TELE_BOX_STATE}`;
11
11
  darkModeChange: boolean;
@@ -31,5 +31,5 @@ export declare type PublicEvent = {
31
31
  userScroll: undefined;
32
32
  scrollStateChange: ScrollState;
33
33
  };
34
- export declare type CallbacksType = Emittery<PublicEvent>;
34
+ export type CallbacksType = Emittery<PublicEvent>;
35
35
  export declare const callbacks: CallbacksType;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import type { PublicEvent } from "./callback";
14
14
  import type Emittery from "emittery";
15
15
  import type { PageController, AddPageParams, PageState } from "./Page";
16
16
  import type { ScrollState } from "./View/ScrollMode";
17
- export declare type WindowMangerAttributes = {
17
+ export type WindowMangerAttributes = {
18
18
  modelValue?: string;
19
19
  boxState: TELE_BOX_STATE;
20
20
  maximized?: boolean;
@@ -22,31 +22,31 @@ export declare type WindowMangerAttributes = {
22
22
  scrollTop?: number;
23
23
  [key: string]: any;
24
24
  };
25
- export declare type apps = {
25
+ export type apps = {
26
26
  [key: string]: NetlessApp;
27
27
  };
28
- export declare type AddAppOptions = {
28
+ export type AddAppOptions = {
29
29
  scenePath?: string;
30
30
  title?: string;
31
31
  scenes?: SceneDefinition[];
32
32
  };
33
- export declare type setAppOptions = AddAppOptions & {
33
+ export type setAppOptions = AddAppOptions & {
34
34
  appOptions?: any;
35
35
  };
36
- export declare type AddAppParams<TAttributes = any> = {
36
+ export type AddAppParams<TAttributes = any> = {
37
37
  kind: string;
38
38
  src?: string;
39
39
  options?: AddAppOptions;
40
40
  attributes?: TAttributes;
41
41
  };
42
- export declare type BaseInsertParams = {
42
+ export type BaseInsertParams = {
43
43
  kind: string;
44
44
  src?: string;
45
45
  options?: AddAppOptions;
46
46
  attributes?: any;
47
47
  isDynamicPPT?: boolean;
48
48
  };
49
- export declare type AppSyncAttributes = {
49
+ export type AppSyncAttributes = {
50
50
  kind: string;
51
51
  src?: string;
52
52
  options: any;
@@ -58,7 +58,7 @@ export declare type AppSyncAttributes = {
58
58
  size?: ISize;
59
59
  setup: boolean;
60
60
  };
61
- export declare type AppInitState = {
61
+ export type AppInitState = {
62
62
  id: string;
63
63
  x?: number;
64
64
  y?: number;
@@ -76,12 +76,12 @@ export declare type AppInitState = {
76
76
  draggable?: boolean;
77
77
  ratio?: number;
78
78
  };
79
- export declare type CursorMovePayload = {
79
+ export type CursorMovePayload = {
80
80
  uid: string;
81
81
  state?: "leave";
82
82
  position: Position;
83
83
  };
84
- export declare type MountParams = {
84
+ export type MountParams = {
85
85
  room: Room | Player;
86
86
  container?: HTMLElement;
87
87
  /** 白板高宽比例, 默认为 9 / 16 */
@@ -139,7 +139,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
139
139
  static mount(params: MountParams): Promise<WindowManager>;
140
140
  private static initManager;
141
141
  private static initContainer;
142
- static get registered(): Map<string, RegisterParams<any, any, any>>;
142
+ static get registered(): Map<string, RegisterParams>;
143
143
  bindContainer(container: HTMLElement): void;
144
144
  bindCollectorContainer(container: HTMLElement): void;
145
145
  /**