-
Notifications
You must be signed in to change notification settings - Fork 138
/
types.d.ts
189 lines (177 loc) · 5.34 KB
/
types.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import type {Color, Object3D, BufferGeometry, EventDispatcher, Texture} from "three";
export type BlockOptions = {
width: number;
height: number;
padding?: number;
fontFamily?: string;
fontTexture?: string;
backgroundColor?: Color;
backgroundOpacity?: number;
borderRadius?: number | [topLeft: number, topRight: number, bottomRight: number, bottomLeft: number];
// @todo add missing properties
[property: string]: any;
}
export declare class Block extends Object3D {
constructor(options: BlockOptions);
}
export type TextOptions = {
// @todo add missing properties
[property: string]: any;
}
export declare class Text extends Object3D {
constructor(options: TextOptions);
}
export type InlineBlockOptions = {
// @todo add missing properties
[property: string]: any;
}
export declare class InlineBlock extends Object3D {
constructor(options: InlineBlockOptions);
}
export type KeyboardOptions = {
// @todo add missing properties
[property: string]: any;
}
export declare class Keyboard extends Object3D {
constructor(options: KeyboardOptions);
}
// @TODO: To be evaluated by typescripters ---------------------------------
// export declare abstract class FontVariant {
// private _isReady:boolean;
// public isReady:boolean;
// private _weight:string;
// public weight:string;
// private _style:string;
// public style:string;
// private _size:number;
// public size:number;
// private _lineHeight:number;
// public lineHeight:number;
// private _lineBase:number;
// public lineBase:number;
// private _font:TypographyFont;
// public font:TypographyFont;
// protected constructor(weight: string, style: string);
// getCharacterDescription(character:string):TypographyCharacter
// abstract getCharacterGeometry( inline:InlineCharacter): BufferGeometry
// getKerningAmount(pairs):number;
// private _checkReadiness():boolean;
// protected abstract _readyCondition ():boolean
// adjustCharactersDescription(adjustmentObject:any):void
// }
//
// export declare class TypographyFont {
//
// private _size:number;
// public size:number;
// private _lineHeight:number;
// public lineHeight:number;
// private _lineBase:number;
// public lineBase:number;
// private _name:number;
// public name:number;
//
// }
//
// export declare abstract class TypographyCharacter {
//
// protected constructor( typographicFont:TypographyFont );
// protected _char:string;
// public char:string;
// protected _width:number
// public width:number
// protected _heigth:number
// public heigth:number
// protected _xadvance:number;
// public xadvance:number;
// protected _xoffset:number;
// public xoffset:number;
// protected _yoffset:number;
// public yoffset:number;
// protected _font:TypographyFont;
// public font:TypographyFont;
// public abstract asCharacterInline():InlineCharacter
// }
//
// export declare abstract class InlineCharacter {
//
// protected _typographic:TypographyCharacter;
// protected _fontFactor:number;
// protected _lineBreak:string|null;
// public lineBreak:string|null;
// protected _fontSize:number;
// public fontSize:number;
// protected _kerning:number;
// public kerning:number;
// protected _offsetX:number;
// public offsetX:number;
// protected _offsetY:number;
// public offsetY:number;
//
// protected constructor( characterDesc:TypographyCharacter );
//
// get typographic():TypographyCharacter
// resetOffsets():void
// get xadvance():number
// get xoffset():number
// get yoffset():number
//
// get width():number
//
// get height():number
//
// get char():string
//
// get anchor():number;
//
// get lineHeight():number
//
// get lineBase():number
//
// set fontFactor( value:number )
//
// }
//
// export declare class FontFamily extends EventDispatcher {
//
// private _name:string;
// private _variants:FontVariant[];
// private _isReady:boolean;
//
// constructor( name:string );
//
// get isReady():boolean
//
// addVariant( weight:string, style:string, json:Object|string, texture:Texture|string, override:boolean):FontFamily
// addCustomImplementationVariant( variantImplementation:FontVariant, override:boolean):FontFamily
// getVariant( weight:string, style:string ):FontVariant
// get name():string;
// private _checkReadiness():boolean;
//
// }
//
//
// export declare namespace FontLibrary {
// export function addFontFamily(fontFamilyName:string);
// export function getFontFamily(fontFamilyName:string);
// export function load(fontFamily:FontFamily, ...args:FontFamily[]):Promise<unknown>;
// export function setMissingCharacterHandler(fontVariant:FontVariant, character:string):string|null;
// export function missingCharacter(handler:(fontVariant:FontVariant, character:string) => string|null);
// }
// ---------------------------- End of evaluation
export declare namespace FontLibrary {
export function addFontFamily(fontFamilyName:string);
export function getFontFamily(fontFamilyName:string);
export function load(fontFamily:any, ...args:any[]):Promise<unknown>;
export function setMissingCharacterHandler(fontVariant:any, character:string):string|null;
export function missingCharacter(handler:(fontVariant:any, character:string) => string|null);
}
export declare function update(): void;
declare global {
namespace JSX {
interface IntrinsicElements {
block: any
text: any
}
}
}