@moddable/typings 7.1.0 → 7.2.1
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/ChatAudioIO.d.ts +2 -1
- package/commodetto/Bitmap.d.ts +4 -0
- package/embedded/storage/files.d.ts +2 -2
- package/embedded/storage/key-value.d.ts +2 -1
- package/embedded_network/http/client.d.ts +5 -4
- package/embedded_network/websocket/client.d.ts +74 -0
- package/global.d.ts +10 -7
- package/package.json +1 -1
- package/pebble/accelerometer.d.ts +46 -0
- package/pebble/battery.d.ts +38 -0
- package/pebble/button.d.ts +40 -0
- package/pebble/compass.d.ts +40 -0
- package/pebble/device.d.ts +51 -0
- package/pebble/global.d.ts +129 -0
- package/pebble/location.d.ts +50 -0
- package/pebble/message.d.ts +46 -0
- package/pebble/piu.d.ts +100 -0
- package/pebble/poco.d.ts +79 -0
- package/piu/MC-types.d.ts +546 -0
- package/piu/MC.d.ts +31 -553
- package/qrcode.d.ts +5 -3
- package/web/fetch.d.ts +48 -0
- package/{url.d.ts → web/url.d.ts} +1 -1
- package/web/websocket.d.ts +82 -0
- package/web/webstorage.d.ts +33 -0
- /package/{headers.d.ts → web/headers.d.ts} +0 -0
- /package/{structuredClone.d.ts → web/structuredClone.d.ts} +0 -0
- /package/{worker.d.ts → web/worker.d.ts} +0 -0
package/pebble/piu.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Tools.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Tools is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* The Moddable SDK Tools is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
SVGImage
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface SVGImageDictionary extends ContentDictionary {
|
|
26
|
+
clip?: boolean;
|
|
27
|
+
id?: number;
|
|
28
|
+
path?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface SVGImage extends Content {
|
|
32
|
+
opacity: number;
|
|
33
|
+
center(x: number, y: number): void;
|
|
34
|
+
cx: number;
|
|
35
|
+
cy: number;
|
|
36
|
+
rotate(a: number): void;
|
|
37
|
+
r: number;
|
|
38
|
+
scale(x: number, y: number): void;
|
|
39
|
+
s: number;
|
|
40
|
+
sx: number;
|
|
41
|
+
sy: number;
|
|
42
|
+
translate(x: number, y: number): void;
|
|
43
|
+
tx: number;
|
|
44
|
+
ty: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface SVGImageConsructor {
|
|
48
|
+
new(behaviorData?: any, dictionary?: SVGImageDictionary): SVGImage;
|
|
49
|
+
template<T>(this: T, fn: (arg: any) => SVGImageDictionary): T;
|
|
50
|
+
(behaviorData?: any, dictionary?: SVGImageDictionary): SVGImage;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
RoundRect
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
interface RoundRectDictionary extends ContentDictionary {
|
|
58
|
+
corners?: number;
|
|
59
|
+
radius?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface RoundRect extends Content {
|
|
63
|
+
corners: number;
|
|
64
|
+
radius: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface RoundRectConstructor {
|
|
68
|
+
new(behaviorData?: any, dictionary?: RoundRectDictionary): RoundRect;
|
|
69
|
+
template<T>(this: T, fn: (arg: any) => RoundRectDictionary): T;
|
|
70
|
+
(behaviorData?: any, dictionary?: RoundRectDictionary): RoundRect;
|
|
71
|
+
|
|
72
|
+
readonly topLeft: 1;
|
|
73
|
+
readonly topRight: 2;
|
|
74
|
+
readonly bottomLeft: 4;
|
|
75
|
+
readonly bottomRight: 8;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
Inverter
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
interface Inverter extends Content {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface InverterConstructor {
|
|
86
|
+
new(behaviorData?: any, dictionary?: ContentDictionary): Inverter;
|
|
87
|
+
template<T>(this: T, fn: (arg: any) => ContentDictionary): T;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
ScreenBuffer
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
interface ScreenBuffer extends Content {
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface ScreenBufferConstructor {
|
|
98
|
+
new(behaviorData?: any, dictionary?: ContentDictionary): ScreenBuffer;
|
|
99
|
+
template<T>(this: T, fn: (arg: any) => ContentDictionary): T;
|
|
100
|
+
}
|
package/pebble/poco.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Tools.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Tools is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* The Moddable SDK Tools is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/// <reference path="../commodetto/Poco.d.ts" />
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
declare module "commodetto/Poco" {
|
|
25
|
+
import Bitmap from "commodetto/Bitmap";
|
|
26
|
+
|
|
27
|
+
interface FontConstructor {
|
|
28
|
+
new(family: string, size: number): Font;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface PocoPrototype {
|
|
32
|
+
Font: FontConstructor;
|
|
33
|
+
unobstructed: {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
readonly width: number;
|
|
37
|
+
readonly height: number
|
|
38
|
+
};
|
|
39
|
+
drawLine(x0: number, y0: number, x1: number, y1: number, color: number, width: number): void;
|
|
40
|
+
drawRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number, corners: number): void;
|
|
41
|
+
frameRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number): void;
|
|
42
|
+
drawCircle(color: number, x: number, y: number, r: number, from: number, to: number): void;
|
|
43
|
+
drawDCI(dci: PebbleDrawCommandImage | PebbleDrawCommandSequence, x: number, y: number): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class PebbleBitmap extends Bitmap {
|
|
47
|
+
constructor(id: number | string);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
class PebbleDrawCommandList {
|
|
51
|
+
scale(x: number, y: number): this;
|
|
52
|
+
scale(scale: number): this;
|
|
53
|
+
rotate(angle: number, cx: number, cy: number): this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class PebbleDrawCommandImage extends PebbleDrawCommandList {
|
|
57
|
+
constructor(id: number | string);
|
|
58
|
+
readonly width: number;
|
|
59
|
+
readonly height: number;
|
|
60
|
+
clone(): PebbleDrawCommandImage;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
class PebbleDrawCommandSequence {
|
|
64
|
+
constructor(id: number | string);
|
|
65
|
+
readonly width: number;
|
|
66
|
+
readonly height: number;
|
|
67
|
+
readonly duration: number;
|
|
68
|
+
readonly frameDuration: number;
|
|
69
|
+
time: number;
|
|
70
|
+
clone(): PebbleDrawCommandSequence;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface PocoConstructor {
|
|
74
|
+
PebbleBitmap: typeof PebbleBitmap;
|
|
75
|
+
PebbleDrawCommandImage: typeof PebbleDrawCommandImage;
|
|
76
|
+
PebbleDrawCommandSequence: typeof PebbleDrawCommandSequence;
|
|
77
|
+
PebbleDrawCommandList: typeof PebbleDrawCommandList;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020-2025 Shinya Ishikawa
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Tools.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Tools is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* The Moddable SDK Tools is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* type aliases */
|
|
22
|
+
export type Coordinates = {
|
|
23
|
+
top?: number;
|
|
24
|
+
right?: number;
|
|
25
|
+
bottom?: number;
|
|
26
|
+
left?: number;
|
|
27
|
+
};
|
|
28
|
+
export type Position = {
|
|
29
|
+
x?: number;
|
|
30
|
+
y?: number;
|
|
31
|
+
};
|
|
32
|
+
export type Size = {
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
};
|
|
36
|
+
export type Bounds = Position & Size;
|
|
37
|
+
export type Color = string;
|
|
38
|
+
export type ContentState = {
|
|
39
|
+
state?: number;
|
|
40
|
+
variant?: number;
|
|
41
|
+
};
|
|
42
|
+
export type TimeProperty = {
|
|
43
|
+
time?: number;
|
|
44
|
+
duration?: number;
|
|
45
|
+
fraction?: number;
|
|
46
|
+
interval?: number;
|
|
47
|
+
loop?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type TouchProperty = {
|
|
50
|
+
active?: boolean;
|
|
51
|
+
backgroundTouch?: boolean;
|
|
52
|
+
exclusiveTouch?: boolean;
|
|
53
|
+
multipleTouch?: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// TODO: more accurate constructor parameters
|
|
57
|
+
export type TemplateStyle<P, C extends new (...args: any) => any> = {
|
|
58
|
+
new (dictionary?: P): InstanceType<C>;
|
|
59
|
+
template: TemplateStyleFactory<C>;
|
|
60
|
+
};
|
|
61
|
+
export type TemplateStyleFactory<T extends new (...args: any) => any> = (
|
|
62
|
+
param: ConstructorParameters<T>[0]
|
|
63
|
+
) => TemplateStyle<Partial<ConstructorParameters<T>[1]>, T>;
|
|
64
|
+
|
|
65
|
+
export type TemplateComponent<P, C extends new (...args: any) => any> = {
|
|
66
|
+
new (behaviorData?: any, dictionary?: P): InstanceType<C>;
|
|
67
|
+
template: TemplateComponentFactory<C>;
|
|
68
|
+
};
|
|
69
|
+
export type TemplateComponentFactory<T extends new (...args: any) => any> = (
|
|
70
|
+
func: (param: any) => ConstructorParameters<T>[1]
|
|
71
|
+
) => TemplateComponent<Parameters<typeof func>[0], T>;
|
|
72
|
+
|
|
73
|
+
export interface Behavior<T extends Content = Content> {
|
|
74
|
+
onCreate?(content: T, data: object, context: any): void;
|
|
75
|
+
onDisplaying?(content: T): void;
|
|
76
|
+
onFinished?(content: T): void;
|
|
77
|
+
onTimeChanged?(content: T): void;
|
|
78
|
+
onTouchBegan?(content: T, id: number, x: number, y: number, ticks: number): void;
|
|
79
|
+
onTouchCancelled?(content: T, id: number): void;
|
|
80
|
+
onTouchended?(content: T, id: number, x: number, y: number, ticks: number): void;
|
|
81
|
+
onTouchMoved?(content: T, id: number, x: number, y: number, ticks: number): void;
|
|
82
|
+
// TODO: complete callbacks
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface BehaviorConstructor<T extends Content = Content> {
|
|
86
|
+
new(): Behavior<T>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Content {
|
|
90
|
+
// TODO: consider type parameter to avoid any
|
|
91
|
+
adjust(x: number, y: number): void;
|
|
92
|
+
bubble(id: string, ...extras: any[]): void;
|
|
93
|
+
captureTouch(id: string, x: number, y: number, ticks: number): void;
|
|
94
|
+
defer(id: string, ...extras: any[]): void;
|
|
95
|
+
delegate(id: string, ...extras: any[]): void;
|
|
96
|
+
distribute(id: string, ...extras: any[]): void;
|
|
97
|
+
focus(): void;
|
|
98
|
+
hit(x: number, y: number): Content | undefined;
|
|
99
|
+
measure(): Size;
|
|
100
|
+
moveBy(x: number, y: number): void;
|
|
101
|
+
render(): void;
|
|
102
|
+
sizeBy(width: number, height: number): void;
|
|
103
|
+
start(): void;
|
|
104
|
+
stop(): void;
|
|
105
|
+
|
|
106
|
+
readonly previous: Content | null;
|
|
107
|
+
readonly next: Content | null;
|
|
108
|
+
readonly container: Container | null;
|
|
109
|
+
readonly index: number;
|
|
110
|
+
name: string;
|
|
111
|
+
active: boolean;
|
|
112
|
+
anchor: string;
|
|
113
|
+
behavior: object;
|
|
114
|
+
coordinates: Coordinates;
|
|
115
|
+
bounds: Bounds;
|
|
116
|
+
backgroundTouch: boolean;
|
|
117
|
+
exclusiveTouch: boolean;
|
|
118
|
+
multipleTouch: boolean;
|
|
119
|
+
|
|
120
|
+
time: number;
|
|
121
|
+
duration: number;
|
|
122
|
+
fraction: number;
|
|
123
|
+
interval: number;
|
|
124
|
+
loop: boolean;
|
|
125
|
+
running: boolean;
|
|
126
|
+
offset: undefined | Position;
|
|
127
|
+
position: undefined | Position;
|
|
128
|
+
size: Size;
|
|
129
|
+
state: number;
|
|
130
|
+
variant: number;
|
|
131
|
+
skin: Skin | null;
|
|
132
|
+
style: Style | null;
|
|
133
|
+
visible: boolean;
|
|
134
|
+
x: number;
|
|
135
|
+
y: number;
|
|
136
|
+
width: number;
|
|
137
|
+
height: number;
|
|
138
|
+
}
|
|
139
|
+
export interface ContentDictionary
|
|
140
|
+
extends Coordinates,
|
|
141
|
+
Size,
|
|
142
|
+
ContentState,
|
|
143
|
+
TimeProperty,
|
|
144
|
+
TouchProperty {
|
|
145
|
+
name?: string;
|
|
146
|
+
anchor?: string;
|
|
147
|
+
Behavior?: BehaviorConstructor;
|
|
148
|
+
skin?: Skin | SkinDictionary;
|
|
149
|
+
Skin?: SkinConstructor;
|
|
150
|
+
style?: Style | StyleDictionary;
|
|
151
|
+
Style?: StyleConstructor;
|
|
152
|
+
visible?: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface ContentConstructor {
|
|
155
|
+
new(behaviorData?: any, dictionary?: ContentDictionary): Content;
|
|
156
|
+
(behaviorData?: any, dictionary?: ContentDictionary): Content;
|
|
157
|
+
readonly prototype: Content;
|
|
158
|
+
|
|
159
|
+
template: TemplateComponentFactory<ContentConstructor>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface Style {
|
|
163
|
+
measure(string: string): Size;
|
|
164
|
+
}
|
|
165
|
+
export interface StyleDictionaryBase {
|
|
166
|
+
color?: Color | Color[];
|
|
167
|
+
font?: string;
|
|
168
|
+
horizontal?: string;
|
|
169
|
+
top?: number;
|
|
170
|
+
}
|
|
171
|
+
export interface StyleConstructor {
|
|
172
|
+
new(dictionary: StyleDictionary): Style;
|
|
173
|
+
|
|
174
|
+
template<T>(this: T, dictionary: StyleDictionary): T;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface TextStyleDictionary extends StyleDictionaryBase {
|
|
178
|
+
leading?: number;
|
|
179
|
+
right?: number;
|
|
180
|
+
bottom?: number;
|
|
181
|
+
left?: number;
|
|
182
|
+
}
|
|
183
|
+
export interface LabelStyleDictionary extends StyleDictionaryBase {
|
|
184
|
+
vertical?: string;
|
|
185
|
+
}
|
|
186
|
+
export type StyleDictionary = LabelStyleDictionary | TextStyleDictionary;
|
|
187
|
+
|
|
188
|
+
export interface Texture {
|
|
189
|
+
readonly height: number;
|
|
190
|
+
readonly width: number;
|
|
191
|
+
}
|
|
192
|
+
export interface TextureDictionary {
|
|
193
|
+
path: string;
|
|
194
|
+
}
|
|
195
|
+
export interface TextureConstructor {
|
|
196
|
+
new(path: string): Texture;
|
|
197
|
+
new(dictionary: TextureDictionary): Texture;
|
|
198
|
+
readonly prototype: Texture;
|
|
199
|
+
|
|
200
|
+
template: TemplateStyleFactory<TextureConstructor>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface Skin {
|
|
204
|
+
borders: Coordinates;
|
|
205
|
+
fill: Color | Color[];
|
|
206
|
+
stroke: Color | Color[];
|
|
207
|
+
texture: Texture;
|
|
208
|
+
color: Color;
|
|
209
|
+
bounds: Bounds;
|
|
210
|
+
height: number;
|
|
211
|
+
width: number;
|
|
212
|
+
states?: number;
|
|
213
|
+
variants?: number;
|
|
214
|
+
tiles?: Coordinates;
|
|
215
|
+
top?: number;
|
|
216
|
+
right?: number;
|
|
217
|
+
bottom?: number;
|
|
218
|
+
left?: number;
|
|
219
|
+
}
|
|
220
|
+
export interface SkinConstructor {
|
|
221
|
+
new(dictionary: SkinDictionary): Skin;
|
|
222
|
+
readonly prototype: Skin;
|
|
223
|
+
|
|
224
|
+
template: TemplateStyleFactory<SkinConstructor>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface TextureSkinDictionary extends Coordinates, Bounds {
|
|
228
|
+
texture?: Texture | TextureDictionary;
|
|
229
|
+
Texture?: TextureConstructor;
|
|
230
|
+
color?: Color | Color[];
|
|
231
|
+
states?: number;
|
|
232
|
+
variants?: number;
|
|
233
|
+
tiles?: Coordinates;
|
|
234
|
+
}
|
|
235
|
+
export interface ColorSkinDictionary {
|
|
236
|
+
borders?: Coordinates;
|
|
237
|
+
fill?: Color | Color[];
|
|
238
|
+
stroke?: Color | Color[];
|
|
239
|
+
}
|
|
240
|
+
export type SkinDictionary = ColorSkinDictionary | TextureSkinDictionary;
|
|
241
|
+
|
|
242
|
+
export interface Transition {
|
|
243
|
+
onBegin(container: Container, ...extras: any[]): void;
|
|
244
|
+
onEnd(container: Container, ...extras: any[]): void;
|
|
245
|
+
onStep(fraction: number): void;
|
|
246
|
+
duration?: number;
|
|
247
|
+
}
|
|
248
|
+
export interface TransitionConstructor {
|
|
249
|
+
new(duration: number, interpolator?: (value: number) => number, first?: any, last?: any): Transition
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface Container extends Content {
|
|
253
|
+
clip: boolean;
|
|
254
|
+
readonly first: Content | null;
|
|
255
|
+
readonly last: Content | null;
|
|
256
|
+
readonly length: number;
|
|
257
|
+
readonly transitioning: boolean;
|
|
258
|
+
add(content: Content): void;
|
|
259
|
+
content(at: number | string): Content | undefined;
|
|
260
|
+
empty(start?: number, stop?: number): void;
|
|
261
|
+
firstThat(id: string, ...extras: any[]): void;
|
|
262
|
+
insert(content: Content, before: Content): void;
|
|
263
|
+
lastThat(id: string, ...extras: any[]): void;
|
|
264
|
+
remove(content: Content): void;
|
|
265
|
+
replace(content: Content, by: Content): void;
|
|
266
|
+
run(transition: Transition, ...extras: any[]): void;
|
|
267
|
+
swap(content0: Content, content1: Content): void;
|
|
268
|
+
onTransitionBeginning(container: Container): void;
|
|
269
|
+
onTransitionEnded(container: Container): void;
|
|
270
|
+
}
|
|
271
|
+
export interface ContainerDictionary extends ContentDictionary {
|
|
272
|
+
clip?: boolean;
|
|
273
|
+
contents?: Content[];
|
|
274
|
+
}
|
|
275
|
+
export interface ContainerConstructor {
|
|
276
|
+
new(behaviorData?: any, dictionary?: ContainerDictionary): Container;
|
|
277
|
+
(behaviorData?: any, dictionary?: ContainerDictionary): Container;
|
|
278
|
+
|
|
279
|
+
template<T>(this: T, fn: (arg: any) => ContainerDictionary): T;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface Label extends Content {
|
|
283
|
+
string: string;
|
|
284
|
+
}
|
|
285
|
+
export interface LabelDictionary extends ContentDictionary {
|
|
286
|
+
string?: string;
|
|
287
|
+
}
|
|
288
|
+
export interface LabelConstructor {
|
|
289
|
+
new(behaviorData?: any, dictionary?: LabelDictionary): Label;
|
|
290
|
+
(behaviorData?: any, dictionary?: LabelDictionary): Label;
|
|
291
|
+
|
|
292
|
+
template<T>(this: T, fn: (arg: any) => LabelDictionary): T;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface Port extends Content {
|
|
296
|
+
drawContent(
|
|
297
|
+
x: number,
|
|
298
|
+
y: number,
|
|
299
|
+
width: number,
|
|
300
|
+
height: number
|
|
301
|
+
): void;
|
|
302
|
+
drawLabel(
|
|
303
|
+
string: string,
|
|
304
|
+
x: number,
|
|
305
|
+
y: number,
|
|
306
|
+
width: number,
|
|
307
|
+
height: number
|
|
308
|
+
): void;
|
|
309
|
+
drawSkin(
|
|
310
|
+
skin: Skin,
|
|
311
|
+
x: number,
|
|
312
|
+
y: number,
|
|
313
|
+
width: number,
|
|
314
|
+
height: number,
|
|
315
|
+
variant?: number,
|
|
316
|
+
state?: number
|
|
317
|
+
): void;
|
|
318
|
+
drawString(
|
|
319
|
+
string: string,
|
|
320
|
+
style: Style,
|
|
321
|
+
color: Color,
|
|
322
|
+
x: number,
|
|
323
|
+
y: number,
|
|
324
|
+
width: number,
|
|
325
|
+
height: number
|
|
326
|
+
): void;
|
|
327
|
+
drawStyle(
|
|
328
|
+
string: string,
|
|
329
|
+
style: Style,
|
|
330
|
+
x: number,
|
|
331
|
+
y: number,
|
|
332
|
+
width: number,
|
|
333
|
+
height: number,
|
|
334
|
+
ellipsis?: boolean,
|
|
335
|
+
state?: number
|
|
336
|
+
): void;
|
|
337
|
+
drawTexture(
|
|
338
|
+
texture: Texture,
|
|
339
|
+
color: Color,
|
|
340
|
+
x: number,
|
|
341
|
+
y: number,
|
|
342
|
+
sx: number,
|
|
343
|
+
sy: number,
|
|
344
|
+
sw: number,
|
|
345
|
+
sh: number
|
|
346
|
+
): void;
|
|
347
|
+
fillColor(
|
|
348
|
+
color: Color,
|
|
349
|
+
x: number,
|
|
350
|
+
y: number,
|
|
351
|
+
width: number,
|
|
352
|
+
height: number
|
|
353
|
+
): void;
|
|
354
|
+
fillTexture(
|
|
355
|
+
texture: Texture,
|
|
356
|
+
color: Color,
|
|
357
|
+
x: number,
|
|
358
|
+
y: number,
|
|
359
|
+
width: number,
|
|
360
|
+
height: number,
|
|
361
|
+
sx?: number,
|
|
362
|
+
sy?: number,
|
|
363
|
+
sw?: number,
|
|
364
|
+
sh?: number
|
|
365
|
+
): void;
|
|
366
|
+
invalidate(
|
|
367
|
+
x?: number,
|
|
368
|
+
y?: number,
|
|
369
|
+
width?: number,
|
|
370
|
+
height?: number
|
|
371
|
+
): void;
|
|
372
|
+
measureString(string: string, style: Style): Size;
|
|
373
|
+
popClip(): void;
|
|
374
|
+
pushClip(
|
|
375
|
+
x?: number,
|
|
376
|
+
y?: number,
|
|
377
|
+
width?: number,
|
|
378
|
+
height?: number
|
|
379
|
+
): void;
|
|
380
|
+
onDraw(
|
|
381
|
+
port: Port,
|
|
382
|
+
x: number,
|
|
383
|
+
y: number,
|
|
384
|
+
width: number,
|
|
385
|
+
height: number
|
|
386
|
+
): void;
|
|
387
|
+
}
|
|
388
|
+
export interface PortConstructor extends ContentConstructor {
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export interface TextBlock {
|
|
392
|
+
behavior?: object | null;
|
|
393
|
+
style?: Style | null;
|
|
394
|
+
spans: (string | TextSpan)[] | string,
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface TextSpan extends TextBlock {
|
|
398
|
+
link?: any
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface Text extends Content {
|
|
402
|
+
blocks: TextBlock[],
|
|
403
|
+
string: string;
|
|
404
|
+
begin(): void;
|
|
405
|
+
beginBlock(style?: Style, behavior?: object): void;
|
|
406
|
+
beginSpan(style: Style, behavior?: object): void;
|
|
407
|
+
concat(string: string): void;
|
|
408
|
+
end(): void;
|
|
409
|
+
endBlock(): void;
|
|
410
|
+
endSpan(): void;
|
|
411
|
+
}
|
|
412
|
+
export interface TextDictionary extends ContentDictionary {
|
|
413
|
+
blocks?: TextBlock[],
|
|
414
|
+
string?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface TextConstructor {
|
|
417
|
+
new(behaviorData?: any, dictionary?: TextDictionary): Text;
|
|
418
|
+
(behaviorData?: any, dictionary?: TextDictionary): Text;
|
|
419
|
+
|
|
420
|
+
template<T>(this: T, fn: (arg: any) => TextDictionary): T;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export interface Application extends Container {
|
|
424
|
+
displayListLength: number;
|
|
425
|
+
commandListLength: number;
|
|
426
|
+
touchCount: number;
|
|
427
|
+
}
|
|
428
|
+
export interface ApplicationDictionary extends ContainerDictionary {
|
|
429
|
+
displayListLength?: number;
|
|
430
|
+
commandListLength?: number;
|
|
431
|
+
touchCount?: number;
|
|
432
|
+
pixels?: number;
|
|
433
|
+
}
|
|
434
|
+
export interface ApplicationConstructor {
|
|
435
|
+
new(behaviorData?: any, dictionary?: ApplicationDictionary): Application;
|
|
436
|
+
|
|
437
|
+
template<T>(this: T, fn: (arg: any) => ApplicationDictionary): T;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface Column extends Container {
|
|
441
|
+
}
|
|
442
|
+
export interface ColumnConstructor extends ContainerConstructor {
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface Layout extends Container {
|
|
446
|
+
onFitHorizontally(layout: Layout, width: number): void;
|
|
447
|
+
onFitVertically(layout: Layout, height: number): void;
|
|
448
|
+
onMeasureHorizontally(layout: Layout, width: number): void;
|
|
449
|
+
onMeasureVertically(layout: Layout, height: number): void;
|
|
450
|
+
}
|
|
451
|
+
export interface LayoutConstructor extends ContainerConstructor {
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface Image extends Content {
|
|
455
|
+
readonly frameCount: never;
|
|
456
|
+
frameIndex: number;
|
|
457
|
+
}
|
|
458
|
+
export interface ImageDictionary extends ContentDictionary {
|
|
459
|
+
path: string;
|
|
460
|
+
}
|
|
461
|
+
export interface ImageConstructor {
|
|
462
|
+
new(behaviorData?: any, dictionary?: ImageDictionary): Image;
|
|
463
|
+
(behaviorData?: any, dictionary?: ImageDictionary): Image;
|
|
464
|
+
|
|
465
|
+
template<T>(this: T, fn: (arg: any) => ImageDictionary): T;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface Die extends Layout {
|
|
469
|
+
set(x: number, y: number, width: number, height: number): Die;
|
|
470
|
+
sub(x: number, y: number, width: number, height: number): Die;
|
|
471
|
+
and(x: number, y: number, width: number, height: number): Die;
|
|
472
|
+
or(x: number, y: number, width: number, height: number): Die;
|
|
473
|
+
xor(x: number, y: number, width: number, height: number): Die;
|
|
474
|
+
fill(): Die;
|
|
475
|
+
empty(): Die;
|
|
476
|
+
cut(): void;
|
|
477
|
+
attach(content: Content): void;
|
|
478
|
+
detach(): void;
|
|
479
|
+
}
|
|
480
|
+
export interface DieConstructor extends LayoutConstructor {
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export interface Row extends Container {
|
|
484
|
+
}
|
|
485
|
+
export interface RowConstructor extends ContainerConstructor {
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface Scroller extends Container {
|
|
489
|
+
readonly constraint: Position;
|
|
490
|
+
loop: boolean;
|
|
491
|
+
scroll: Position;
|
|
492
|
+
tracking: boolean;
|
|
493
|
+
reveal(bounds: Bounds): void;
|
|
494
|
+
scrollBy(dx: number, dy: number): void;
|
|
495
|
+
scrollTo(x: number, y: number): void;
|
|
496
|
+
onScrolled(scroller: Scroller): void;
|
|
497
|
+
}
|
|
498
|
+
export interface ScrollerDictionary extends ContainerDictionary {
|
|
499
|
+
loop?: boolean;
|
|
500
|
+
}
|
|
501
|
+
export interface ScrollerConstructor {
|
|
502
|
+
new(behaviorData?: any, dictionary?: ScrollerDictionary): Scroller;
|
|
503
|
+
(behaviorData?: any, dictionary?: ScrollerDictionary): Scroller;
|
|
504
|
+
|
|
505
|
+
template<T>(this: T, fn: (arg: any) => ScrollerDictionary): T;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface LinkDictionary {
|
|
509
|
+
Behavior?: BehaviorConstructor;
|
|
510
|
+
}
|
|
511
|
+
export interface Link {
|
|
512
|
+
readonly container: Container;
|
|
513
|
+
state: number;
|
|
514
|
+
captureTouch(id: number, x: number, y: number, ticks: number): void;
|
|
515
|
+
}
|
|
516
|
+
export interface LinkConstructor {
|
|
517
|
+
new(behaviorData?: any, dictionary?: LinkDictionary): Link;
|
|
518
|
+
(behaviorData?: any, dictionary?: LinkDictionary): Link;
|
|
519
|
+
|
|
520
|
+
template<T>(this: T, fn: (arg: any) => LinkDictionary): T;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface Locals {
|
|
524
|
+
new(name?: string, language?: string): Locals
|
|
525
|
+
language: string;
|
|
526
|
+
get(textToLocalize: string): string
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export interface blendColors {
|
|
530
|
+
(a: number, c1: number, c2: number): Color
|
|
531
|
+
}
|
|
532
|
+
export interface hsl {
|
|
533
|
+
(h: number, s: number, l: number): Color
|
|
534
|
+
}
|
|
535
|
+
export interface hsla {
|
|
536
|
+
(h: number, s: number, l: number, a: number): Color
|
|
537
|
+
}
|
|
538
|
+
export interface rgb {
|
|
539
|
+
(r: number, g: number, b: number): Color
|
|
540
|
+
}
|
|
541
|
+
export interface rgba {
|
|
542
|
+
(r: number, g: number, b: number, a: number): Color
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
export {};
|