@netless/window-manager 1.0.15 → 1.0.16

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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as lodash from 'lodash';
2
2
  import * as white_web_sdk from 'white-web-sdk';
3
- import { SceneDefinition, SceneState, DisplayerState, View, ApplianceNames, ViewVisionMode, CameraState, RoomMember, Camera, Size, Event as Event$1, Scope, EventPhase, MagixEventListenerOptions as MagixEventListenerOptions$1, toJS, listenUpdated, unlistenUpdated, listenDisposed, unlistenDisposed, Room, ViewMode, Displayer, MemberState, Logger, AnimationMode, InvisiblePlugin, InvisiblePluginContext, Player, Rectangle, Point, CameraBound, ImageInformation } from 'white-web-sdk';
3
+ import { SceneDefinition, SceneState, DisplayerState, View, ApplianceNames, ViewVisionMode, CameraState, RoomMember, Camera, Size, Event as Event$1, Scope, EventPhase, MagixEventListenerOptions as MagixEventListenerOptions$1, toJS, listenUpdated, unlistenUpdated, listenDisposed, unlistenDisposed, Room, ViewMode, Displayer, MemberState, Logger as Logger$1, AnimationMode, InvisiblePlugin, InvisiblePluginContext, Player, Rectangle, Point, CameraBound, ImageInformation } from 'white-web-sdk';
4
4
  export { AnimationMode, Displayer, Player, Room, SceneDefinition, SceneState, View } from 'white-web-sdk';
5
5
  import { TELE_BOX_STATE, TeleBoxRect, TeleBoxState, TeleBoxColorScheme, NotMinimizedBoxState, TeleBoxManager, TeleBoxCollector, ReadonlyTeleBox, TeleBoxManagerUpdateConfig, TeleBoxConfig } from '@netless/telebox-insider';
6
6
  export { ReadonlyTeleBox, TeleBoxCollector, TeleBoxManager, TeleBoxRect } from '@netless/telebox-insider';
