@netless/window-manager 1.0.0-canary.27 → 1.0.0-canary.28
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/index.cjs.js +19 -8
- package/dist/index.es.js +10 -4
- package/dist/index.umd.js +20 -9
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppProxy.ts +1 -0
- package/src/Utils/Common.ts +3 -0
- package/dist/App/AppContext.d.ts +0 -78
- package/dist/App/AppPageStateImpl.d.ts +0 -21
- package/dist/App/AppProxy.d.ts +0 -98
- package/dist/App/MagixEvent/index.d.ts +0 -29
- package/dist/App/Storage/StorageEvent.d.ts +0 -8
- package/dist/App/Storage/index.d.ts +0 -39
- package/dist/App/Storage/typings.d.ts +0 -22
- package/dist/App/Storage/utils.d.ts +0 -5
- package/dist/App/WhiteboardView.d.ts +0 -27
- package/dist/App/index.d.ts +0 -4
- package/dist/App/type.d.ts +0 -21
- package/dist/AppListener.d.ts +0 -19
- package/dist/AppManager.d.ts +0 -107
- package/dist/AttributesDelegate.d.ts +0 -83
- package/dist/BoxEmitter.d.ts +0 -34
- package/dist/BoxManager.d.ts +0 -102
- package/dist/BuiltinApps.d.ts +0 -8
- package/dist/Cursor/Cursor.d.ts +0 -39
- package/dist/Cursor/icons.d.ts +0 -3
- package/dist/Cursor/index.d.ts +0 -46
- package/dist/Helper.d.ts +0 -19
- package/dist/InternalEmitter.d.ts +0 -38
- package/dist/Page/PageController.d.ts +0 -21
- package/dist/Page/index.d.ts +0 -3
- package/dist/PageState.d.ts +0 -9
- package/dist/ReconnectRefresher.d.ts +0 -24
- package/dist/RedoUndo.d.ts +0 -18
- package/dist/Register/index.d.ts +0 -28
- package/dist/Register/loader.d.ts +0 -4
- package/dist/Register/storage.d.ts +0 -8
- package/dist/Utils/AppCreateQueue.d.ts +0 -15
- package/dist/Utils/Common.d.ts +0 -23
- package/dist/Utils/Reactive.d.ts +0 -6
- package/dist/Utils/RoomHacker.d.ts +0 -3
- package/dist/Utils/error.d.ts +0 -27
- package/dist/Utils/log.d.ts +0 -1
- package/dist/View/CameraSynchronizer.d.ts +0 -17
- package/dist/View/MainView.d.ts +0 -59
- package/dist/View/ViewManager.d.ts +0 -13
- package/dist/View/ViewSync.d.ts +0 -24
- package/dist/callback.d.ts +0 -29
- package/dist/constants.d.ts +0 -51
- package/dist/index.d.ts +0 -270
- package/dist/typings.d.ts +0 -88
@@ -1,24 +0,0 @@
|
|
1
|
-
import type { Room } from "white-web-sdk";
|
2
|
-
import type { EmitterType } from "./InternalEmitter";
|
3
|
-
export declare type ReconnectRefresherContext = {
|
4
|
-
emitter: EmitterType;
|
5
|
-
};
|
6
|
-
export declare class ReconnectRefresher {
|
7
|
-
private ctx;
|
8
|
-
private phase?;
|
9
|
-
private room;
|
10
|
-
private reactors;
|
11
|
-
private disposers;
|
12
|
-
constructor(ctx: ReconnectRefresherContext);
|
13
|
-
setRoom(room: Room | undefined): void;
|
14
|
-
setContext(ctx: ReconnectRefresherContext): void;
|
15
|
-
private onPhaseChanged;
|
16
|
-
private onReconnected;
|
17
|
-
private _onReconnected;
|
18
|
-
private releaseDisposers;
|
19
|
-
refresh(): void;
|
20
|
-
add(id: string, func: any): () => void;
|
21
|
-
remove(id: string): void;
|
22
|
-
hasReactor(id: string): boolean;
|
23
|
-
destroy(): void;
|
24
|
-
}
|
package/dist/RedoUndo.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { View } from "white-web-sdk";
|
2
|
-
import type { AppProxy } from "./App";
|
3
|
-
export declare type RedoUndoContext = {
|
4
|
-
mainView: () => View;
|
5
|
-
focus: () => string | undefined;
|
6
|
-
getAppProxy: (id: string) => AppProxy | undefined;
|
7
|
-
};
|
8
|
-
export declare class RedoUndo {
|
9
|
-
private context;
|
10
|
-
constructor(context: RedoUndoContext);
|
11
|
-
private addRedoUndoListeners;
|
12
|
-
private addViewCallbacks;
|
13
|
-
private disposeViewCallbacks;
|
14
|
-
private onCanRedoStepsUpdate;
|
15
|
-
private onCanUndoStepsUpdate;
|
16
|
-
private disposePrevFocusViewRedoUndoListeners;
|
17
|
-
destroy(): void;
|
18
|
-
}
|
package/dist/Register/index.d.ts
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import Emittery from "emittery";
|
2
|
-
import type { NetlessApp, RegisterEvents, RegisterParams } from "../typings";
|
3
|
-
export declare type LoadAppEvent = {
|
4
|
-
kind: string;
|
5
|
-
status: "start" | "success" | "failed";
|
6
|
-
reason?: string;
|
7
|
-
};
|
8
|
-
export declare type SyncRegisterAppPayload = {
|
9
|
-
kind: string;
|
10
|
-
src: string;
|
11
|
-
name: string | undefined;
|
12
|
-
};
|
13
|
-
export declare type SyncRegisterApp = (payload: SyncRegisterAppPayload) => void;
|
14
|
-
declare class AppRegister {
|
15
|
-
kindEmitters: Map<string, Emittery<RegisterEvents>>;
|
16
|
-
registered: Map<string, RegisterParams>;
|
17
|
-
appClassesCache: Map<string, Promise<NetlessApp>>;
|
18
|
-
appClasses: Map<string, () => Promise<NetlessApp>>;
|
19
|
-
private syncRegisterApp;
|
20
|
-
setSyncRegisterApp(fn: SyncRegisterApp): void;
|
21
|
-
onSyncRegisterAppChange: (payload: SyncRegisterAppPayload) => void;
|
22
|
-
register(params: RegisterParams): Promise<void>;
|
23
|
-
unregister(kind: string): void;
|
24
|
-
notifyApp<T extends keyof RegisterEvents>(kind: string, event: T, payload: RegisterEvents[T]): Promise<void>;
|
25
|
-
private createKindEmitter;
|
26
|
-
}
|
27
|
-
export declare const appRegister: AppRegister;
|
28
|
-
export {};
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import type { NetlessApp } from "../typings";
|
2
|
-
export declare const getScript: (url: string) => Promise<string>;
|
3
|
-
export declare const executeScript: (text: string, appName: string) => NetlessApp;
|
4
|
-
export declare const loadApp: (url: string, key: string, name?: string | undefined) => Promise<NetlessApp | undefined>;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export declare type Item = {
|
2
|
-
kind: string;
|
3
|
-
sourceCode: string;
|
4
|
-
};
|
5
|
-
export declare const initDb: () => Promise<void>;
|
6
|
-
export declare const setItem: (key: string, val: any) => Promise<void> | undefined;
|
7
|
-
export declare const getItem: (key: string) => Promise<Item | null>;
|
8
|
-
export declare const removeItem: (key: string) => Promise<void> | undefined;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
export declare type Invoker<T = any> = () => Promise<T | undefined>;
|
2
|
-
export declare class AppCreateQueue {
|
3
|
-
private list;
|
4
|
-
private currentInvoker;
|
5
|
-
private timer;
|
6
|
-
isEmit: boolean;
|
7
|
-
private initInterval;
|
8
|
-
push<T>(item: Invoker<T>): void;
|
9
|
-
invoke(): void;
|
10
|
-
private invoked;
|
11
|
-
private clear;
|
12
|
-
emitReady(): void;
|
13
|
-
empty(): void;
|
14
|
-
destroy(): void;
|
15
|
-
}
|
package/dist/Utils/Common.d.ts
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import type { PublicEvent } from "../callback";
|
2
|
-
import type { Displayer, ViewVisionMode, Room, View, SceneDefinition } from "white-web-sdk";
|
3
|
-
import type Emittery from "emittery";
|
4
|
-
export declare const genAppId: (kind: string) => Promise<string>;
|
5
|
-
export declare const setViewFocusScenePath: (view: View, focusScenePath: string) => View | undefined;
|
6
|
-
export declare const setViewSceneIndex: (view: View, index: number) => View | undefined;
|
7
|
-
export declare const releaseView: (view: View) => void;
|
8
|
-
export declare const setScenePath: (room: Room | undefined, scenePath: string) => void;
|
9
|
-
export declare const getScenePath: (room: Room | undefined, dir: string | undefined, index: number) => string | undefined;
|
10
|
-
export declare const removeScenes: (room: Room | undefined, scenePath: string, index?: number | undefined) => void;
|
11
|
-
export declare const setViewMode: (view: View, mode: ViewVisionMode) => void;
|
12
|
-
export declare const emitError: (error: Error) => void;
|
13
|
-
export declare const addEmitterOnceListener: (event: any, listener: any) => void;
|
14
|
-
export declare const notifyMainViewModeChange: import("lodash").DebouncedFunc<(callbacks: Emittery<PublicEvent>, mode: ViewVisionMode) => void>;
|
15
|
-
export declare const makeValidScenePath: (displayer: Displayer, scenePath: string, index?: number) => string | undefined;
|
16
|
-
export declare const entireScenes: (displayer: Displayer) => import("white-web-sdk").SceneMap;
|
17
|
-
export declare const putScenes: (room: Room | undefined, path: string, scenes: SceneDefinition[], index?: number | undefined) => void | undefined;
|
18
|
-
export declare const isValidScenePath: (scenePath: string) => boolean;
|
19
|
-
export declare const parseSceneDir: (scenePath: string) => string;
|
20
|
-
export declare const ensureValidScenePath: (scenePath: string) => string;
|
21
|
-
export declare const getVersionNumber: (version: string) => number;
|
22
|
-
export declare const wait: (time: number) => Promise<unknown>;
|
23
|
-
export declare const isRootDirPage: (scenePath: string) => boolean;
|
package/dist/Utils/Reactive.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
import { UpdateEventKind } from "white-web-sdk";
|
2
|
-
import type { AkkoObjectUpdatedListener } from "white-web-sdk";
|
3
|
-
export declare const onObjectByEvent: (event: UpdateEventKind) => (object: any, func: () => void) => (() => void) | undefined;
|
4
|
-
export declare const safeListenPropsUpdated: <T>(getProps: () => T, callback: AkkoObjectUpdatedListener<T>, onDestroyed?: ((props: unknown) => void) | undefined) => () => void;
|
5
|
-
export declare const onObjectRemoved: (object: any, func: () => void) => (() => void) | undefined;
|
6
|
-
export declare const onObjectInserted: (object: any, func: () => void) => (() => void) | undefined;
|
package/dist/Utils/error.d.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
export declare class AppCreateError extends Error {
|
2
|
-
message: string;
|
3
|
-
}
|
4
|
-
export declare class AppNotRegisterError extends Error {
|
5
|
-
constructor(kind: string);
|
6
|
-
}
|
7
|
-
export declare class AppManagerNotInitError extends Error {
|
8
|
-
message: string;
|
9
|
-
}
|
10
|
-
export declare class WhiteWebSDKInvalidError extends Error {
|
11
|
-
constructor(version: string);
|
12
|
-
}
|
13
|
-
export declare class ParamsInvalidError extends Error {
|
14
|
-
message: string;
|
15
|
-
}
|
16
|
-
export declare class BoxNotCreatedError extends Error {
|
17
|
-
message: string;
|
18
|
-
}
|
19
|
-
export declare class InvalidScenePath extends Error {
|
20
|
-
message: string;
|
21
|
-
}
|
22
|
-
export declare class BoxManagerNotFoundError extends Error {
|
23
|
-
message: string;
|
24
|
-
}
|
25
|
-
export declare class BindContainerRoomPhaseInvalidError extends Error {
|
26
|
-
message: string;
|
27
|
-
}
|
package/dist/Utils/log.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const log: (...args: any[]) => void;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import type { TeleBoxRect } from "@netless/telebox-insider";
|
2
|
-
import type { View } from "white-web-sdk";
|
3
|
-
import type { ICamera, ISize } from "../AttributesDelegate";
|
4
|
-
export declare type SaveCamera = (camera: ICamera) => void;
|
5
|
-
export declare class CameraSynchronizer {
|
6
|
-
protected saveCamera: SaveCamera;
|
7
|
-
remoteCamera?: ICamera;
|
8
|
-
remoteSize?: ISize;
|
9
|
-
protected rect?: TeleBoxRect;
|
10
|
-
protected view?: View;
|
11
|
-
constructor(saveCamera: SaveCamera);
|
12
|
-
setRect: (rect: TeleBoxRect) => void;
|
13
|
-
setView(view: View): void;
|
14
|
-
onRemoteUpdate: import("lodash").DebouncedFunc<(camera: ICamera, size: ISize) => void>;
|
15
|
-
onRemoteSizeUpdate(size: ISize): void;
|
16
|
-
onLocalCameraUpdate(camera: ICamera): void;
|
17
|
-
}
|
package/dist/View/MainView.d.ts
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
import { Val } from "value-enhancer";
|
2
|
-
import { ViewSync } from "./ViewSync";
|
3
|
-
import type { ICamera, ISize } from "../AttributesDelegate";
|
4
|
-
import type { Size, View } from "white-web-sdk";
|
5
|
-
import type { AppManager } from "../AppManager";
|
6
|
-
export declare class MainViewProxy {
|
7
|
-
private manager;
|
8
|
-
private started;
|
9
|
-
private mainViewIsAddListener;
|
10
|
-
private mainView;
|
11
|
-
private store;
|
12
|
-
private sideEffectManager;
|
13
|
-
camera$: Val<{
|
14
|
-
id: string;
|
15
|
-
centerX: number | null;
|
16
|
-
centerY: number | null;
|
17
|
-
scale: number;
|
18
|
-
} | undefined, any>;
|
19
|
-
size$: Val<ISize | undefined, any>;
|
20
|
-
view$: Val<View | undefined, any>;
|
21
|
-
viewSync?: ViewSync;
|
22
|
-
constructor(manager: AppManager);
|
23
|
-
createViewSync: () => void;
|
24
|
-
private startListenWritableChange;
|
25
|
-
ensureCameraAndSize(): void;
|
26
|
-
private get mainViewCamera();
|
27
|
-
private get mainViewSize();
|
28
|
-
private get didRelease();
|
29
|
-
start(): void;
|
30
|
-
addCameraReaction: () => void;
|
31
|
-
storeCurrentCamera: () => void;
|
32
|
-
storeCurrentSize: () => void;
|
33
|
-
storeCamera: (camera: ICamera) => void;
|
34
|
-
storeSize: (size: ISize) => void;
|
35
|
-
private cameraReaction;
|
36
|
-
private sizeReaction;
|
37
|
-
get view(): View;
|
38
|
-
get cameraState(): {
|
39
|
-
width: number;
|
40
|
-
height: number;
|
41
|
-
centerX: number;
|
42
|
-
centerY: number;
|
43
|
-
scale: number;
|
44
|
-
};
|
45
|
-
createMainView(): View;
|
46
|
-
onReconnect(): void;
|
47
|
-
setFocusScenePath(path: string | undefined): View | undefined;
|
48
|
-
rebind(): void;
|
49
|
-
addMainViewListener(): void;
|
50
|
-
removeMainViewListener(): void;
|
51
|
-
private mainViewClickListener;
|
52
|
-
mainViewClickHandler(): Promise<void>;
|
53
|
-
setMainViewSize: import("lodash").DebouncedFunc<(size: Size) => void>;
|
54
|
-
private addCameraListener;
|
55
|
-
private removeCameraListener;
|
56
|
-
private onCameraOrSizeUpdated;
|
57
|
-
stop(): void;
|
58
|
-
destroy(): void;
|
59
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { View, Displayer } from "white-web-sdk";
|
2
|
-
export declare class ViewManager {
|
3
|
-
private displayer;
|
4
|
-
views: Map<string, View>;
|
5
|
-
constructor(displayer: Displayer);
|
6
|
-
createView(id: string): View;
|
7
|
-
getView(id: string): View | undefined;
|
8
|
-
destroyView(id: string): void;
|
9
|
-
setViewScenePath(id: string, scenePath: string): void;
|
10
|
-
destroy(): void;
|
11
|
-
}
|
12
|
-
export declare const createView: (displayer: Displayer) => View;
|
13
|
-
export declare const setDefaultCameraBound: (view: View) => void;
|
package/dist/View/ViewSync.d.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import { ViewMode } from "white-web-sdk";
|
2
|
-
import type { View } from "white-web-sdk";
|
3
|
-
import type { Val, ReadonlyVal } from "value-enhancer";
|
4
|
-
import type { ICamera, ISize } from "../AttributesDelegate";
|
5
|
-
import type { TeleBoxRect } from "@netless/telebox-insider";
|
6
|
-
export declare type ViewSyncContext = {
|
7
|
-
uid: string;
|
8
|
-
camera$: Val<ICamera | undefined, boolean>;
|
9
|
-
size$: Val<ISize | undefined>;
|
10
|
-
stageRect$: ReadonlyVal<TeleBoxRect>;
|
11
|
-
viewMode$?: Val<ViewMode>;
|
12
|
-
storeCamera: (camera: ICamera) => void;
|
13
|
-
storeSize: (size: ISize) => void;
|
14
|
-
view$: Val<View | undefined>;
|
15
|
-
};
|
16
|
-
export declare class ViewSync {
|
17
|
-
private context;
|
18
|
-
private sem;
|
19
|
-
private synchronizer;
|
20
|
-
constructor(context: ViewSyncContext);
|
21
|
-
bindView: (view?: View | undefined) => void;
|
22
|
-
private onCameraUpdatedByDevice;
|
23
|
-
destroy(): void;
|
24
|
-
}
|
package/dist/callback.d.ts
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
import Emittery from "emittery";
|
2
|
-
import type { TeleBoxColorScheme, TELE_BOX_STATE } from "@netless/telebox-insider";
|
3
|
-
import type { CameraState, SceneState, ViewVisionMode } from "white-web-sdk";
|
4
|
-
import type { LoadAppEvent } from "./Register";
|
5
|
-
import type { PageState } from "./Page";
|
6
|
-
export declare type PublicEvent = {
|
7
|
-
mainViewModeChange: ViewVisionMode;
|
8
|
-
boxStateChange: `${TELE_BOX_STATE}`;
|
9
|
-
darkModeChange: boolean;
|
10
|
-
prefersColorSchemeChange: TeleBoxColorScheme;
|
11
|
-
cameraStateChange: CameraState;
|
12
|
-
mainViewScenePathChange: string;
|
13
|
-
mainViewSceneIndexChange: number;
|
14
|
-
focusedChange: string | undefined;
|
15
|
-
mainViewScenesLengthChange: number;
|
16
|
-
canRedoStepsChange: number;
|
17
|
-
canUndoStepsChange: number;
|
18
|
-
loadApp: LoadAppEvent;
|
19
|
-
ready: undefined;
|
20
|
-
sceneStateChange: SceneState;
|
21
|
-
pageStateChange: PageState;
|
22
|
-
appClose: {
|
23
|
-
appId: string;
|
24
|
-
kind: string;
|
25
|
-
error?: Error;
|
26
|
-
};
|
27
|
-
};
|
28
|
-
export declare type CallbacksType = Emittery<PublicEvent>;
|
29
|
-
export declare const callbacks: CallbacksType;
|
package/dist/constants.d.ts
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
export declare enum Events {
|
2
|
-
AppMove = "AppMove",
|
3
|
-
AppFocus = "AppFocus",
|
4
|
-
AppResize = "AppResize",
|
5
|
-
AppBoxStateChange = "AppBoxStateChange",
|
6
|
-
GetAttributes = "GetAttributes",
|
7
|
-
UpdateWindowManagerWrapper = "UpdateWindowManagerWrapper",
|
8
|
-
WindowCreated = "WindowCreated",
|
9
|
-
SetMainViewScenePath = "SetMainViewScenePath",
|
10
|
-
SetMainViewSceneIndex = "SetMainViewSceneIndex",
|
11
|
-
SetAppFocusIndex = "SetAppFocusIndex",
|
12
|
-
SwitchViewsToFreedom = "SwitchViewsToFreedom",
|
13
|
-
CursorMove = "CursorMove",
|
14
|
-
RootDirRemoved = "RootDirRemoved",
|
15
|
-
Refresh = "Refresh",
|
16
|
-
InitMainViewCamera = "InitMainViewCamera"
|
17
|
-
}
|
18
|
-
export declare const MagixEventName = "__WindowManger";
|
19
|
-
export declare const EnsureReconnectEvent = "__WindowMangerEnsureReconnected__";
|
20
|
-
export declare enum AppAttributes {
|
21
|
-
Size = "size",
|
22
|
-
Position = "position",
|
23
|
-
SceneIndex = "SceneIndex",
|
24
|
-
ZIndex = "zIndex",
|
25
|
-
Visible = "visible",
|
26
|
-
Ratio = "ratio",
|
27
|
-
StageRatio = "stageRatio",
|
28
|
-
Draggable = "draggable",
|
29
|
-
Resizable = "resizable"
|
30
|
-
}
|
31
|
-
export declare enum AppEvents {
|
32
|
-
setBoxSize = "setBoxSize",
|
33
|
-
setBoxMinSize = "setBoxMinSize",
|
34
|
-
destroy = "destroy"
|
35
|
-
}
|
36
|
-
export declare enum AppStatus {
|
37
|
-
StartCreate = "StartCreate"
|
38
|
-
}
|
39
|
-
export declare enum CursorState {
|
40
|
-
Leave = "leave",
|
41
|
-
Normal = "normal"
|
42
|
-
}
|
43
|
-
export declare const REQUIRE_VERSION = "2.16.1";
|
44
|
-
export declare const MIN_WIDTH: number;
|
45
|
-
export declare const MIN_HEIGHT: number;
|
46
|
-
export declare const SET_SCENEPATH_DELAY = 100;
|
47
|
-
export declare const DEFAULT_CONTAINER_RATIO: number;
|
48
|
-
export declare const ROOT_DIR = "/";
|
49
|
-
export declare const INIT_DIR = "/init";
|
50
|
-
export declare const SETUP_APP_DELAY = 50;
|
51
|
-
export declare const MAX_PAGE_SIZE = 500;
|
package/dist/index.d.ts
DELETED
@@ -1,270 +0,0 @@
|
|
1
|
-
import { AppManager } from "./AppManager";
|
2
|
-
import { CursorManager } from "./Cursor";
|
3
|
-
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
4
|
-
import { ReconnectRefresher } from "./ReconnectRefresher";
|
5
|
-
import "video.js/dist/video-js.css";
|
6
|
-
import "./style.css";
|
7
|
-
import "@netless/telebox-insider/dist/style.css";
|
8
|
-
import { Val } from "value-enhancer";
|
9
|
-
import type { TELE_BOX_STATE } from "./BoxManager";
|
10
|
-
import type { Apps, Position, ICamera, ISize } from "./AttributesDelegate";
|
11
|
-
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, CameraBound, Point, CameraState, Player, ImageInformation, SceneState, Rectangle } from "white-web-sdk";
|
12
|
-
import type { AppListeners } from "./AppListener";
|
13
|
-
import type { ApplianceIcons, NetlessApp, RegisterParams } from "./typings";
|
14
|
-
import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider";
|
15
|
-
import type { AppProxy } from "./App";
|
16
|
-
import type { PublicEvent } from "./callback";
|
17
|
-
import type Emittery from "emittery";
|
18
|
-
import type { PageController, AddPageParams, PageState } from "./Page";
|
19
|
-
export declare type WindowMangerAttributes = {
|
20
|
-
modelValue?: string;
|
21
|
-
boxState: TELE_BOX_STATE;
|
22
|
-
maximized?: boolean;
|
23
|
-
minimized?: boolean;
|
24
|
-
[key: string]: any;
|
25
|
-
};
|
26
|
-
export declare type apps = {
|
27
|
-
[key: string]: NetlessApp;
|
28
|
-
};
|
29
|
-
export declare type AddAppOptions = {
|
30
|
-
scenePath?: string;
|
31
|
-
title?: string;
|
32
|
-
scenes?: SceneDefinition[];
|
33
|
-
};
|
34
|
-
export declare type setAppOptions = AddAppOptions & {
|
35
|
-
appOptions?: any;
|
36
|
-
};
|
37
|
-
export declare type AddAppParams<TAttributes = any> = {
|
38
|
-
kind: string;
|
39
|
-
src?: string;
|
40
|
-
options?: AddAppOptions;
|
41
|
-
attributes?: TAttributes;
|
42
|
-
};
|
43
|
-
export declare type BaseInsertParams = {
|
44
|
-
kind: string;
|
45
|
-
src?: string;
|
46
|
-
options?: AddAppOptions;
|
47
|
-
attributes?: any;
|
48
|
-
isDynamicPPT?: boolean;
|
49
|
-
};
|
50
|
-
export declare type AppSyncAttributes = {
|
51
|
-
kind: string;
|
52
|
-
src?: string;
|
53
|
-
options: any;
|
54
|
-
state?: any;
|
55
|
-
isDynamicPPT?: boolean;
|
56
|
-
fullPath?: string;
|
57
|
-
createdAt?: number;
|
58
|
-
camera?: ICamera;
|
59
|
-
size?: ISize;
|
60
|
-
};
|
61
|
-
export declare type AppInitState = {
|
62
|
-
id: string;
|
63
|
-
x?: number;
|
64
|
-
y?: number;
|
65
|
-
width?: number;
|
66
|
-
height?: number;
|
67
|
-
focus?: boolean;
|
68
|
-
maximized?: boolean;
|
69
|
-
minimized?: boolean;
|
70
|
-
sceneIndex?: number;
|
71
|
-
boxState?: TeleBoxState;
|
72
|
-
zIndex?: number;
|
73
|
-
visible?: boolean;
|
74
|
-
stageRatio?: number;
|
75
|
-
resizable?: boolean;
|
76
|
-
draggable?: boolean;
|
77
|
-
ratio?: number;
|
78
|
-
};
|
79
|
-
export declare type CursorMovePayload = {
|
80
|
-
uid: string;
|
81
|
-
state?: "leave";
|
82
|
-
position: Position;
|
83
|
-
};
|
84
|
-
export declare type MountParams = {
|
85
|
-
room: Room | Player;
|
86
|
-
container?: HTMLElement;
|
87
|
-
/** 白板高宽比例, 默认为 9 / 16 */
|
88
|
-
containerSizeRatio?: number;
|
89
|
-
/** @deprecated */
|
90
|
-
chessboard?: boolean;
|
91
|
-
/** 是否高亮显示同步区域, 默认为 true */
|
92
|
-
highlightStage?: boolean;
|
93
|
-
collectorContainer?: HTMLElement;
|
94
|
-
collectorStyles?: Partial<CSSStyleDeclaration>;
|
95
|
-
overwriteStyles?: string;
|
96
|
-
containerStyle?: string;
|
97
|
-
stageStyle?: string;
|
98
|
-
cursor?: boolean;
|
99
|
-
debug?: boolean;
|
100
|
-
disableCameraTransform?: boolean;
|
101
|
-
prefersColorScheme?: TeleBoxColorScheme;
|
102
|
-
applianceIcons?: ApplianceIcons;
|
103
|
-
};
|
104
|
-
export declare const reconnectRefresher: ReconnectRefresher;
|
105
|
-
export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes> implements PageController {
|
106
|
-
static kind: string;
|
107
|
-
static displayer: Displayer;
|
108
|
-
static playground?: HTMLElement;
|
109
|
-
static container?: HTMLElement;
|
110
|
-
static debug: boolean;
|
111
|
-
static containerSizeRatio: number;
|
112
|
-
private static isCreated;
|
113
|
-
version: string;
|
114
|
-
dependencies: Record<string, string>;
|
115
|
-
appListeners?: AppListeners;
|
116
|
-
readonly?: boolean;
|
117
|
-
emitter: Emittery<PublicEvent>;
|
118
|
-
appManager?: AppManager;
|
119
|
-
cursorManager?: CursorManager;
|
120
|
-
viewMode: ViewMode;
|
121
|
-
viewMode$: Val<ViewMode, any>;
|
122
|
-
isReplay: boolean;
|
123
|
-
private _pageState?;
|
124
|
-
private boxManager?;
|
125
|
-
private static params?;
|
126
|
-
containerSizeRatio: number;
|
127
|
-
constructor(context: InvisiblePluginContext);
|
128
|
-
static mount(params: MountParams): Promise<WindowManager>;
|
129
|
-
private static initManager;
|
130
|
-
private static initContainer;
|
131
|
-
static get registered(): Map<string, RegisterParams<any, any, any>>;
|
132
|
-
bindContainer(container: HTMLElement): void;
|
133
|
-
bindCollectorContainer(container: HTMLElement): void;
|
134
|
-
/**
|
135
|
-
* 注册插件
|
136
|
-
*/
|
137
|
-
static register<AppOptions = any, SetupResult = any, Attributes = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
|
138
|
-
/**
|
139
|
-
* 注销插件
|
140
|
-
*/
|
141
|
-
static unregister(kind: string): void;
|
142
|
-
/**
|
143
|
-
* 创建一个 app 至白板
|
144
|
-
*/
|
145
|
-
addApp<T = any>(params: AddAppParams<T>): Promise<string | undefined>;
|
146
|
-
private _addApp;
|
147
|
-
private setupScenePath;
|
148
|
-
/**
|
149
|
-
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
150
|
-
*/
|
151
|
-
setMainViewScenePath(scenePath: string): Promise<void>;
|
152
|
-
/**
|
153
|
-
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
154
|
-
*/
|
155
|
-
setMainViewSceneIndex(index: number): Promise<void>;
|
156
|
-
nextPage(): Promise<boolean>;
|
157
|
-
prevPage(): Promise<boolean>;
|
158
|
-
jumpPage(index: number): Promise<boolean>;
|
159
|
-
addPage(params?: AddPageParams): Promise<void>;
|
160
|
-
/**
|
161
|
-
* 删除一页
|
162
|
-
* 默认删除当前页, 可以删除指定 index 页
|
163
|
-
* 最低保留一页
|
164
|
-
*/
|
165
|
-
removePage(index?: number): Promise<boolean>;
|
166
|
-
/**
|
167
|
-
* 返回 mainView 的 ScenePath
|
168
|
-
*/
|
169
|
-
getMainViewScenePath(): string | undefined;
|
170
|
-
/**
|
171
|
-
* 返回 mainView 的 SceneIndex
|
172
|
-
*/
|
173
|
-
getMainViewSceneIndex(): number;
|
174
|
-
/**
|
175
|
-
* 设置所有 app 的 readonly 模式
|
176
|
-
*/
|
177
|
-
setReadonly(readonly: boolean): void;
|
178
|
-
/**
|
179
|
-
* 切换 mainView 为可写
|
180
|
-
*/
|
181
|
-
switchMainViewToWriter(): Promise<void> | undefined;
|
182
|
-
/**
|
183
|
-
* app destroy 回调
|
184
|
-
*/
|
185
|
-
onAppDestroy(kind: string, listener: (error: Error) => void): void;
|
186
|
-
/**
|
187
|
-
* 设置 ViewMode
|
188
|
-
*/
|
189
|
-
setViewMode(mode: ViewMode): void;
|
190
|
-
setBoxState(boxState: TeleBoxState): void;
|
191
|
-
setMaximized(maximized: boolean): void;
|
192
|
-
setMinimized(minimized: boolean): void;
|
193
|
-
get mainView(): View;
|
194
|
-
get camera(): Camera;
|
195
|
-
get baseCamera$(): Val<{
|
196
|
-
id: string;
|
197
|
-
centerX: number | null;
|
198
|
-
centerY: number | null;
|
199
|
-
scale: number;
|
200
|
-
} | undefined, any>;
|
201
|
-
get baseSize$(): Val<ISize | undefined, any>;
|
202
|
-
get cameraState(): CameraState;
|
203
|
-
get apps(): Apps | undefined;
|
204
|
-
get boxState(): TeleBoxState | undefined;
|
205
|
-
get darkMode(): boolean;
|
206
|
-
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
207
|
-
get focused(): string | undefined;
|
208
|
-
get focusedView(): View | undefined;
|
209
|
-
get mainViewSceneIndex(): number;
|
210
|
-
get mainViewSceneDir(): string;
|
211
|
-
get topApp(): string | undefined;
|
212
|
-
get mainViewScenesLength(): number;
|
213
|
-
get canRedoSteps(): number;
|
214
|
-
get canUndoSteps(): number;
|
215
|
-
get sceneState(): SceneState;
|
216
|
-
get pageState(): PageState;
|
217
|
-
/**
|
218
|
-
* 查询所有的 App
|
219
|
-
*/
|
220
|
-
queryAll(): AppProxy[];
|
221
|
-
/**
|
222
|
-
* 查询单个 App
|
223
|
-
*/
|
224
|
-
queryOne(appId: string): AppProxy | undefined;
|
225
|
-
/**
|
226
|
-
* 关闭 APP
|
227
|
-
*/
|
228
|
-
closeApp(appId: string): Promise<void>;
|
229
|
-
moveCamera(camera: Partial<Camera>): void;
|
230
|
-
moveCameraToContain(rectangle: Rectangle): void;
|
231
|
-
convertToPointInWorld(point: Point): Point;
|
232
|
-
setCameraBound(cameraBound: CameraBound): void;
|
233
|
-
onDestroy(): void;
|
234
|
-
destroy(): void;
|
235
|
-
private _destroy;
|
236
|
-
private bindMainView;
|
237
|
-
get canOperate(): boolean;
|
238
|
-
get room(): Room;
|
239
|
-
safeSetAttributes(attributes: any): void;
|
240
|
-
safeUpdateAttributes(keys: string[], value: any): void;
|
241
|
-
setPrefersColorScheme(scheme: TeleBoxColorScheme): void;
|
242
|
-
cleanCurrentScene(): void;
|
243
|
-
redo(): number;
|
244
|
-
undo(): number;
|
245
|
-
delete(): void;
|
246
|
-
copy(): void;
|
247
|
-
paste(): void;
|
248
|
-
duplicate(): void;
|
249
|
-
insertText(x: number, y: number, text: string | undefined): string;
|
250
|
-
insertImage(info: ImageInformation): void;
|
251
|
-
completeImageUpload(uuid: string, url: string): void;
|
252
|
-
lockImage(uuid: string, locked: boolean): void;
|
253
|
-
lockImages(locked: boolean): void;
|
254
|
-
refresh(): void;
|
255
|
-
/** @inner */
|
256
|
-
_refresh(): void;
|
257
|
-
setContainerSizeRatio(ratio: number): void;
|
258
|
-
setContainerStyle(style: string): void;
|
259
|
-
setStageStyle(style: string): void;
|
260
|
-
createPPTHandler(): {
|
261
|
-
onPageJumpTo: (_pptUUID: string, index: number) => void;
|
262
|
-
onPageToNext: () => void;
|
263
|
-
onPageToPrev: () => void;
|
264
|
-
};
|
265
|
-
private isDynamicPPT;
|
266
|
-
private ensureAttributes;
|
267
|
-
}
|
268
|
-
export * from "./typings";
|
269
|
-
export { BuiltinApps, BuiltinAppsMap } from "./BuiltinApps";
|
270
|
-
export type { PublicEvent } from "./callback";
|