@netless/app-slide 0.2.106-beta.2 → 0.2.106-beta.4

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,4 +1,3 @@
1
- import * as _netless_window_manager from '@netless/window-manager';
2
1
  import { RegisterParams, ReadonlyTeleBox, Room, AppContext, Player, View, NetlessApp } from '@netless/window-manager';
3
2
  import { SlideError, VolumeAdjuster } from '@netless/ppt-player';
4
3
  import { IPlugin } from '@netless/plugin-system';
@@ -486,8 +485,9 @@ declare class Slide extends Slide_base {
486
485
  private renderingTaskManager;
487
486
  private lifecycle;
488
487
  private lifecycleGeneration;
488
+ private playerDestroyOutcome?;
489
+ private playerDestroyCallbacks;
489
490
  private renderVisibilityTimers;
490
- private destroyPromise?;
491
491
  private isLoading;
492
492
  private isReleasing;
493
493
  private interactive;
@@ -590,7 +590,7 @@ declare class Slide extends Slide_base {
590
590
  * It is called when synchronizing the whole.
591
591
  * @param state ISlideState
592
592
  */
593
- setSlideState(state: Partial<ISlideState>): Promise<void>;
593
+ setSlideState(state: Partial<ISlideState>, onVisualStateReady?: () => void): Promise<void>;
594
594
  private initInteractiveSeq;
595
595
  private initMedia;
596
596
  /**
@@ -746,12 +746,12 @@ declare class Slide extends Slide_base {
746
746
  /**
747
747
  * Enter freeze state, cache the ppt screen as an image, and release the WebGL context.
748
748
  */
749
- frozen(callback?: () => void): Promise<void>;
749
+ frozen(callback?: () => void, onError?: (error: unknown) => void): void;
750
750
  private _doRelease;
751
751
  /**
752
752
  * Recover from frozen state.
753
753
  */
754
- release(callback?: () => void): Promise<void>;
754
+ release(callback?: () => void, onPlayerCreated?: () => void, onError?: (error: unknown) => void): void;
755
755
  private _doDestroy;
756
756
  private waitLoadEnd;
757
757
  /**
@@ -763,7 +763,7 @@ declare class Slide extends Slide_base {
763
763
  /**
764
764
  * Destruction method.
765
765
  */
766
- destroy(): Promise<void>;
766
+ destroy(onPlayerDestroyed?: () => void, onError?: (error: unknown) => void): void;
767
767
  /**
768
768
  * Destroy the local cache of the current Slide instance, need to be called before destroy.
769
769
  */
@@ -1032,6 +1032,7 @@ declare class SlideControllerBase {
1032
1032
  protected syncStateOnceFlag: boolean;
1033
1033
  protected visible: boolean;
1034
1034
  protected savedIsFrozen: boolean;
1035
+ protected focused: boolean;
1035
1036
  protected invisibleBehavior: "frozen" | "pause";
1036
1037
  previewList: string[];
1037
1038
  constructor(props: SlideControllerOptions);
@@ -1054,10 +1055,18 @@ declare class SlideControllerBase {
1054
1055
  protected createSlide(anchor: HTMLDivElement, defaults?: Partial<ISlideConfig>): Slide;
1055
1056
  protected destroyed: boolean;
1056
1057
  protected destroyPromise?: Promise<void>;
1058
+ private resolveDestroyedSignal;
1059
+ private readonly destroyedSignal;
1057
1060
  destroy(): Promise<void>;
1058
1061
  timestamp: () => number;
1059
1062
  isFrozen: boolean;
1063
+ private resourceStateUnknown;
1064
+ private managedActivity;
1060
1065
  protected _toFreeze: -1 | 0 | 1;
1066
+ setFocusedState: (focused: boolean) => Promise<void>;
1067
+ private resourceTransition;
1068
+ private shouldBeActive;
1069
+ reconcileActivity: (force?: boolean) => Promise<void>;
1061
1070
  freeze: () => Promise<void>;
1062
1071
  unfreeze: () => Promise<void>;
1063
1072
  protected bindAppStateChangeEvent: () => void;
@@ -1067,6 +1076,7 @@ declare class SlideControllerBase {
1067
1076
  status: "normal" | "minimized" | "maximized";
1068
1077
  }) => void;
1069
1078
  protected getAppStatus: () => "normal" | "minimized" | "maximized" | undefined;
1079
+ protected isLazySetupMode: () => boolean;
1070
1080
  protected onVisibilityChange: () => Promise<void>;
1071
1081
  }
1072
1082
  declare class SlideController extends SlideControllerBase {
@@ -1337,8 +1347,8 @@ interface AppOptions extends Pick<ISlideConfig, "rtcAudio" | "useLocalCache" | "
1337
1347
  resourceMaxRetries?: number;
1338
1348
  onResourceMaxRetries: (url: string, error: Error) => void;
1339
1349
  /**
1340
- * Max time (ms) `setup()` waits for the first `renderEnd` before resolving
1341
- * anyway (the slide keeps loading in background). Default: 5_000.
1350
+ * First-render warning threshold in ms. Default: 5_000. New lazy hosts
1351
+ * continue awaiting real readiness; legacy/eager hosts resolve on timeout.
1342
1352
  */
1343
1353
  setupReadyTimeout?: number;
1344
1354
  }
@@ -1366,9 +1376,7 @@ interface AppResult {
1366
1376
  onPptMediaPermissionRequest: (callback: () => void) => () => void;
1367
1377
  playPptMedia: () => void;
1368
1378
  }
1369
- declare const SlideApp: NetlessApp<Attributes, MagixEvents, AppOptions, AppResult> & {
1370
- teardown(context: _netless_window_manager.AppContext): Promise<void>;
1371
- };
1379
+ declare const SlideApp: NetlessApp<Attributes, MagixEvents, AppOptions, AppResult>;
1372
1380
 
1373
1381
  export { DefaultUrl, DocsViewer, FreezerLength, SideEffectManager, Slide, SlideController, SlideControllerBase, SlideDocsViewer, SlidePreviewer, addHooks, apps, SlideApp as default, getFreezerLength, log, logger, onCreated, onDestroyed, previewSlide, setFreezerLength, syncSceneWithSlide, useFreezer, usePlugin, version };
1374
1382
  export type { AddHooks, AppOptions, AppResult, Attributes, FreezableSlide, ILogger, NavigationButtonMode, PreviewParams };