@@ -999,7 +999,7 @@ declare class ArgusLog {
999
999
  /** debounce 窗口内 safeUpdateAttributes:同 keys 数组则只更新 value,否则追加一段,flush 时拼成一条 */
1000
1000
  private pendingUpdateSegments;
1001
1001
  private updateMergeTimer;
1002
- constructor(logger: Logger, name: string, debounceTime?: number | undefined);
1002
+ constructor(logger: Logger$1, name: string, debounceTime?: number | undefined);
1003
1003
  private emitInfo;
1004
1004
  private flush;
1005
1005
  private flushShallowMerge;
@@ -1025,6 +1025,69 @@ declare class ArgusLog {
1025
1025
  dispose(): void;
1026
1026
  }
1027
1027
 
1028
+ interface PresentationPage {
1029
+ src: string;
1030
+ width: number;
1031
+ height: number;
1032
+ thumbnail?: string | undefined;
1033
+ name?: string;
1034
+ }
1035
+ interface ScrollbarEventCallback {
1036
+ onScrollbarDragStart?: () => void;
1037
+ onScrollbarDragEnd?: () => void;
1038
+ onScrollbarDragX?: (x: number) => void;
1039
+ onScrollbarDragY?: (y: number) => void;
1040
+ onScrollCameraUpdated?: (appid: string, originScale: number, scale: number) => void;
1041
+ }
1042
+
1043
+ type Logger = (...data: any[]) => void;
1044
+ interface Viewport {
1045
+ readonly x: number;
1046
+ readonly y: number;
1047
+ readonly width: number;
1048
+ readonly height: number;
1049
+ }
1050
+ interface PresentationAppOptions {
1051
+ /** Disables user move / scale the image and whiteboard. */
1052
+ disableCameraTransform?: boolean;
1053
+ /** Max scale = `maxCameraScale` * default scale. Not working when `disableCameraTransform` is true. Default: 3 */
1054
+ maxCameraScale?: number;
1055
+ /** Custom logger. Default: a logger that reports to the whiteboard server. */
1056
+ log?: Logger;
1057
+ /** Custom thumbnail generator. Default is appending `"?x-oss-process=image/resize,l_50"` to `src`. */
1058
+ thumbnail?: (src: string) => string;
1059
+ /**
1060
+ * Custom viewport to set on the first time the presentation was added. Default is full page.
1061
+ * Numbers range in 0 to 1 is considered a ratio to multiply the real page size.
1062
+ * Example settings:
1063
+ *
1064
+ * - Full page: `{ x: 0, y: 0, width: 1, height: 1 }`
1065
+ * - Half page: `{ x: 0, y: 0, width: 1, height: 0.5 }`
1066
+ * - Absolute top-left area of the page: `{ x: 0, y: 0, width: 100, height: 100 }`
1067
+ */
1068
+ viewport?: Viewport | ((page: PresentationPage) => Viewport);
1069
+ /** justDocsViewReadonly is used to set the presentation readonly, it will be used in the presentation, and the presentation will be readonly when the app is initialized */
1070
+ justDocsViewReadonly?: true;
1071
+ /** useScrollbar is used to set the presentation use scrollbar, it will be used in the presentation, and the presentation will be use scrollbar when the app is initialized */
1072
+ useScrollbar?: boolean;
1073
+ /** debounceSync is used to set the presentation debounce sync, it will be used in the presentation, and the presentation will be debounce sync when the app is initialized */
1074
+ debounceSync?: boolean;
1075
+ scrollbarEventCallback?: ScrollbarEventCallback;
1076
+ /** goToPageByClick is used to set the presentation go to page by click, it will be used in the presentation, and the presentation will be go to page by click when the app is initialized */
1077
+ goToPageByClick?: boolean;
1078
+ /** useClipView is used to set the presentation use clip view, it will be used in the presentation, and the presentation will be use clip view when the app is initialized */
1079
+ useClipView?: boolean;
1080
+ }
1081
+
1082
+ interface BuiltinAppOptions {
1083
+ Presentation?: PresentationAppOptions;
1084
+ }
1085
+ declare const BuiltinApps: {
1086
+ DocsViewer: string;
1087
+ MediaPlayer: string;
1088
+ Presentation: string;
1089
+ };
1090
+
1028
1091
  declare class AppListeners {
1029
1092
  private manager;
1030
1093
  private displayer;
@@ -1224,12 +1287,6 @@ type ExtendClass = {
1224
1287
  };
1225
1288
  declare function getExtendClass<T extends ExtendClassAble>(baseClass: T, extendClass?: ExtendClass): T;
1226
1289
 
1227
- declare const BuiltinApps: {
1228
- DocsViewer: string;
1229
- MediaPlayer: string;
1230
- Presentation: string;
1231
- };
1232
-
1233
1290
  type WindowMangerAttributes = {
1234
1291
  modelValue?: string;
1235
1292
  boxState: TELE_BOX_STATE;
@@ -1344,6 +1401,8 @@ type MountParams = {
1344
1401
  supportAppliancePlugin?: boolean;
1345
1402
  /** 是否使用 boxesStatus 状态管理窗口 */
1346
1403
  useBoxesStatus?: boolean;
1404
+ /** Local Presentation options applied before restoring apps. Not synchronized. */
1405
+ builtinAppOptions?: BuiltinAppOptions;
1347
1406
  };
1348
1407
  declare const reconnectRefresher: ReconnectRefresher;
1349
1408
  declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
@@ -1372,6 +1431,7 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
1372
1431
  private _cursorUIDs;
1373
1432
  private _cursorUIDsStyleDOM?;
1374
1433
  _appliancePlugin?: any;
1434
+ builtinAppOptions?: BuiltinAppOptions;
1375
1435
  private boxManager?;
1376
1436
  private static params?;
1377
1437
  static extendClass?: ExtendClass$1;
@@ -1380,7 +1440,7 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
1380
1440
  private extendPluginManager?;
1381
1441
  private _roomLogger?;
1382
1442
  attributesDeboundceLog?: ArgusLog;
1383
- get Logger(): Logger | undefined;
1443
+ get Logger(): Logger$1 | undefined;
1384
1444
  constructor(context: InvisiblePluginContext);
1385
1445
  static onCreate(manager: WindowManager): void;
1386
1446
  static mount(params: MountParams, extendClass?: ExtendClass$1): Promise<WindowManager>;
@@ -1398,6 +1458,7 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
1398
1458
  * 注销插件
1399
1459
  */
1400
1460
  static unregister(kind: string): void;
1461
+ resolveAppOptions(kind: string, registeredOptions?: any | (() => any)): any | (() => any);
1401
1462
  /**
1402
1463
  * 创建一个 app 至白板
1403
1464
  */
@@ -1553,4 +1614,4 @@ declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
1553
1614
  }
1554
1615
 
1555
1616
  export { AppContext, AppCreateError, AppManager, AppManagerNotInitError, AppNotRegisterError, AppProxy, AttributesDelegate, BindContainerRoomPhaseInvalidError, BoxManager, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, CursorManager, ExtendPlugin, ExtendPluginManager, InvalidScenePath, ParamsInvalidError, Storage, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, getExtendClass, reconnectRefresher };
1556
- export type { AddAppOptions, AddAppParams, AddPageParams, AppEmitterEvent, AppInitState, AppListenerKeys, AppPayload, AppSyncAttributes, ApplianceIcons, BaseInsertParams, CursorMovePayload, CursorOptions, DocsEvent, DocsEventOptions, ExtendClass, ExtendClassAble, ExtendContext, ExtendManagerOptions, ExtendPluginInstance, MountParams, NetlessApp, PageController, PageRemoveService, PageState, PublicEvent, RegisterEventData, RegisterEvents, RegisterParams, StorageStateChangedEvent, StorageStateChangedListener, WindowMangerAttributes, apps, setAppOptions };
1617
+ export type { AddAppOptions, AddAppParams, AddPageParams, AppEmitterEvent, AppInitState, AppListenerKeys, AppPayload, AppSyncAttributes, ApplianceIcons, BaseInsertParams, BuiltinAppOptions, CursorMovePayload, CursorOptions, DocsEvent, DocsEventOptions, ExtendClass, ExtendClassAble, ExtendContext, ExtendManagerOptions, ExtendPluginInstance, MountParams, NetlessApp, PageController, PageRemoveService, PageState, PublicEvent, RegisterEventData, RegisterEvents, RegisterParams, StorageStateChangedEvent, StorageStateChangedListener, WindowMangerAttributes, apps, setAppOptions };