js-game-zero 0.0.0-placeholder → 0.3.0
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/LICENSE +22 -0
- package/README.md +135 -3
- package/dist/active-service.d.ts +21 -0
- package/dist/actor.d.ts +182 -0
- package/dist/animation.d.ts +61 -0
- package/dist/assets.d.ts +148 -0
- package/dist/audio.d.ts +150 -0
- package/dist/browser-asset-backends.d.ts +8 -0
- package/dist/browser.d.ts +10 -0
- package/dist/chunk-brk0rjcy.js +7846 -0
- package/dist/clock.d.ts +29 -0
- package/dist/color.d.ts +15 -0
- package/dist/events.d.ts +145 -0
- package/dist/friendly-names.d.ts +43 -0
- package/dist/geometry.d.ts +125 -0
- package/dist/helpers.d.ts +28 -0
- package/dist/host.d.ts +58 -0
- package/dist/host.js +435 -0
- package/dist/index.d.ts +340 -0
- package/dist/index.js +258 -0
- package/dist/input.d.ts +200 -0
- package/dist/inspection.d.ts +58 -0
- package/dist/jgz.js +8419 -0
- package/dist/node.d.ts +14 -0
- package/dist/node.js +145 -0
- package/dist/pixel-density.d.ts +23 -0
- package/dist/random.d.ts +31 -0
- package/dist/reference/actor.md +197 -0
- package/dist/reference/audio.md +128 -0
- package/dist/reference/clock.md +150 -0
- package/dist/reference/helpers.md +46 -0
- package/dist/reference/hooks.md +379 -0
- package/dist/reference/index.d.ts +2 -0
- package/dist/reference/index.js +39 -0
- package/dist/reference/loaders.md +164 -0
- package/dist/reference/rect.md +129 -0
- package/dist/reference/runtime.md +478 -0
- package/dist/reference/screen.md +313 -0
- package/dist/reference/storage.md +90 -0
- package/dist/rendering.d.ts +188 -0
- package/dist/runtime-contracts.d.ts +117 -0
- package/dist/runtime-diagnostics.d.ts +37 -0
- package/dist/runtime-persistence.d.ts +32 -0
- package/dist/runtime-source.d.ts +82 -0
- package/dist/runtime.d.ts +81 -0
- package/dist/source-scan.d.ts +49 -0
- package/dist/storage-path.d.ts +3 -0
- package/dist/storage.d.ts +88 -0
- package/dist/tone.d.ts +81 -0
- package/dist/touch-controls.d.ts +24 -0
- package/dist/touch-pointer.d.ts +11 -0
- package/dist/util.d.ts +62 -0
- package/package.json +63 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import * as actorModule from "./actor.js";
|
|
2
|
+
import * as animationModule from "./animation.js";
|
|
3
|
+
import * as assetsModule from "./assets.js";
|
|
4
|
+
import * as audioModule from "./audio.js";
|
|
5
|
+
import * as clockModule from "./clock.js";
|
|
6
|
+
import * as colorModule from "./color.js";
|
|
7
|
+
import * as eventsModule from "./events.js";
|
|
8
|
+
import * as geometryModule from "./geometry.js";
|
|
9
|
+
import * as helpersModule from "./helpers.js";
|
|
10
|
+
import * as inputModule from "./input.js";
|
|
11
|
+
import * as renderingModule from "./rendering.js";
|
|
12
|
+
import * as runtimeModule from "./runtime.js";
|
|
13
|
+
import * as storageModule from "./storage.js";
|
|
14
|
+
import * as toneModule from "./tone.js";
|
|
15
|
+
export declare const Actor: typeof actorModule.Actor;
|
|
16
|
+
export type Actor = actorModule.Actor;
|
|
17
|
+
export type { ActorAnchor, ActorOptions, ActorPositionKey, HorizontalActorAnchor, VerticalActorAnchor, } from "./actor.js";
|
|
18
|
+
export declare const Animation: typeof animationModule.Animation;
|
|
19
|
+
export type Animation<T extends object = object> = animationModule.Animation<T>;
|
|
20
|
+
export declare const ValueError: typeof animationModule.ValueError;
|
|
21
|
+
export type ValueError = animationModule.ValueError;
|
|
22
|
+
export declare const animate: typeof animationModule.animate;
|
|
23
|
+
export declare const tweenNames: readonly ("linear" | "accelerate" | "decelerate" | "accelDecel" | "inElastic" | "outElastic" | "inOutElastic" | "bounceEnd" | "bounceStart" | "bounceStartEnd" | "endElastic" | "startElastic" | "bothElastic" | "easeIn" | "easeOut" | "easeInOut" | "bounce" | "spring")[];
|
|
24
|
+
export declare const tweens: Readonly<{
|
|
25
|
+
linear(n: number): number;
|
|
26
|
+
accelerate(n: number): number;
|
|
27
|
+
decelerate(n: number): number;
|
|
28
|
+
accelDecel(n: number): number;
|
|
29
|
+
inElastic(n: number): number;
|
|
30
|
+
outElastic(n: number): number;
|
|
31
|
+
inOutElastic(n: number): number;
|
|
32
|
+
bounceEnd(n: number): number;
|
|
33
|
+
bounceStart(n: number): number;
|
|
34
|
+
bounceStartEnd(n: number): number;
|
|
35
|
+
endElastic(n: number): number;
|
|
36
|
+
startElastic(n: number): number;
|
|
37
|
+
bothElastic(n: number): number;
|
|
38
|
+
easeIn(n: number): number;
|
|
39
|
+
easeOut(n: number): number;
|
|
40
|
+
easeInOut(n: number): number;
|
|
41
|
+
bounce(n: number): number;
|
|
42
|
+
spring(n: number): number;
|
|
43
|
+
}>;
|
|
44
|
+
export type { AnimationOptions, TweenName } from "./animation.js";
|
|
45
|
+
export declare const ImageSurface: typeof assetsModule.ImageSurface;
|
|
46
|
+
export type ImageSurface = assetsModule.ImageSurface;
|
|
47
|
+
export declare const InvalidAssetNameError: typeof assetsModule.InvalidAssetNameError;
|
|
48
|
+
export type InvalidAssetNameError = assetsModule.InvalidAssetNameError;
|
|
49
|
+
export declare const MissingAssetError: typeof assetsModule.MissingAssetError;
|
|
50
|
+
export type MissingAssetError = assetsModule.MissingAssetError;
|
|
51
|
+
export declare const fonts: assetsModule.AssetLoader<assetsModule.FontAsset>;
|
|
52
|
+
export declare const images: assetsModule.AssetLoader<assetsModule.SurfaceLike>;
|
|
53
|
+
export declare const sounds: assetsModule.AssetLoader<assetsModule.SoundAsset>;
|
|
54
|
+
export type { AssetKind, AssetLoader, AssetLoaders, AssetUrls, DrawableImage, FontAsset, LoadedAsset, MusicAsset, SoundAsset, SurfaceLike, SurfaceRectOptions, } from "./assets.js";
|
|
55
|
+
export declare const music: audioModule.MusicPlayer;
|
|
56
|
+
export declare const Clock: typeof clockModule.Clock;
|
|
57
|
+
export type Clock = clockModule.Clock;
|
|
58
|
+
export declare const clock: clockModule.Clock;
|
|
59
|
+
export type { ClockOptions } from "./clock.js";
|
|
60
|
+
export declare const Rect: typeof geometryModule.Rect;
|
|
61
|
+
export type Rect = geometryModule.Rect;
|
|
62
|
+
export declare const ZRect: typeof geometryModule.ZRect;
|
|
63
|
+
export type ZRect = geometryModule.ZRect;
|
|
64
|
+
export declare const angleTo: typeof geometryModule.angleTo;
|
|
65
|
+
export declare const distanceTo: typeof geometryModule.distanceTo;
|
|
66
|
+
export type { Point, RectDict, RectLike, RectTuple, Size } from "./geometry.js";
|
|
67
|
+
export declare const clamp: typeof helpersModule.clamp;
|
|
68
|
+
export declare const randomChoice: typeof helpersModule.randomChoice;
|
|
69
|
+
export declare const randomInt: typeof helpersModule.randomInt;
|
|
70
|
+
export declare const KeyboardState: typeof inputModule.KeyboardState;
|
|
71
|
+
export type KeyboardState = inputModule.KeyboardState;
|
|
72
|
+
export declare const keyboard: inputModule.KeyboardState;
|
|
73
|
+
export declare const keymods: Readonly<{
|
|
74
|
+
NONE: 0;
|
|
75
|
+
LSHIFT: 1;
|
|
76
|
+
RSHIFT: 2;
|
|
77
|
+
SHIFT: 3;
|
|
78
|
+
LCTRL: 64;
|
|
79
|
+
RCTRL: 128;
|
|
80
|
+
CTRL: 192;
|
|
81
|
+
LALT: 256;
|
|
82
|
+
RALT: 512;
|
|
83
|
+
ALT: 768;
|
|
84
|
+
LMETA: 1024;
|
|
85
|
+
RMETA: 2048;
|
|
86
|
+
META: 3072;
|
|
87
|
+
NUM: 4096;
|
|
88
|
+
CAPS: 8192;
|
|
89
|
+
MODE: 16384;
|
|
90
|
+
}>;
|
|
91
|
+
export declare const keys: Readonly<{
|
|
92
|
+
ENTER: 13;
|
|
93
|
+
BACKSPACE: 8;
|
|
94
|
+
TAB: 9;
|
|
95
|
+
CLEAR: 12;
|
|
96
|
+
RETURN: 13;
|
|
97
|
+
PAUSE: 19;
|
|
98
|
+
ESCAPE: 27;
|
|
99
|
+
SPACE: 32;
|
|
100
|
+
EXCLAIM: 33;
|
|
101
|
+
QUOTEDBL: 34;
|
|
102
|
+
HASH: 35;
|
|
103
|
+
DOLLAR: 36;
|
|
104
|
+
AMPERSAND: 38;
|
|
105
|
+
QUOTE: 39;
|
|
106
|
+
LEFTPAREN: 40;
|
|
107
|
+
RIGHTPAREN: 41;
|
|
108
|
+
ASTERISK: 42;
|
|
109
|
+
PLUS: 43;
|
|
110
|
+
COMMA: 44;
|
|
111
|
+
MINUS: 45;
|
|
112
|
+
PERIOD: 46;
|
|
113
|
+
SLASH: 47;
|
|
114
|
+
K_0: 48;
|
|
115
|
+
K_1: 49;
|
|
116
|
+
K_2: 50;
|
|
117
|
+
K_3: 51;
|
|
118
|
+
K_4: 52;
|
|
119
|
+
K_5: 53;
|
|
120
|
+
K_6: 54;
|
|
121
|
+
K_7: 55;
|
|
122
|
+
K_8: 56;
|
|
123
|
+
K_9: 57;
|
|
124
|
+
COLON: 58;
|
|
125
|
+
SEMICOLON: 59;
|
|
126
|
+
LESS: 60;
|
|
127
|
+
EQUALS: 61;
|
|
128
|
+
GREATER: 62;
|
|
129
|
+
QUESTION: 63;
|
|
130
|
+
AT: 64;
|
|
131
|
+
LEFTBRACKET: 91;
|
|
132
|
+
BACKSLASH: 92;
|
|
133
|
+
RIGHTBRACKET: 93;
|
|
134
|
+
CARET: 94;
|
|
135
|
+
UNDERSCORE: 95;
|
|
136
|
+
BACKQUOTE: 96;
|
|
137
|
+
A: 97;
|
|
138
|
+
B: 98;
|
|
139
|
+
C: 99;
|
|
140
|
+
D: 100;
|
|
141
|
+
E: 101;
|
|
142
|
+
F: 102;
|
|
143
|
+
G: 103;
|
|
144
|
+
H: 104;
|
|
145
|
+
I: 105;
|
|
146
|
+
J: 106;
|
|
147
|
+
K: 107;
|
|
148
|
+
L: 108;
|
|
149
|
+
M: 109;
|
|
150
|
+
N: 110;
|
|
151
|
+
O: 111;
|
|
152
|
+
P: 112;
|
|
153
|
+
Q: 113;
|
|
154
|
+
R: 114;
|
|
155
|
+
S: 115;
|
|
156
|
+
T: 116;
|
|
157
|
+
U: 117;
|
|
158
|
+
V: 118;
|
|
159
|
+
W: 119;
|
|
160
|
+
X: 120;
|
|
161
|
+
Y: 121;
|
|
162
|
+
Z: 122;
|
|
163
|
+
DELETE: 127;
|
|
164
|
+
KP0: 1073741922;
|
|
165
|
+
KP1: 1073741913;
|
|
166
|
+
KP2: 1073741914;
|
|
167
|
+
KP3: 1073741915;
|
|
168
|
+
KP4: 1073741916;
|
|
169
|
+
KP5: 1073741917;
|
|
170
|
+
KP6: 1073741918;
|
|
171
|
+
KP7: 1073741919;
|
|
172
|
+
KP8: 1073741920;
|
|
173
|
+
KP9: 1073741921;
|
|
174
|
+
KP_PERIOD: 1073741923;
|
|
175
|
+
KP_DIVIDE: 1073741908;
|
|
176
|
+
KP_MULTIPLY: 1073741909;
|
|
177
|
+
KP_MINUS: 1073741910;
|
|
178
|
+
KP_PLUS: 1073741911;
|
|
179
|
+
KP_ENTER: 1073741912;
|
|
180
|
+
KP_EQUALS: 1073741927;
|
|
181
|
+
UP: 1073741906;
|
|
182
|
+
DOWN: 1073741905;
|
|
183
|
+
RIGHT: 1073741903;
|
|
184
|
+
LEFT: 1073741904;
|
|
185
|
+
INSERT: 1073741897;
|
|
186
|
+
HOME: 1073741898;
|
|
187
|
+
END: 1073741901;
|
|
188
|
+
PAGEUP: 1073741899;
|
|
189
|
+
PAGEDOWN: 1073741902;
|
|
190
|
+
F1: 1073741882;
|
|
191
|
+
F2: 1073741883;
|
|
192
|
+
F3: 1073741884;
|
|
193
|
+
F4: 1073741885;
|
|
194
|
+
F5: 1073741886;
|
|
195
|
+
F6: 1073741887;
|
|
196
|
+
F7: 1073741888;
|
|
197
|
+
F8: 1073741889;
|
|
198
|
+
F9: 1073741890;
|
|
199
|
+
F10: 1073741891;
|
|
200
|
+
F11: 1073741892;
|
|
201
|
+
F12: 1073741893;
|
|
202
|
+
F13: 1073741928;
|
|
203
|
+
F14: 1073741929;
|
|
204
|
+
F15: 1073741930;
|
|
205
|
+
NUMLOCK: 1073741907;
|
|
206
|
+
CAPSLOCK: 1073741881;
|
|
207
|
+
SCROLLOCK: 1073741895;
|
|
208
|
+
RSHIFT: 1073742053;
|
|
209
|
+
LSHIFT: 1073742049;
|
|
210
|
+
RCTRL: 1073742052;
|
|
211
|
+
LCTRL: 1073742048;
|
|
212
|
+
RALT: 1073742054;
|
|
213
|
+
LALT: 1073742050;
|
|
214
|
+
RMETA: 1073742055;
|
|
215
|
+
LMETA: 1073742051;
|
|
216
|
+
LSUPER: 1073742051;
|
|
217
|
+
RSUPER: 1073742055;
|
|
218
|
+
MODE: 1073742081;
|
|
219
|
+
HELP: 1073741941;
|
|
220
|
+
PRINT: 1073741894;
|
|
221
|
+
SYSREQ: 1073741978;
|
|
222
|
+
BREAK: 1073741896;
|
|
223
|
+
MENU: 1073741942;
|
|
224
|
+
POWER: 1073741926;
|
|
225
|
+
EURO: 1073742004;
|
|
226
|
+
LAST: 1073742106;
|
|
227
|
+
}>;
|
|
228
|
+
export declare const mouse: Readonly<{
|
|
229
|
+
LEFT: 1;
|
|
230
|
+
MIDDLE: 2;
|
|
231
|
+
RIGHT: 3;
|
|
232
|
+
WHEEL_UP: 4;
|
|
233
|
+
WHEEL_DOWN: 5;
|
|
234
|
+
}>;
|
|
235
|
+
export type { LiveMouse } from "./input.js";
|
|
236
|
+
export type { TouchButton, TouchControlsConfig, TouchControlsOptions, } from "./touch-controls.js";
|
|
237
|
+
export declare const Screen: typeof renderingModule.Screen;
|
|
238
|
+
export type Screen = renderingModule.Screen;
|
|
239
|
+
export declare const screen: renderingModule.Screen;
|
|
240
|
+
export declare const rgb: typeof colorModule.rgb;
|
|
241
|
+
export type { CanvasLike, Color, HorizontalAnchor, ScreenOptions, TextAlignOption, TextAnchor, TextOptions, TextboxOptions, VerticalAnchor, } from "./rendering.js";
|
|
242
|
+
export declare const defineGame: typeof runtimeModule.defineGame;
|
|
243
|
+
export declare const exit: typeof runtimeModule.exit;
|
|
244
|
+
export declare const run: typeof runtimeModule.run;
|
|
245
|
+
export type { DefinedGame, DefinedGameModule, GameContext, GameHandle, GameHandleState, GameKeyEvent, GameModule, GameMouseEvent, PreloadedAssets, RunOptions, RuntimeCanvas, RuntimeDiagnostic, RuntimeFailure, RuntimeFailurePhase, RuntimeMode, RuntimeScheduler, } from "./runtime.js";
|
|
246
|
+
export declare const JsonStorageError: typeof storageModule.JsonStorageError;
|
|
247
|
+
export type JsonStorageError = storageModule.JsonStorageError;
|
|
248
|
+
export declare const Storage: typeof storageModule.Storage;
|
|
249
|
+
export type Storage = storageModule.Storage;
|
|
250
|
+
export declare const storage: storageModule.Storage;
|
|
251
|
+
export type { JsonValue, StorageAdapter } from "./storage.js";
|
|
252
|
+
export declare const CreatedTone: typeof toneModule.CreatedTone;
|
|
253
|
+
export type CreatedTone = toneModule.CreatedTone;
|
|
254
|
+
export declare const DEFAULT_TONE_VOLUME = 0.8;
|
|
255
|
+
export declare const tone: toneModule.ToneGenerator;
|
|
256
|
+
export type { TonePlayback, TonePlayOptions, ToneSpec, Waveform, WaveformAlias, WaveformInput, } from "./tone.js";
|
|
257
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
258
|
+
export declare const AudioUnlockState: typeof audioModule.AudioUnlockState;
|
|
259
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
260
|
+
export type AudioUnlockState = audioModule.AudioUnlockState;
|
|
261
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
262
|
+
export declare const BrowserSoundAsset: typeof audioModule.BrowserSoundAsset;
|
|
263
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
264
|
+
export type BrowserSoundAsset = audioModule.BrowserSoundAsset;
|
|
265
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
266
|
+
export declare const InputDispatcher: typeof eventsModule.InputDispatcher;
|
|
267
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
268
|
+
export type InputDispatcher = eventsModule.InputDispatcher;
|
|
269
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
270
|
+
export declare const MusicPlayer: typeof audioModule.MusicPlayer;
|
|
271
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
272
|
+
export type MusicPlayer = audioModule.MusicPlayer;
|
|
273
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
274
|
+
export declare const ToneGenerator: typeof toneModule.ToneGenerator;
|
|
275
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
276
|
+
export type ToneGenerator = toneModule.ToneGenerator;
|
|
277
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
278
|
+
export declare const assetUrl: typeof assetsModule.assetUrl;
|
|
279
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
280
|
+
export declare const audioUnlock: audioModule.AudioUnlockState;
|
|
281
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
282
|
+
export declare const buttonsFromBrowserButtons: typeof eventsModule.buttonsFromBrowserButtons;
|
|
283
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
284
|
+
export declare const clampVolume: typeof audioModule.clampVolume;
|
|
285
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
286
|
+
export declare const collectRuntimeDiagnostics: typeof runtimeModule.collectRuntimeDiagnostics;
|
|
287
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
288
|
+
export declare const createAssetLoaders: typeof assetsModule.createAssetLoaders;
|
|
289
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
290
|
+
export declare const createBrowserSoundAsset: typeof audioModule.createBrowserSoundAsset;
|
|
291
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
292
|
+
export declare const createFontLoader: typeof assetsModule.createFontLoader;
|
|
293
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
294
|
+
export declare const createImageLoader: typeof assetsModule.createImageLoader;
|
|
295
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
296
|
+
export declare const createInputDispatcher: typeof eventsModule.createInputDispatcher;
|
|
297
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
298
|
+
export declare const createLocalStorageAdapter: typeof storageModule.createLocalStorageAdapter;
|
|
299
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
300
|
+
export declare const createMusicLoader: typeof assetsModule.createMusicLoader;
|
|
301
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
302
|
+
export declare const createMusicPlayer: typeof audioModule.createMusicPlayer;
|
|
303
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
304
|
+
export declare const createSoundLoader: typeof assetsModule.createSoundLoader;
|
|
305
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
306
|
+
export declare const createStorage: typeof storageModule.createStorage;
|
|
307
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
308
|
+
export declare const createToneGenerator: typeof toneModule.createToneGenerator;
|
|
309
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
310
|
+
export declare const dispatchHook: typeof eventsModule.dispatchHook;
|
|
311
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
312
|
+
export declare const fitTextboxFontSize: typeof renderingModule.fitTextboxFontSize;
|
|
313
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
314
|
+
export declare const getParameterNames: typeof eventsModule.getParameterNames;
|
|
315
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
316
|
+
export declare const getScreen: typeof renderingModule.getScreen;
|
|
317
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
318
|
+
export declare const layoutText: typeof renderingModule.layoutText;
|
|
319
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
320
|
+
export declare const mapBrowserKeyEvent: typeof eventsModule.mapBrowserKeyEvent;
|
|
321
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
322
|
+
export declare const mapBrowserMouseButton: typeof eventsModule.mapBrowserMouseButton;
|
|
323
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
324
|
+
export declare const mapBrowserMouseEvent: typeof eventsModule.mapBrowserMouseEvent;
|
|
325
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
326
|
+
export declare const mapBrowserWheelEvent: typeof eventsModule.mapBrowserWheelEvent;
|
|
327
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
328
|
+
export declare const normalizeColor: typeof colorModule.normalizeColor;
|
|
329
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
330
|
+
export declare const normalizeWaveform: typeof toneModule.normalizeWaveform;
|
|
331
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
332
|
+
export declare const noteToFrequency: typeof toneModule.noteToFrequency;
|
|
333
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
334
|
+
export declare const parseToneFrequency: typeof toneModule.parseToneFrequency;
|
|
335
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
336
|
+
export declare const setScreen: typeof renderingModule.setScreen;
|
|
337
|
+
/** @deprecated Import from `js-game-zero/host` instead. */
|
|
338
|
+
export declare const validateAssetName: typeof assetsModule.validateAssetName;
|
|
339
|
+
/** @deprecated Import this type from `js-game-zero/host` instead. */
|
|
340
|
+
export type { AssetLoaderOptions, AudioContextLike, AudioElementFactory, AudioElementLike, AudioParamLike, BrowserKeyboardLike, BrowserMouseLike, BrowserSoundDebugState, BrowserSoundOptions, BrowserStorageLike, BrowserWheelLike, GainNodeLike, LocalStorageAdapterOptions, MappedKeyboardEvent, MappedMouseEvent, MusicPlayerOptions, OscillatorNodeLike, StorageOptions, TextLayout, TimeoutScheduler, ToneOptions, } from "./host.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* js-game-zero 0.3.0
|
|
3
|
+
* https://github.com/Leaf-Learning/js-game-zero
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2026 Taha Rafiq
|
|
8
|
+
* Copyright (c) 2001 Robert Penner (easing equations)
|
|
9
|
+
*
|
|
10
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
* in the Software without restriction, including without limitation the rights
|
|
13
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
* furnished to do so, subject to the following conditions:
|
|
16
|
+
*
|
|
17
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
* copies or substantial portions of the Software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
* SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
import {
|
|
29
|
+
Actor,
|
|
30
|
+
Animation,
|
|
31
|
+
AudioUnlockState,
|
|
32
|
+
BrowserSoundAsset,
|
|
33
|
+
Clock,
|
|
34
|
+
CreatedTone,
|
|
35
|
+
DEFAULT_TONE_VOLUME,
|
|
36
|
+
ImageSurface,
|
|
37
|
+
InputDispatcher,
|
|
38
|
+
InvalidAssetNameError,
|
|
39
|
+
JsonStorageError,
|
|
40
|
+
KeyboardState,
|
|
41
|
+
MissingAssetError,
|
|
42
|
+
MusicPlayer,
|
|
43
|
+
Rect,
|
|
44
|
+
Screen,
|
|
45
|
+
Storage,
|
|
46
|
+
ToneGenerator,
|
|
47
|
+
ValueError,
|
|
48
|
+
ZRect,
|
|
49
|
+
angleTo,
|
|
50
|
+
animate,
|
|
51
|
+
assetUrl,
|
|
52
|
+
audioUnlock,
|
|
53
|
+
buttonsFromBrowserButtons,
|
|
54
|
+
clamp,
|
|
55
|
+
clampVolume,
|
|
56
|
+
clock,
|
|
57
|
+
collectRuntimeDiagnostics,
|
|
58
|
+
createAssetLoaders,
|
|
59
|
+
createBrowserSoundAsset,
|
|
60
|
+
createFontLoader,
|
|
61
|
+
createImageLoader,
|
|
62
|
+
createInputDispatcher,
|
|
63
|
+
createLocalStorageAdapter,
|
|
64
|
+
createMusicLoader,
|
|
65
|
+
createMusicPlayer,
|
|
66
|
+
createSoundLoader,
|
|
67
|
+
createStorage,
|
|
68
|
+
createToneGenerator,
|
|
69
|
+
defineGame,
|
|
70
|
+
dispatchHook,
|
|
71
|
+
distanceTo,
|
|
72
|
+
exit,
|
|
73
|
+
fitTextboxFontSize,
|
|
74
|
+
fonts,
|
|
75
|
+
getParameterNames,
|
|
76
|
+
getScreen,
|
|
77
|
+
images,
|
|
78
|
+
keyboard,
|
|
79
|
+
keymods,
|
|
80
|
+
keys,
|
|
81
|
+
layoutText,
|
|
82
|
+
mapBrowserKeyEvent,
|
|
83
|
+
mapBrowserMouseButton,
|
|
84
|
+
mapBrowserMouseEvent,
|
|
85
|
+
mapBrowserWheelEvent,
|
|
86
|
+
mouse,
|
|
87
|
+
music,
|
|
88
|
+
normalizeColor,
|
|
89
|
+
normalizeWaveform,
|
|
90
|
+
noteToFrequency,
|
|
91
|
+
parseToneFrequency,
|
|
92
|
+
randomChoice,
|
|
93
|
+
randomInt,
|
|
94
|
+
rgb,
|
|
95
|
+
run,
|
|
96
|
+
screen,
|
|
97
|
+
setScreen,
|
|
98
|
+
sounds,
|
|
99
|
+
storage,
|
|
100
|
+
tone,
|
|
101
|
+
tweenNames,
|
|
102
|
+
tweens,
|
|
103
|
+
validateAssetName
|
|
104
|
+
} from "./chunk-brk0rjcy.js";
|
|
105
|
+
|
|
106
|
+
// packages/js-game-zero/src/index.ts
|
|
107
|
+
var Actor2 = Actor;
|
|
108
|
+
var Animation2 = Animation;
|
|
109
|
+
var ValueError2 = ValueError;
|
|
110
|
+
var animate2 = animate;
|
|
111
|
+
var tweenNames2 = tweenNames;
|
|
112
|
+
var tweens2 = tweens;
|
|
113
|
+
var ImageSurface2 = ImageSurface;
|
|
114
|
+
var InvalidAssetNameError2 = InvalidAssetNameError;
|
|
115
|
+
var MissingAssetError2 = MissingAssetError;
|
|
116
|
+
var fonts2 = fonts;
|
|
117
|
+
var images2 = images;
|
|
118
|
+
var sounds2 = sounds;
|
|
119
|
+
var music2 = music;
|
|
120
|
+
var Clock2 = Clock;
|
|
121
|
+
var clock2 = clock;
|
|
122
|
+
var Rect2 = Rect;
|
|
123
|
+
var ZRect2 = ZRect;
|
|
124
|
+
var angleTo2 = angleTo;
|
|
125
|
+
var distanceTo2 = distanceTo;
|
|
126
|
+
var clamp2 = clamp;
|
|
127
|
+
var randomChoice2 = randomChoice;
|
|
128
|
+
var randomInt2 = randomInt;
|
|
129
|
+
var KeyboardState2 = KeyboardState;
|
|
130
|
+
var keyboard2 = keyboard;
|
|
131
|
+
var keymods2 = keymods;
|
|
132
|
+
var keys2 = keys;
|
|
133
|
+
var mouse2 = mouse;
|
|
134
|
+
var Screen2 = Screen;
|
|
135
|
+
var screen2 = screen;
|
|
136
|
+
var rgb2 = rgb;
|
|
137
|
+
var defineGame2 = defineGame;
|
|
138
|
+
var exit2 = exit;
|
|
139
|
+
var run2 = run;
|
|
140
|
+
var JsonStorageError2 = JsonStorageError;
|
|
141
|
+
var Storage2 = Storage;
|
|
142
|
+
var storage2 = storage;
|
|
143
|
+
var CreatedTone2 = CreatedTone;
|
|
144
|
+
var DEFAULT_TONE_VOLUME2 = DEFAULT_TONE_VOLUME;
|
|
145
|
+
var tone2 = tone;
|
|
146
|
+
var AudioUnlockState2 = AudioUnlockState;
|
|
147
|
+
var BrowserSoundAsset2 = BrowserSoundAsset;
|
|
148
|
+
var InputDispatcher2 = InputDispatcher;
|
|
149
|
+
var MusicPlayer2 = MusicPlayer;
|
|
150
|
+
var ToneGenerator2 = ToneGenerator;
|
|
151
|
+
var assetUrl2 = assetUrl;
|
|
152
|
+
var audioUnlock2 = audioUnlock;
|
|
153
|
+
var buttonsFromBrowserButtons2 = buttonsFromBrowserButtons;
|
|
154
|
+
var clampVolume2 = clampVolume;
|
|
155
|
+
var collectRuntimeDiagnostics2 = collectRuntimeDiagnostics;
|
|
156
|
+
var createAssetLoaders2 = createAssetLoaders;
|
|
157
|
+
var createBrowserSoundAsset2 = createBrowserSoundAsset;
|
|
158
|
+
var createFontLoader2 = createFontLoader;
|
|
159
|
+
var createImageLoader2 = createImageLoader;
|
|
160
|
+
var createInputDispatcher2 = createInputDispatcher;
|
|
161
|
+
var createLocalStorageAdapter2 = createLocalStorageAdapter;
|
|
162
|
+
var createMusicLoader2 = createMusicLoader;
|
|
163
|
+
var createMusicPlayer2 = createMusicPlayer;
|
|
164
|
+
var createSoundLoader2 = createSoundLoader;
|
|
165
|
+
var createStorage2 = createStorage;
|
|
166
|
+
var createToneGenerator2 = createToneGenerator;
|
|
167
|
+
var dispatchHook2 = dispatchHook;
|
|
168
|
+
var fitTextboxFontSize2 = fitTextboxFontSize;
|
|
169
|
+
var getParameterNames2 = getParameterNames;
|
|
170
|
+
var getScreen2 = getScreen;
|
|
171
|
+
var layoutText2 = layoutText;
|
|
172
|
+
var mapBrowserKeyEvent2 = mapBrowserKeyEvent;
|
|
173
|
+
var mapBrowserMouseButton2 = mapBrowserMouseButton;
|
|
174
|
+
var mapBrowserMouseEvent2 = mapBrowserMouseEvent;
|
|
175
|
+
var mapBrowserWheelEvent2 = mapBrowserWheelEvent;
|
|
176
|
+
var normalizeColor2 = normalizeColor;
|
|
177
|
+
var normalizeWaveform2 = normalizeWaveform;
|
|
178
|
+
var noteToFrequency2 = noteToFrequency;
|
|
179
|
+
var parseToneFrequency2 = parseToneFrequency;
|
|
180
|
+
var setScreen2 = setScreen;
|
|
181
|
+
var validateAssetName2 = validateAssetName;
|
|
182
|
+
export {
|
|
183
|
+
validateAssetName2 as validateAssetName,
|
|
184
|
+
tweens2 as tweens,
|
|
185
|
+
tweenNames2 as tweenNames,
|
|
186
|
+
tone2 as tone,
|
|
187
|
+
storage2 as storage,
|
|
188
|
+
sounds2 as sounds,
|
|
189
|
+
setScreen2 as setScreen,
|
|
190
|
+
screen2 as screen,
|
|
191
|
+
run2 as run,
|
|
192
|
+
rgb2 as rgb,
|
|
193
|
+
randomInt2 as randomInt,
|
|
194
|
+
randomChoice2 as randomChoice,
|
|
195
|
+
parseToneFrequency2 as parseToneFrequency,
|
|
196
|
+
noteToFrequency2 as noteToFrequency,
|
|
197
|
+
normalizeWaveform2 as normalizeWaveform,
|
|
198
|
+
normalizeColor2 as normalizeColor,
|
|
199
|
+
music2 as music,
|
|
200
|
+
mouse2 as mouse,
|
|
201
|
+
mapBrowserWheelEvent2 as mapBrowserWheelEvent,
|
|
202
|
+
mapBrowserMouseEvent2 as mapBrowserMouseEvent,
|
|
203
|
+
mapBrowserMouseButton2 as mapBrowserMouseButton,
|
|
204
|
+
mapBrowserKeyEvent2 as mapBrowserKeyEvent,
|
|
205
|
+
layoutText2 as layoutText,
|
|
206
|
+
keys2 as keys,
|
|
207
|
+
keymods2 as keymods,
|
|
208
|
+
keyboard2 as keyboard,
|
|
209
|
+
images2 as images,
|
|
210
|
+
getScreen2 as getScreen,
|
|
211
|
+
getParameterNames2 as getParameterNames,
|
|
212
|
+
fonts2 as fonts,
|
|
213
|
+
fitTextboxFontSize2 as fitTextboxFontSize,
|
|
214
|
+
exit2 as exit,
|
|
215
|
+
distanceTo2 as distanceTo,
|
|
216
|
+
dispatchHook2 as dispatchHook,
|
|
217
|
+
defineGame2 as defineGame,
|
|
218
|
+
createToneGenerator2 as createToneGenerator,
|
|
219
|
+
createStorage2 as createStorage,
|
|
220
|
+
createSoundLoader2 as createSoundLoader,
|
|
221
|
+
createMusicPlayer2 as createMusicPlayer,
|
|
222
|
+
createMusicLoader2 as createMusicLoader,
|
|
223
|
+
createLocalStorageAdapter2 as createLocalStorageAdapter,
|
|
224
|
+
createInputDispatcher2 as createInputDispatcher,
|
|
225
|
+
createImageLoader2 as createImageLoader,
|
|
226
|
+
createFontLoader2 as createFontLoader,
|
|
227
|
+
createBrowserSoundAsset2 as createBrowserSoundAsset,
|
|
228
|
+
createAssetLoaders2 as createAssetLoaders,
|
|
229
|
+
collectRuntimeDiagnostics2 as collectRuntimeDiagnostics,
|
|
230
|
+
clock2 as clock,
|
|
231
|
+
clampVolume2 as clampVolume,
|
|
232
|
+
clamp2 as clamp,
|
|
233
|
+
buttonsFromBrowserButtons2 as buttonsFromBrowserButtons,
|
|
234
|
+
audioUnlock2 as audioUnlock,
|
|
235
|
+
assetUrl2 as assetUrl,
|
|
236
|
+
animate2 as animate,
|
|
237
|
+
angleTo2 as angleTo,
|
|
238
|
+
ZRect2 as ZRect,
|
|
239
|
+
ValueError2 as ValueError,
|
|
240
|
+
ToneGenerator2 as ToneGenerator,
|
|
241
|
+
Storage2 as Storage,
|
|
242
|
+
Screen2 as Screen,
|
|
243
|
+
Rect2 as Rect,
|
|
244
|
+
MusicPlayer2 as MusicPlayer,
|
|
245
|
+
MissingAssetError2 as MissingAssetError,
|
|
246
|
+
KeyboardState2 as KeyboardState,
|
|
247
|
+
JsonStorageError2 as JsonStorageError,
|
|
248
|
+
InvalidAssetNameError2 as InvalidAssetNameError,
|
|
249
|
+
InputDispatcher2 as InputDispatcher,
|
|
250
|
+
ImageSurface2 as ImageSurface,
|
|
251
|
+
DEFAULT_TONE_VOLUME2 as DEFAULT_TONE_VOLUME,
|
|
252
|
+
CreatedTone2 as CreatedTone,
|
|
253
|
+
Clock2 as Clock,
|
|
254
|
+
BrowserSoundAsset2 as BrowserSoundAsset,
|
|
255
|
+
AudioUnlockState2 as AudioUnlockState,
|
|
256
|
+
Animation2 as Animation,
|
|
257
|
+
Actor2 as Actor
|
|
258
|
+
};
|