-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
59 lines (51 loc) · 1.2 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import {
Texture,
Mapping,
Wrapping,
TextureFilter,
PixelFormat,
TextureDataType,
TextureEncoding,
} from "three";
type TContent = string | HTMLElement;
type TSizeParams = {
width?: number;
height?: number;
dpr?: number;
};
type TInitOption = TContent | (TSizeParams & { content: TContent });
declare class DOMCanvas {
canvas: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
svg: HTMLElement;
img: HTMLImageElement;
width: number;
height: number;
content: TContent;
dpr: number;
setSize(params: TSizeParams): DOMCanvas;
setContent(content: TContent): DOMCanvas;
contentInlineStyle(): DOMCanvas;
clone(): DOMCanvas;
render(): Promise<void>;
constructor(option?: TInitOption);
}
declare class DOMTexture extends Texture {
domCanvas: DOMCanvas;
updateSize(params: TSizeParams): DOMTexture;
setContent(content: string): void;
domInlineStyle(): void;
constructor(
options: TInitOption,
mapping?: Mapping,
wrapS?: Wrapping,
wrapT?: Wrapping,
magFilter?: TextureFilter,
minFilter?: TextureFilter,
format?: PixelFormat,
type?: TextureDataType,
anisotropy?: number,
encoding?: TextureEncoding
);
}
export { DOMCanvas, DOMTexture };