@netless/window-manager 0.4.0-canary.1 → 0.4.0-canary.10
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/App/Storage/StorageEvent.d.ts +8 -0
- package/dist/App/Storage/index.d.ts +26 -0
- package/dist/App/Storage/typings.d.ts +21 -0
- package/dist/App/Storage/utils.d.ts +5 -0
- package/dist/AppContext.d.ts +3 -1
- package/dist/AppListener.d.ts +0 -1
- package/dist/AppManager.d.ts +7 -7
- package/dist/AppProxy.d.ts +2 -3
- package/dist/Base/Context.d.ts +0 -1
- package/dist/BoxManager.d.ts +2 -1
- package/dist/BuiltinApps.d.ts +6 -0
- package/dist/ContainerResizeObserver.d.ts +10 -0
- package/dist/Cursor/Cursor.d.ts +2 -3
- package/dist/Cursor/index.d.ts +7 -4
- package/dist/Helper.d.ts +6 -0
- package/dist/ReconnectRefresher.d.ts +5 -2
- package/dist/Utils/Common.d.ts +3 -1
- package/dist/Utils/Reactive.d.ts +1 -1
- package/dist/{MainView.d.ts → View/MainView.d.ts} +2 -4
- package/dist/View/ViewManager.d.ts +13 -0
- package/dist/constants.d.ts +1 -6
- package/dist/index.d.ts +13 -13
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/typings.d.ts +1 -0
- package/package.json +5 -4
- package/src/App/Storage/StorageEvent.ts +21 -0
- package/src/App/Storage/index.ts +243 -0
- package/src/App/Storage/typings.ts +21 -0
- package/src/App/Storage/utils.ts +17 -0
- package/src/AppContext.ts +10 -2
- package/src/AppListener.ts +1 -8
- package/src/AppManager.ts +54 -35
- package/src/AppProxy.ts +14 -36
- package/src/Base/Context.ts +0 -4
- package/src/BoxManager.ts +9 -7
- package/src/BuiltinApps.ts +24 -0
- package/src/ContainerResizeObserver.ts +62 -0
- package/src/Cursor/Cursor.ts +23 -34
- package/src/Cursor/index.ts +70 -41
- package/src/Helper.ts +30 -0
- package/src/ReconnectRefresher.ts +13 -5
- package/src/Utils/Common.ts +35 -13
- package/src/Utils/Reactive.ts +9 -3
- package/src/Utils/RoomHacker.ts +15 -0
- package/src/{MainView.ts → View/MainView.ts} +9 -25
- package/src/View/ViewManager.ts +53 -0
- package/src/constants.ts +1 -3
- package/src/index.ts +46 -86
- package/src/shim.d.ts +4 -0
- package/src/style.css +6 -0
- package/src/typings.ts +1 -0
- package/vite.config.js +4 -1
- package/dist/Utils/CameraStore.d.ts +0 -15
- package/dist/ViewManager.d.ts +0 -29
- package/dist/sdk.d.ts +0 -14
- package/src/Utils/CameraStore.ts +0 -72
- package/src/sdk.ts +0 -39
- package/src/viewManager.ts +0 -177
@@ -0,0 +1,8 @@
|
|
1
|
+
export declare type StorageEventListener<T> = (event: T) => void;
|
2
|
+
export declare class StorageEvent<TMessage> {
|
3
|
+
listeners: Set<StorageEventListener<TMessage>>;
|
4
|
+
get length(): number;
|
5
|
+
dispatch(message: TMessage): void;
|
6
|
+
addListener(listener: StorageEventListener<TMessage>): void;
|
7
|
+
removeListener(listener: StorageEventListener<TMessage>): void;
|
8
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { AppContext } from "../../AppContext";
|
2
|
+
import type { Diff } from "./typings";
|
3
|
+
import { StorageEvent } from "./StorageEvent";
|
4
|
+
export * from './typings';
|
5
|
+
export declare class Storage<TState = any> implements Storage<TState> {
|
6
|
+
readonly id: string;
|
7
|
+
private readonly _context;
|
8
|
+
private readonly _sideEffect;
|
9
|
+
private _state;
|
10
|
+
private _destroyed;
|
11
|
+
private _refMap;
|
12
|
+
/**
|
13
|
+
* `setState` alters local state immediately before sending to server. This will cache the old value for onStateChanged diffing.
|
14
|
+
*/
|
15
|
+
private _lastValue;
|
16
|
+
constructor(context: AppContext<any>, id: string, defaultState?: TState);
|
17
|
+
get state(): Readonly<TState>;
|
18
|
+
readonly onStateChanged: StorageEvent<Diff<TState>>;
|
19
|
+
ensureState(state: Partial<TState>): void;
|
20
|
+
setState(state: Partial<TState>): void;
|
21
|
+
emptyStore(): void;
|
22
|
+
deleteStore(): void;
|
23
|
+
get destroyed(): boolean;
|
24
|
+
destroy(): void;
|
25
|
+
private _updateProperties;
|
26
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { StorageEventListener } from "./StorageEvent";
|
2
|
+
export declare type RefValue<TValue = any> = {
|
3
|
+
k: string;
|
4
|
+
v: TValue;
|
5
|
+
__isRef: true;
|
6
|
+
};
|
7
|
+
export declare type ExtractRawValue<TValue> = TValue extends RefValue<infer TRefValue> ? TRefValue : TValue;
|
8
|
+
export declare type AutoRefValue<TValue> = RefValue<ExtractRawValue<TValue>>;
|
9
|
+
export declare type MaybeRefValue<TValue> = TValue | AutoRefValue<TValue>;
|
10
|
+
export declare type DiffOne<T> = {
|
11
|
+
oldValue?: T;
|
12
|
+
newValue?: T;
|
13
|
+
};
|
14
|
+
export declare type Diff<T> = {
|
15
|
+
[K in keyof T]?: DiffOne<T[K]>;
|
16
|
+
};
|
17
|
+
export declare type StorageOnSetStatePayload<TState = unknown> = {
|
18
|
+
[K in keyof TState]?: MaybeRefValue<TState[K]>;
|
19
|
+
};
|
20
|
+
export declare type StorageStateChangedEvent<TState = any> = Diff<TState>;
|
21
|
+
export declare type StorageStateChangedListener<TState = any> = StorageEventListener<StorageStateChangedEvent<TState>>;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { AutoRefValue, RefValue } from "./typings";
|
2
|
+
export declare const plainObjectKeys: <T>(o: T) => Extract<keyof T, string>[];
|
3
|
+
export declare function isRef<TValue = unknown>(e: unknown): e is RefValue<TValue>;
|
4
|
+
export declare function makeRef<TValue>(v: TValue): RefValue<TValue>;
|
5
|
+
export declare function makeAutoRef<TValue>(v: TValue): AutoRefValue<TValue>;
|
package/dist/AppContext.d.ts
CHANGED
@@ -6,7 +6,8 @@ import type { BoxManager } from "./BoxManager";
|
|
6
6
|
import type { AppEmitterEvent } from "./index";
|
7
7
|
import type { AppManager } from "./AppManager";
|
8
8
|
import type { AppProxy } from "./AppProxy";
|
9
|
-
|
9
|
+
import { Storage } from './App/Storage';
|
10
|
+
export declare class AppContext<TAttrs extends Record<string, any> = any, AppOptions = any> {
|
10
11
|
private manager;
|
11
12
|
private boxManager;
|
12
13
|
appId: string;
|
@@ -41,4 +42,5 @@ export declare class AppContext<TAttrs extends Record<string, any>, AppOptions =
|
|
41
42
|
setScenePath(scenePath: string): Promise<void>;
|
42
43
|
mountView(dom: HTMLDivElement): void;
|
43
44
|
getAppOptions(): AppOptions | undefined;
|
45
|
+
createStorage<TState>(storeId: string, defaultState?: TState): Storage<TState>;
|
44
46
|
}
|
package/dist/AppListener.d.ts
CHANGED
@@ -9,7 +9,6 @@ export declare class AppListeners {
|
|
9
9
|
private mainMagixEventListener;
|
10
10
|
private appMoveHandler;
|
11
11
|
private appResizeHandler;
|
12
|
-
private switchViewsToFreedomHandler;
|
13
12
|
private boxStateChangeHandler;
|
14
13
|
private setMainViewScenePathHandler;
|
15
14
|
private moveCameraToContainHandler;
|
package/dist/AppManager.d.ts
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
import { AppStatus, Events } from "./constants";
|
2
2
|
import { AppProxy } from "./AppProxy";
|
3
3
|
import { WindowManager } from "./index";
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { ReconnectRefresher } from "./ReconnectRefresher";
|
7
|
-
import { ViewManager } from "./ViewManager";
|
4
|
+
import { MainViewProxy } from "./View/MainView";
|
5
|
+
import { ViewManager } from "./View/ViewManager";
|
6
|
+
import type { ReconnectRefresher } from "./ReconnectRefresher";
|
8
7
|
import type { BoxManager } from "./BoxManager";
|
9
8
|
import type { Displayer, Room } from "white-web-sdk";
|
10
9
|
import type { AddAppParams, TeleBoxRect } from "./index";
|
11
10
|
export declare class AppManager {
|
12
11
|
windowManger: WindowManager;
|
13
12
|
displayer: Displayer;
|
14
|
-
cameraStore: CameraStore;
|
15
13
|
viewManager: ViewManager;
|
16
14
|
appProxies: Map<string, AppProxy>;
|
17
15
|
appStatus: Map<string, AppStatus>;
|
@@ -21,6 +19,7 @@ export declare class AppManager {
|
|
21
19
|
isReplay: boolean;
|
22
20
|
private appListeners;
|
23
21
|
boxManager?: BoxManager;
|
22
|
+
private _prevSceneIndex;
|
24
23
|
constructor(windowManger: WindowManager);
|
25
24
|
private onCreated;
|
26
25
|
/**
|
@@ -36,13 +35,14 @@ export declare class AppManager {
|
|
36
35
|
resetMinimized(): void;
|
37
36
|
private onAppDelete;
|
38
37
|
bindMainView(divElement: HTMLDivElement, disableCameraTransform: boolean): void;
|
38
|
+
setMainViewFocusPath(): void;
|
39
39
|
addApp(params: AddAppParams, isDynamicPPT: boolean): Promise<string | undefined>;
|
40
40
|
private beforeAddApp;
|
41
41
|
private afterAddApp;
|
42
42
|
closeApp(appId: string): Promise<void>;
|
43
43
|
private baseInsertApp;
|
44
44
|
private displayerStateListener;
|
45
|
-
|
45
|
+
displayerWritableListener: (isReadonly: boolean) => void;
|
46
46
|
private get eventName();
|
47
47
|
get attributes(): import("./index").WindowMangerAttributes;
|
48
48
|
get canOperate(): boolean;
|
@@ -58,7 +58,7 @@ export declare class AppManager {
|
|
58
58
|
safeDispatchMagixEvent(event: string, payload: any): void;
|
59
59
|
private boxEventListener;
|
60
60
|
focusByAttributes(apps: any): void;
|
61
|
-
|
61
|
+
onReconnected(): Promise<void>;
|
62
62
|
notifyContainerRectUpdate(rect: TeleBoxRect): void;
|
63
63
|
dispatchInternalEvent(event: Events, payload: any): void;
|
64
64
|
destroy(): void;
|
package/dist/AppProxy.d.ts
CHANGED
@@ -15,7 +15,6 @@ export declare class AppProxy extends Base {
|
|
15
15
|
private boxManager;
|
16
16
|
private appProxies;
|
17
17
|
private viewManager;
|
18
|
-
private cameraStore;
|
19
18
|
private kind;
|
20
19
|
isAddApp: boolean;
|
21
20
|
private status;
|
@@ -29,8 +28,9 @@ export declare class AppProxy extends Base {
|
|
29
28
|
get attributes(): any;
|
30
29
|
get appAttributes(): import("./index").AppSyncAttributes;
|
31
30
|
getFullScenePath(): string | undefined;
|
31
|
+
private getFullScenePathFromScenes;
|
32
32
|
setFullPath(path: string): void;
|
33
|
-
baseInsertApp(skipUpdate?: boolean
|
33
|
+
baseInsertApp(skipUpdate?: boolean): Promise<{
|
34
34
|
appId: string;
|
35
35
|
app: NetlessApp;
|
36
36
|
}>;
|
@@ -42,7 +42,6 @@ export declare class AppProxy extends Base {
|
|
42
42
|
private afterSetupApp;
|
43
43
|
onSeek(time: number): void;
|
44
44
|
onReconnected(): Promise<void>;
|
45
|
-
switchToWritable(): void;
|
46
45
|
getAppInitState: (id: string) => AppInitState | undefined;
|
47
46
|
emitAppSceneStateChange(sceneState: SceneState): void;
|
48
47
|
emitAppIsWritableChange(): void;
|
package/dist/Base/Context.d.ts
CHANGED
@@ -8,6 +8,5 @@ export declare class Context {
|
|
8
8
|
findMemberByUid: (uid: string) => import("white-web-sdk").RoomMember | undefined;
|
9
9
|
updateManagerRect(): void;
|
10
10
|
blurFocusBox(): void;
|
11
|
-
switchAppToWriter(id: string): void;
|
12
11
|
}
|
13
12
|
export declare const createContext: (manager: AppManager) => Context;
|
package/dist/BoxManager.d.ts
CHANGED
@@ -56,9 +56,10 @@ export declare class BoxManager {
|
|
56
56
|
private createTeleBoxManagerConfig?;
|
57
57
|
teleBoxManager: TeleBoxManager;
|
58
58
|
constructor(context: BoxManagerContext, createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig | undefined);
|
59
|
+
private playgroundSizeChangeListener;
|
59
60
|
private get mainView();
|
60
61
|
private get canOperate();
|
61
|
-
get boxState(): "
|
62
|
+
get boxState(): "minimized" | "maximized" | "normal";
|
62
63
|
get maximized(): boolean;
|
63
64
|
get minimized(): boolean;
|
64
65
|
get darkMode(): boolean;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { EmitterType } from "./index";
|
2
|
+
export declare class ContainerResizeObserver {
|
3
|
+
private emitter;
|
4
|
+
private containerResizeObserver?;
|
5
|
+
constructor(emitter: EmitterType);
|
6
|
+
static create(container: HTMLElement, sizer: HTMLElement, wrapper: HTMLDivElement, emitter: EmitterType): ContainerResizeObserver;
|
7
|
+
observePlaygroundSize(container: HTMLElement, sizer: HTMLElement, wrapper: HTMLDivElement): void;
|
8
|
+
private updateSizer;
|
9
|
+
disconnect(): void;
|
10
|
+
}
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -13,11 +13,10 @@ export declare class Cursor extends Base {
|
|
13
13
|
private cursorManager;
|
14
14
|
private wrapper?;
|
15
15
|
private member?;
|
16
|
-
private disposer;
|
17
16
|
private timer?;
|
18
17
|
private component?;
|
19
|
-
constructor(manager: AppManager, cursors: any, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
20
|
-
private
|
18
|
+
constructor(manager: AppManager, addCursorChangeListener: (uid: string, callback: (position: Position, state: CursorState) => void) => void, cursors: any, memberId: string, cursorManager: CursorManager, wrapper?: HTMLElement | undefined);
|
19
|
+
private onCursorChange;
|
21
20
|
private moveCursor;
|
22
21
|
get memberApplianceName(): ApplianceNames | undefined;
|
23
22
|
get memberColor(): string;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import { Base } from
|
2
|
-
import { Cursor } from
|
3
|
-
import
|
1
|
+
import { Base } from "../Base";
|
2
|
+
import { Cursor } from "./Cursor";
|
3
|
+
import { CursorState } from "../constants";
|
4
|
+
import type { PositionType, Position } from "../AttributesDelegate";
|
4
5
|
import type { RoomMember, View } from "white-web-sdk";
|
5
6
|
import type { AppManager } from "../AppManager";
|
6
7
|
export declare type EventType = {
|
@@ -19,6 +20,7 @@ export declare class CursorManager extends Base {
|
|
19
20
|
cursorInstances: Map<string, Cursor>;
|
20
21
|
roomMembers?: readonly RoomMember[];
|
21
22
|
private mainViewElement?;
|
23
|
+
private sideEffectManager;
|
22
24
|
constructor(appManager: AppManager);
|
23
25
|
setupWrapper(wrapper: HTMLElement): void;
|
24
26
|
setMainViewDivElement(div: HTMLDivElement): void;
|
@@ -29,7 +31,6 @@ export declare class CursorManager extends Base {
|
|
29
31
|
get boxState(): any;
|
30
32
|
get focusView(): View | undefined;
|
31
33
|
private mouseMoveListener;
|
32
|
-
private touchMoveListener;
|
33
34
|
private updateCursor;
|
34
35
|
private getPoint;
|
35
36
|
/**
|
@@ -44,5 +45,7 @@ export declare class CursorManager extends Base {
|
|
44
45
|
deleteCursor(uid: string): void;
|
45
46
|
hideCursor(uid: string): void;
|
46
47
|
cleanMemberAttributes(members: readonly RoomMember[]): void;
|
48
|
+
onReconnect(): void;
|
49
|
+
addCursorChangeListener: (uid: string, callback: (position: Position, state: CursorState) => void) => void;
|
47
50
|
destroy(): void;
|
48
51
|
}
|
package/dist/Helper.d.ts
ADDED
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Room } from "white-web-sdk";
|
2
|
+
import type { EmitterType } from "./index";
|
2
3
|
export declare type ReconnectRefresherContext = {
|
3
|
-
|
4
|
+
emitter: EmitterType;
|
4
5
|
};
|
5
6
|
export declare class ReconnectRefresher {
|
6
7
|
private ctx;
|
@@ -8,7 +9,9 @@ export declare class ReconnectRefresher {
|
|
8
9
|
private room;
|
9
10
|
private reactors;
|
10
11
|
private disposers;
|
11
|
-
constructor(
|
12
|
+
constructor(ctx: ReconnectRefresherContext);
|
13
|
+
setRoom(room: Room | undefined): void;
|
14
|
+
setContext(ctx: ReconnectRefresherContext): void;
|
12
15
|
private onPhaseChanged;
|
13
16
|
private onReconnected;
|
14
17
|
private releaseDisposers;
|
package/dist/Utils/Common.d.ts
CHANGED
@@ -4,11 +4,13 @@ import type Emittery from "emittery";
|
|
4
4
|
export declare const genAppId: (kind: string) => Promise<string>;
|
5
5
|
export declare const setViewFocusScenePath: (view: View, focusScenePath: string) => void;
|
6
6
|
export declare const setScenePath: (room: Room | undefined, scenePath: string) => void;
|
7
|
+
export declare const getScenePath: (room: Room | undefined, dir: string | undefined, index: number) => string | undefined;
|
7
8
|
export declare const setViewMode: (view: View, mode: ViewVisionMode) => void;
|
8
9
|
export declare const emitError: (error: Error) => void;
|
9
10
|
export declare const addEmitterOnceListener: (event: any, listener: any) => void;
|
10
11
|
export declare const notifyMainViewModeChange: import("lodash").DebouncedFunc<(callbacks: Emittery<PublicEvent>, mode: ViewVisionMode) => void>;
|
11
|
-
export declare const makeValidScenePath: (displayer: Displayer, scenePath: string) => string;
|
12
|
+
export declare const makeValidScenePath: (displayer: Displayer, scenePath: string, index?: number) => string | undefined;
|
13
|
+
export declare const entireScenes: (displayer: Displayer) => import("white-web-sdk").SceneMap;
|
12
14
|
export declare const isValidScenePath: (scenePath: string) => boolean;
|
13
15
|
export declare const ensureValidScenePath: (scenePath: string) => string;
|
14
16
|
export declare const getVersionNumber: (version: string) => number;
|
package/dist/Utils/Reactive.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { UpdateEventKind } from "white-web-sdk";
|
2
2
|
import type { AkkoObjectUpdatedListener } from "white-web-sdk";
|
3
3
|
export declare const onObjectByEvent: (event: UpdateEventKind) => (object: any, func: () => void) => (() => void) | undefined;
|
4
|
-
export declare const safeListenPropsUpdated: <T>(getProps: () => T, callback: AkkoObjectUpdatedListener<T
|
4
|
+
export declare const safeListenPropsUpdated: <T>(getProps: () => T, callback: AkkoObjectUpdatedListener<T>, onDestroyed?: ((props: unknown) => void) | undefined) => () => void;
|
5
5
|
export declare const onObjectRemoved: (object: any, func: () => void) => (() => void) | undefined;
|
6
6
|
export declare const onObjectInserted: (object: any, func: () => void) => (() => void) | undefined;
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { Base } from "
|
1
|
+
import { Base } from "../Base";
|
2
2
|
import type { Camera, Size, View } from "white-web-sdk";
|
3
|
-
import type { AppManager } from "
|
3
|
+
import type { AppManager } from "../AppManager";
|
4
4
|
export declare class MainViewProxy extends Base {
|
5
5
|
private scale?;
|
6
|
-
private cameraStore;
|
7
6
|
private started;
|
8
7
|
private mainViewIsAddListener;
|
9
8
|
private mainView;
|
@@ -35,7 +34,6 @@ export declare class MainViewProxy extends Base {
|
|
35
34
|
private addCameraListener;
|
36
35
|
private removeCameraListener;
|
37
36
|
private onCameraOrSizeUpdated;
|
38
|
-
switchViewModeToWriter(): void;
|
39
37
|
moveCameraToContian(size: Size): void;
|
40
38
|
moveCamera(camera: Camera): void;
|
41
39
|
stop(): void;
|
@@ -0,0 +1,13 @@
|
|
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/constants.d.ts
CHANGED
@@ -31,13 +31,8 @@ export declare enum CursorState {
|
|
31
31
|
Leave = "leave",
|
32
32
|
Normal = "normal"
|
33
33
|
}
|
34
|
-
export declare const REQUIRE_VERSION = "2.
|
34
|
+
export declare const REQUIRE_VERSION = "2.16.0";
|
35
35
|
export declare const MIN_WIDTH: number;
|
36
36
|
export declare const MIN_HEIGHT: number;
|
37
37
|
export declare const SET_SCENEPATH_DELAY = 100;
|
38
|
-
export declare const DEFAULT_COLLECTOR_STYLE: {
|
39
|
-
right: string;
|
40
|
-
bottom: string;
|
41
|
-
position: string;
|
42
|
-
};
|
43
38
|
export declare const DEFAULT_CONTAINER_RATIO: number;
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import { AppManager } from "./AppManager";
|
3
3
|
import { CursorManager } from "./Cursor";
|
4
|
+
import { ReconnectRefresher } from "./ReconnectRefresher";
|
4
5
|
import "./style.css";
|
5
6
|
import "@netless/telebox-insider/dist/style.css";
|
6
7
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
@@ -29,11 +30,11 @@ export declare type AddAppOptions = {
|
|
29
30
|
export declare type setAppOptions = AddAppOptions & {
|
30
31
|
appOptions?: any;
|
31
32
|
};
|
32
|
-
export declare type AddAppParams = {
|
33
|
+
export declare type AddAppParams<TAttributes = any> = {
|
33
34
|
kind: string;
|
34
35
|
src?: string;
|
35
36
|
options?: AddAppOptions;
|
36
|
-
attributes?:
|
37
|
+
attributes?: TAttributes;
|
37
38
|
};
|
38
39
|
export declare type BaseInsertParams = {
|
39
40
|
kind: string;
|
@@ -91,6 +92,7 @@ export declare type EmitterEvent = {
|
|
91
92
|
observerIdChange: number;
|
92
93
|
boxStateChange: string;
|
93
94
|
playgroundSizeChange: DOMRect;
|
95
|
+
onReconnected: void;
|
94
96
|
};
|
95
97
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
96
98
|
export declare const emitter: EmitterType;
|
@@ -100,6 +102,8 @@ export declare type PublicEvent = {
|
|
100
102
|
darkModeChange: boolean;
|
101
103
|
prefersColorSchemeChange: TeleBoxColorScheme;
|
102
104
|
cameraStateChange: CameraState;
|
105
|
+
mainViewScenePathChange: string;
|
106
|
+
mainViewSceneIndexChange: number;
|
103
107
|
};
|
104
108
|
export declare type MountParams = {
|
105
109
|
room: Room;
|
@@ -118,6 +122,7 @@ export declare type MountParams = {
|
|
118
122
|
};
|
119
123
|
export declare type CallbacksType = Emittery<PublicEvent>;
|
120
124
|
export declare const callbacks: CallbacksType;
|
125
|
+
export declare const reconnectRefresher: ReconnectRefresher;
|
121
126
|
export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
|
122
127
|
static kind: string;
|
123
128
|
static displayer: Displayer;
|
@@ -137,20 +142,21 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
137
142
|
isReplay: boolean;
|
138
143
|
private boxManager?;
|
139
144
|
private static params?;
|
145
|
+
private containerResizeObserver?;
|
140
146
|
constructor(context: InvisiblePluginContext);
|
141
147
|
static mount(params: MountParams): Promise<WindowManager>;
|
142
148
|
private static initManager;
|
143
149
|
private static initContainer;
|
144
|
-
bindContainer(container: HTMLElement
|
150
|
+
bindContainer(container: HTMLElement): void;
|
151
|
+
bindCollectorContainer(container: HTMLElement): void;
|
145
152
|
/**
|
146
153
|
* 注册插件
|
147
154
|
*/
|
148
155
|
static register<AppOptions = any, SetupResult = any, Attributes = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
|
149
|
-
static setCollectorContainer(container: HTMLElement): void;
|
150
156
|
/**
|
151
157
|
* 创建一个 app 至白板
|
152
158
|
*/
|
153
|
-
addApp(params: AddAppParams): Promise<string | undefined>;
|
159
|
+
addApp<T = any>(params: AddAppParams<T>): Promise<string | undefined>;
|
154
160
|
private setupScenePath;
|
155
161
|
/**
|
156
162
|
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
@@ -191,6 +197,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
191
197
|
get boxState(): TeleBoxState | undefined;
|
192
198
|
get darkMode(): boolean;
|
193
199
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
200
|
+
get focused(): string | undefined;
|
194
201
|
/**
|
195
202
|
* 查询所有的 App
|
196
203
|
*/
|
@@ -223,13 +230,6 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
223
230
|
private isDynamicPPT;
|
224
231
|
private static checkVersion;
|
225
232
|
private ensureAttributes;
|
226
|
-
private containerResizeObserver?;
|
227
|
-
private observePlaygroundSize;
|
228
|
-
private updateSizer;
|
229
233
|
}
|
230
|
-
export declare const BuiltinApps: {
|
231
|
-
DocsViewer: string;
|
232
|
-
MediaPlayer: string;
|
233
|
-
};
|
234
234
|
export * from "./typings";
|
235
|
-
export {
|
235
|
+
export { BuiltinApps } from "./BuiltinApps";
|