@netless/app-slide 0.1.1 → 0.1.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.
@@ -1,12 +1,13 @@
1
1
  import type { AppContext } from "@netless/window-manager";
2
2
  import type { Attributes, MagixEvents } from "../typings";
3
+ import type { AppOptions } from "..";
3
4
  import { Slide } from "@netless/slide";
4
5
  export { syncSceneWithSlide, createDocsViewerPages } from "./helpers";
5
6
  export declare const DefaultUrl = "https://convertcdn.netless.link/dynamicConvert";
6
7
  export declare const MaxPollCount = 40;
7
8
  export declare const EmptyAttributes: Attributes;
8
9
  export interface SlideControllerOptions {
9
- context: AppContext<Attributes, MagixEvents>;
10
+ context: AppContext<Attributes, MagixEvents, AppOptions>;
10
11
  anchor: HTMLDivElement;
11
12
  onPageChanged: (page: number) => void;
12
13
  onTransitionStart: () => void;
@@ -26,6 +27,8 @@ export declare class SlideController {
26
27
  private readonly onTransitionEnd;
27
28
  private readonly onError;
28
29
  private syncStateOnceFlag;
30
+ private visible;
31
+ private savedIsFrozen;
29
32
  constructor({ context, anchor, onPageChanged, onTransitionStart, onTransitionEnd, onError, }: SlideControllerOptions);
30
33
  ready: boolean;
31
34
  private resolveReady;
@@ -53,4 +56,5 @@ export declare class SlideController {
53
56
  private afterFreeze;
54
57
  freeze: () => void;
55
58
  unfreeze: () => Promise<void>;
59
+ private onVisibilityChange;
56
60
  }
package/dist/index.d.ts CHANGED
@@ -10,9 +10,18 @@ export type { Attributes, AddHooks, FreezableSlide };
10
10
  export declare const version: string;
11
11
  export { DefaultUrl, apps, FreezerLength, addHooks };
12
12
  export interface AppOptions {
13
+ /** show debug controller */
13
14
  debug?: boolean;
15
+ /** scale */
14
16
  resolution?: number;
17
+ /** background color for slide animations */
15
18
  bgColor?: string;
19
+ /** minimal fps @default 25 */
20
+ minFPS?: number;
21
+ /** maximal fps @default 30 */
22
+ maxFPS?: number;
23
+ /** whether to re-scale automatically @default true */
24
+ autoResolution?: boolean;
16
25
  }
17
26
  export interface Controller {
18
27
  slide: () => Slide | undefined;