1 | import { RenderingContext2D, Fetch } from './types';
|
2 | import { ViewPort } from './ViewPort';
|
3 | import { Mouse } from './Mouse';
|
4 | import { Document, Element, AnimateElement } from './Document';
|
5 | export interface IScreenOptions {
|
6 | |
7 |
|
8 |
|
9 | window?: Window | null;
|
10 | |
11 |
|
12 |
|
13 | fetch?: Fetch;
|
14 | }
|
15 | export interface IScreenStartOptions {
|
16 | |
17 |
|
18 |
|
19 | enableRedraw?: boolean;
|
20 | |
21 |
|
22 |
|
23 | ignoreMouse?: boolean;
|
24 | |
25 |
|
26 |
|
27 | ignoreAnimation?: boolean;
|
28 | |
29 |
|
30 |
|
31 | ignoreDimensions?: boolean;
|
32 | |
33 |
|
34 |
|
35 | ignoreClear?: boolean;
|
36 | |
37 |
|
38 |
|
39 | scaleWidth?: number;
|
40 | |
41 |
|
42 |
|
43 | scaleHeight?: number;
|
44 | |
45 |
|
46 |
|
47 | offsetX?: number;
|
48 | |
49 |
|
50 |
|
51 | offsetY?: number;
|
52 | |
53 |
|
54 |
|
55 | forceRedraw?(): boolean;
|
56 | }
|
57 | export interface IScreenViewBoxConfig {
|
58 | document: Document;
|
59 | ctx: RenderingContext2D;
|
60 | aspectRatio: string;
|
61 | width: number;
|
62 | desiredWidth: number;
|
63 | height: number;
|
64 | desiredHeight: number;
|
65 | minX?: number;
|
66 | minY?: number;
|
67 | refX?: number;
|
68 | refY?: number;
|
69 | clip?: boolean;
|
70 | clipX?: number;
|
71 | clipY?: number;
|
72 | }
|
73 | export declare class Screen {
|
74 | readonly ctx: RenderingContext2D;
|
75 | static readonly defaultWindow: Window & typeof globalThis;
|
76 | static readonly defaultFetch: typeof fetch;
|
77 | static FRAMERATE: number;
|
78 | static MAX_VIRTUAL_PIXELS: number;
|
79 | readonly window: Window | null;
|
80 | readonly fetch: Fetch;
|
81 | readonly viewPort: ViewPort;
|
82 | readonly mouse: Mouse;
|
83 | readonly animations: AnimateElement[];
|
84 | private readyPromise;
|
85 | private resolveReady;
|
86 | private waits;
|
87 | private frameDuration;
|
88 | private isReadyLock;
|
89 | private isFirstRender;
|
90 | private intervalId;
|
91 | constructor(ctx: RenderingContext2D, { fetch, window }?: IScreenOptions);
|
92 | wait(checker: () => boolean): void;
|
93 | ready(): Promise<void>;
|
94 | isReady(): boolean;
|
95 | setDefaults(ctx: RenderingContext2D): void;
|
96 | setViewBox({ document, ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY, clip, clipX, clipY }: IScreenViewBoxConfig): void;
|
97 | start(element: Element, { enableRedraw, ignoreMouse, ignoreAnimation, ignoreDimensions, ignoreClear, forceRedraw, scaleWidth, scaleHeight, offsetX, offsetY }?: IScreenStartOptions): void;
|
98 | stop(): void;
|
99 | private shouldUpdate;
|
100 | private render;
|
101 | }
|
102 | //# sourceMappingURL=Screen.d.ts.map |
\ | No newline at end of file |