@moku-labs/game 0.0.3 → 0.2.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/README.md +119 -767
- package/bin/moku-game-assets.mjs +4 -0
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-BOxqlv7w.d.mts → commands-C0BljsM5.d.mts} +4 -4
- package/dist/control.d.mts +3 -3
- package/dist/{define-BMo0pHe_.d.mts → define-CjP_4H0G.d.mts} +1 -1
- package/dist/index.d.mts +192 -319
- package/dist/index.mjs +7036 -6405
- package/dist/inspect.d.mts +7 -7
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-BstIkrhH.d.mts → runtime-Bn5TXNxP.d.mts} +1 -1
- package/dist/testing.d.mts +44 -21
- package/dist/testing.mjs +113 -43
- package/dist/{types-Cjf3ywai.d.mts → types-BZ1OLf24.d.mts} +20 -3
- package/dist/{types-DgwbzDLP.d.mts → types-C47fKNcn.d.mts} +7 -2
- package/dist/{types-KlE_GL1z.d.mts → types-CqkrEY06.d.mts} +296 -6
- package/dist/{types-BTycq8_Z.d.mts → types-CxZy7Pi4.d.mts} +31 -17
- package/dist/{types-D0uYTTC3.d.mts → types-DmhTHRVW.d.mts} +1 -1
- package/dist/{types-C0SLQsx0.d.mts → types-X9jXjka3.d.mts} +1 -1
- package/fonts/LICENSE.txt +105 -0
- package/fonts/font-body.fnt +372 -0
- package/fonts/font-body.png +0 -0
- package/llms.txt +536 -0
- package/package.json +14 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { $t as types_d_exports$3, At as Json, B as Mut, Bt as StoreApi, Ct as Config$
|
|
2
|
-
import { a as DefineBundles, c as LoadReason, d as Tier, i as Config$
|
|
3
|
-
import { A as Transform, B as types_d_exports$6, C as NineSliceValue, D as Sprite, E as ShapeValue, H as InputApi, I as I18nApi, L as Message, M as sprite, N as Argument, O as SpriteOptions, P as Config$
|
|
4
|
-
import { C as
|
|
5
|
-
import { A as FilterValueOf, C as EmitterValue, D as DisplacementValue, E as ColorMatrixValue, M as NoiseValue, N as OutlineValue, O as FilterComponent, P as UniformDeclaration, S as EmitterDefinition, T as BlurValue, _ as EffectsApi, b as types_d_exports$4, c as AnySceneProjection, d as SceneDefinition, f as SceneSpec, g as Config$
|
|
1
|
+
import { $t as types_d_exports$3, At as Json, B as Mut, Bt as StoreApi, Ct as Config$6, D as ProjectionMotion, E as NumericFields, Et as types_d_exports$14, F as ComponentHandle, G as SystemDefinition, Gt as Events, I as ComponentType, J as BundlesOf, Jt as types_d_exports$8, K as TagType, Kt as PauseReason, L as ComponentValue, Mt as State$4, Nt as types_d_exports$9, O as ProjectionSpec, Ot as Config$4, Pt as Patch, Q as GameTypes, Qt as State$1, Rt as SaveUnreadableError, St as Api$4, U as QueryTerm, Ut as Api$2, V as Narrowed, Vt as RngApi, W as ResourceType, Wt as Config$3, X as EmitterIdOf, Xt as Config$1, Y as Config$2, Yt as Api, Z as FeaturePlugin, _ as State$7, at as slot, b as DescriptionNode, bt as Hint, c as types_d_exports$11, ct as FeatureDescription, en as Config$8, et as State$2, g as Config$7, gt as SceneIdOf, h as Api$5, it as exit, jt as Root, m as ViewportSize, n as Config$5, nn as Require, nt as types_d_exports$5, ot as to, q as Api$1, qt as State$3, rt as defineFlow, s as State$5, st as type, t as Api$3, tn as Events$1, tt as TextStylesOf, ut as DefineNode, v as types_d_exports$16, vt as Descriptor, wt as State$6, x as Ease, yt as GuideOptions } from "./types-BZ1OLf24.mjs";
|
|
2
|
+
import { a as DefineBundles, c as LoadReason, d as Tier, i as Config$9, n as BundleMap, p as types_d_exports$1, r as BundleSpec, s as LoadBundles, t as Api$6, u as State$8 } from "./types-C47fKNcn.mjs";
|
|
3
|
+
import { A as Transform, B as types_d_exports$6, C as NineSliceValue, D as Sprite, E as ShapeValue, H as InputApi, I as I18nApi, L as Message, M as sprite, N as Argument, O as SpriteOptions, P as Config$10, R as State$9, S as NineSlice, T as Shape, U as State$10, V as Config$11, W as types_d_exports$7, _ as Style, b as defineComponent, d as popup, f as defineTokens, g as ResolvedStyle, h as IsFlags, j as TransformValue, k as SpriteValue, l as Box, p as IntrinsicElementsFor, s as PopupComponent, u as LocalWrite, w as Parent, x as Display, y as WhenFlags, z as TypedTr } from "./types-X9jXjka3.mjs";
|
|
4
|
+
import { A as UiApi, C as spawned, D as wait, E as use, F as TextApi, I as TextStyleInput, L as TextStyles, M as Config$13, N as Point, O as Config$14, P as State$12, R as TextValue, S as spawn, T as tween, _ as parallel, a as State$11, b as set, c as HapticKind, d as HAPTIC_KINDS, f as defineAnimation, g as mark, h as haptic, i as MotionKeyframe, j as types_d_exports$15, k as State$13, l as SfxDescriptor, m as frames, n as Config$12, o as Target, p as external, r as FramesValue, s as types_d_exports, t as AnimApi, u as Step, v as play, w as stagger, x as sfx, y as sequence, z as types_d_exports$13 } from "./types-CqkrEY06.mjs";
|
|
5
|
+
import { A as FilterValueOf, C as EmitterValue, D as DisplacementValue, E as ColorMatrixValue, M as NoiseValue, N as OutlineValue, O as FilterComponent, P as UniformDeclaration, S as EmitterDefinition, T as BlurValue, _ as EffectsApi, b as types_d_exports$4, c as AnySceneProjection, d as SceneDefinition, f as SceneSpec, g as Config$16, h as types_d_exports$12, i as MusicOptions, j as GlowValue, k as FilterSpec, l as DefineScene, m as State$16, n as Config$15, o as State$14, p as ScenesApi, r as MusicDescriptor, s as types_d_exports$2, t as AudioApi, u as LayerMap, w as AlphaValue, x as EmitterConfig, y as State$15 } from "./types-CxZy7Pi4.mjs";
|
|
6
|
+
import { Log } from "@moku-labs/common/browser";
|
|
7
|
+
import { PluginCtx } from "@moku-labs/core";
|
|
6
8
|
|
|
7
9
|
//#region src/plugins/text/components.d.ts
|
|
8
10
|
/**
|
|
@@ -111,7 +113,7 @@ type ProjectionFor<Player, Session> = <const LayerName extends string, const Lif
|
|
|
111
113
|
* app.anim.play(coinsFly, { from: purse, to: counter }).marks(); // []: the first frame is next
|
|
112
114
|
* ```
|
|
113
115
|
*/
|
|
114
|
-
declare const animPlugin: import("@moku-labs/core").PluginInstance<"anim", Config$
|
|
116
|
+
declare const animPlugin: import("@moku-labs/core").PluginInstance<"anim", Config$12, State$11, AnimApi, {
|
|
115
117
|
"anim:mark": {
|
|
116
118
|
animation: string;
|
|
117
119
|
mark: string;
|
|
@@ -137,7 +139,7 @@ declare const animPlugin: import("@moku-labs/core").PluginInstance<"anim", Confi
|
|
|
137
139
|
* app.assets.usage().textureMb; // 0.188, the boot tier
|
|
138
140
|
* ```
|
|
139
141
|
*/
|
|
140
|
-
declare const assetsPlugin: import("@moku-labs/core").PluginInstance<"assets", Config$
|
|
142
|
+
declare const assetsPlugin: import("@moku-labs/core").PluginInstance<"assets", Config$9, State$8, Api$6, {
|
|
141
143
|
"assets:bundle-loaded": {
|
|
142
144
|
bundle: string;
|
|
143
145
|
tier: Tier;
|
|
@@ -172,7 +174,7 @@ declare const assetsPlugin: import("@moku-labs/core").PluginInstance<"assets", C
|
|
|
172
174
|
* });
|
|
173
175
|
* ```
|
|
174
176
|
*/
|
|
175
|
-
declare const audioPlugin: import("@moku-labs/core").PluginInstance<"audio", Config$
|
|
177
|
+
declare const audioPlugin: import("@moku-labs/core").PluginInstance<"audio", Config$15, State$14, AudioApi, {}> & Record<never, never>;
|
|
176
178
|
//#endregion
|
|
177
179
|
//#region src/plugins/clock/index.d.ts
|
|
178
180
|
/**
|
|
@@ -187,7 +189,7 @@ declare const audioPlugin: import("@moku-labs/core").PluginInstance<"audio", Con
|
|
|
187
189
|
* });
|
|
188
190
|
* ```
|
|
189
191
|
*/
|
|
190
|
-
declare const clockPlugin: import("@moku-labs/core").PluginInstance<"clock", Config, State, Api, {}> & Record<never, never>;
|
|
192
|
+
declare const clockPlugin: import("@moku-labs/core").PluginInstance<"clock", Config$1, State$1, Api, {}> & Record<never, never>;
|
|
191
193
|
//#endregion
|
|
192
194
|
//#region src/plugins/effects/index.d.ts
|
|
193
195
|
/**
|
|
@@ -204,7 +206,7 @@ declare const clockPlugin: import("@moku-labs/core").PluginInstance<"clock", Con
|
|
|
204
206
|
* app.effects.stats(); // { particles: 0, emitters: 0, filters: 0, renderPasses: 0 }: nothing runs before start
|
|
205
207
|
* ```
|
|
206
208
|
*/
|
|
207
|
-
declare const effectsPlugin: import("@moku-labs/core").PluginInstance<"effects", Config$
|
|
209
|
+
declare const effectsPlugin: import("@moku-labs/core").PluginInstance<"effects", Config$16, State$15, EffectsApi, {}> & Record<never, never>;
|
|
208
210
|
//#endregion
|
|
209
211
|
//#region src/plugins/flow/index.d.ts
|
|
210
212
|
/**
|
|
@@ -221,7 +223,7 @@ declare const effectsPlugin: import("@moku-labs/core").PluginInstance<"effects",
|
|
|
221
223
|
* });
|
|
222
224
|
* ```
|
|
223
225
|
*/
|
|
224
|
-
declare const flowPlugin: import("@moku-labs/core").PluginInstance<"flow", Config$
|
|
226
|
+
declare const flowPlugin: import("@moku-labs/core").PluginInstance<"flow", Config$2, State$2, Api$1, {
|
|
225
227
|
"flow:edge": {
|
|
226
228
|
flow: string;
|
|
227
229
|
node: string;
|
|
@@ -262,7 +264,7 @@ declare const flowPlugin: import("@moku-labs/core").PluginInstance<"flow", Confi
|
|
|
262
264
|
* await app.i18n.setLocale("en"); // text re-resolves every message on i18n:locale-changed
|
|
263
265
|
* ```
|
|
264
266
|
*/
|
|
265
|
-
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$
|
|
267
|
+
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$10, State$9, I18nApi, {
|
|
266
268
|
"i18n:locale-changed": {
|
|
267
269
|
locale: string;
|
|
268
270
|
};
|
|
@@ -287,7 +289,7 @@ declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Confi
|
|
|
287
289
|
* });
|
|
288
290
|
* ```
|
|
289
291
|
*/
|
|
290
|
-
declare const inputPlugin: import("@moku-labs/core").PluginInstance<"input", Config$
|
|
292
|
+
declare const inputPlugin: import("@moku-labs/core").PluginInstance<"input", Config$11, State$10, InputApi, {}> & Record<never, never>;
|
|
291
293
|
//#endregion
|
|
292
294
|
//#region src/plugins/lifecycle/index.d.ts
|
|
293
295
|
/**
|
|
@@ -302,7 +304,7 @@ declare const inputPlugin: import("@moku-labs/core").PluginInstance<"input", Con
|
|
|
302
304
|
* });
|
|
303
305
|
* ```
|
|
304
306
|
*/
|
|
305
|
-
declare const lifecyclePlugin: import("@moku-labs/core").PluginInstance<"lifecycle", Config$
|
|
307
|
+
declare const lifecyclePlugin: import("@moku-labs/core").PluginInstance<"lifecycle", Config$3, State$3, Api$2, {
|
|
306
308
|
"lifecycle:changed": {
|
|
307
309
|
reason: PauseReason;
|
|
308
310
|
action: "push" | "pop";
|
|
@@ -327,7 +329,7 @@ declare const lifecyclePlugin: import("@moku-labs/core").PluginInstance<"lifecyc
|
|
|
327
329
|
* });
|
|
328
330
|
* ```
|
|
329
331
|
*/
|
|
330
|
-
declare const modelPlugin: import("@moku-labs/core").PluginInstance<"model", Config$
|
|
332
|
+
declare const modelPlugin: import("@moku-labs/core").PluginInstance<"model", Config$4, State$4, {
|
|
331
333
|
store: StoreApi;
|
|
332
334
|
rng: RngApi;
|
|
333
335
|
}, {
|
|
@@ -336,6 +338,141 @@ declare const modelPlugin: import("@moku-labs/core").PluginInstance<"model", Con
|
|
|
336
338
|
cause: "edge" | "rollback" | "restore" | "load";
|
|
337
339
|
};
|
|
338
340
|
}> & Record<never, never>;
|
|
341
|
+
declare namespace types_d_exports$10 {
|
|
342
|
+
export { BackResult, Config, HapticKind, KernelSlice, LifecycleChanged, PlatformApi, PlatformProvider, ProviderMethod, State };
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* The seam a game fills, usually from `@moku-labs/system` in its own bridge. The engine never
|
|
346
|
+
* imports a native package: the provider is built in the application layer. Every `on*` returns
|
|
347
|
+
* its remover, which the plugin calls on stop.
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```ts
|
|
351
|
+
* // A headless test drives the plugin with a fake of six functions.
|
|
352
|
+
* const ticks: string[] = [];
|
|
353
|
+
* const provider: PlatformProvider = {
|
|
354
|
+
* onPause: () => () => undefined,
|
|
355
|
+
* onResume: () => () => undefined,
|
|
356
|
+
* onBack: () => () => undefined,
|
|
357
|
+
* haptic: kind => ticks.push(kind),
|
|
358
|
+
* keepAwake: () => undefined,
|
|
359
|
+
* exit: () => undefined
|
|
360
|
+
* };
|
|
361
|
+
* createApp({ plugins: [...screen, platformPlugin], pluginConfigs: { platform: { provider } } });
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
type PlatformProvider = {
|
|
365
|
+
/** Calls `fn` when the app goes to the background. Returns the remover. */onPause(fn: () => void): () => void; /** Calls `fn` when the app comes back to the foreground. Returns the remover. */
|
|
366
|
+
onResume(fn: () => void): () => void;
|
|
367
|
+
/**
|
|
368
|
+
* Calls `fn` on every press of the system Back button. `fn` returns whether the engine took the
|
|
369
|
+
* press; `false` lets the provider do its default, which on Android leaves the app.
|
|
370
|
+
*/
|
|
371
|
+
onBack(fn: () => boolean): () => void; /** Plays one haptic tick. */
|
|
372
|
+
haptic(kind: HapticKind): void; /** Keeps the screen on while `on` is true. */
|
|
373
|
+
keepAwake(on: boolean): void; /** Leaves the app. */
|
|
374
|
+
exit(): void;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* What took one Back press: the Escape button of the top popup, the intent `back` of the resting
|
|
378
|
+
* node, the provider leaving the app, or nothing at all because the app has no provider.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* ```ts
|
|
382
|
+
* // Home rests and does not list "back": the provider leaves the app.
|
|
383
|
+
* const result: BackResult = app.platform.back(); // "exit"
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
type BackResult = "popup" | "intent" | "exit" | "none";
|
|
387
|
+
/**
|
|
388
|
+
* What a game sets on `pluginConfigs.platform`: the provider seam its application layer fills
|
|
389
|
+
* from the native shell, and whether the screen stays on while the game runs.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```ts
|
|
393
|
+
* // app.ts of a game in the native shell; `provider` is the game's own bridge to the shell.
|
|
394
|
+
* const config: Platform.Config = { provider, keepAwake: true };
|
|
395
|
+
* config.keepAwake; // true
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
398
|
+
type Config = {
|
|
399
|
+
/** The provider. `undefined`, the default: the plugin is inert, as on the web without a bridge and in headless tests. */provider: PlatformProvider | undefined; /** Keep the screen on while the game runs. Default `false`. */
|
|
400
|
+
keepAwake: boolean;
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* platform plugin state.
|
|
404
|
+
*/
|
|
405
|
+
type State = {
|
|
406
|
+
/** Whether `provider.keepAwake(true)` is in force. */awake: boolean; /** Removers of the provider subscriptions and of the haptic handler, called on stop. */
|
|
407
|
+
offs: Array<() => void>; /** Haptic kinds already warned about in a dev build, so each warns once. */
|
|
408
|
+
warned: Set<string>;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* platform plugin API, `app.platform`. The rest of the plugin runs on its own: the provider's
|
|
412
|
+
* pause, resume and Back press, the `haptic` effect and keep-awake need no call.
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```ts
|
|
416
|
+
* // An e2e test plays the Android Back button on Home, which rests without "back".
|
|
417
|
+
* app.platform.back(); // "exit": the provider leaves the app
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
type PlatformApi = {
|
|
421
|
+
/**
|
|
422
|
+
* Runs the Back chain once, exactly as a press of the system Back button does. The first step
|
|
423
|
+
* that takes the press wins: Escape taps the `escape` button of the top ui root (`"popup"`),
|
|
424
|
+
* then the intent `back` is answered to the resting node (`"intent"`), and otherwise the
|
|
425
|
+
* provider leaves the app (`"exit"`). While the graph moves between nodes the gate is closed and
|
|
426
|
+
* holds the answer for one frame, so the press answers `"intent"` and never leaves the app.
|
|
427
|
+
* Escape also ends the editing of a ui text field, so a
|
|
428
|
+
* press while a field is edited ends the edit and answers `"popup"`. Without a provider nothing
|
|
429
|
+
* is pressed and the answer is `"none"`.
|
|
430
|
+
*
|
|
431
|
+
* @returns What took the press.
|
|
432
|
+
* @example
|
|
433
|
+
* ```ts
|
|
434
|
+
* // An e2e test plays the Android Back button over the settings popup, then on Home.
|
|
435
|
+
* app.platform.back(); // "popup": the settings popup was open and closed like Escape
|
|
436
|
+
* // ...the runner settles on Home, which does not list "back"...
|
|
437
|
+
* app.platform.back(); // "exit": the provider leaves the app
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
back(): BackResult;
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* What the kernel context offers the files of the plugin.
|
|
444
|
+
*
|
|
445
|
+
* `platform` owns no event, so `emit` is the kernel's and never called here.
|
|
446
|
+
*/
|
|
447
|
+
type KernelSlice = PluginCtx<Config, State> & {
|
|
448
|
+
readonly global: object;
|
|
449
|
+
readonly log: Log.LogApi;
|
|
450
|
+
readonly require: Require;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Payload of the `lifecycle:changed` hook: the pause that releases keep-awake.
|
|
454
|
+
*/
|
|
455
|
+
type LifecycleChanged = Events["lifecycle:changed"];
|
|
456
|
+
/**
|
|
457
|
+
* A method of the provider, named in the log when it throws.
|
|
458
|
+
*/
|
|
459
|
+
type ProviderMethod = keyof PlatformProvider;
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/plugins/platform/index.d.ts
|
|
462
|
+
/**
|
|
463
|
+
* Platform plugin: `app.platform`, the handler of the effect kind `haptic`, and the provider's
|
|
464
|
+
* pause, resume and Back press. Inert without a provider.
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```ts
|
|
468
|
+
* // A game in the native shell composes it last and hands it the bridge it built.
|
|
469
|
+
* createApp({
|
|
470
|
+
* plugins: [...screen, effectsPlugin, audioPlugin, platformPlugin, ...features],
|
|
471
|
+
* pluginConfigs: { platform: { provider: fromSystem(system), keepAwake: true } }
|
|
472
|
+
* });
|
|
473
|
+
* ```
|
|
474
|
+
*/
|
|
475
|
+
declare const platformPlugin: import("@moku-labs/core").PluginInstance<"platform", Config, State, PlatformApi, {}> & Record<never, never>;
|
|
339
476
|
//#endregion
|
|
340
477
|
//#region src/plugins/renderer/index.d.ts
|
|
341
478
|
/**
|
|
@@ -354,7 +491,7 @@ declare const modelPlugin: import("@moku-labs/core").PluginInstance<"model", Con
|
|
|
354
491
|
* app.renderer.host.kind(); // "webgpu" in Chrome, "webgl" on an older device
|
|
355
492
|
* ```
|
|
356
493
|
*/
|
|
357
|
-
declare const rendererPlugin: import("@moku-labs/core").PluginInstance<"renderer", Config$
|
|
494
|
+
declare const rendererPlugin: import("@moku-labs/core").PluginInstance<"renderer", Config$5, State$5, Api$3, {
|
|
358
495
|
"renderer:device-lost": {
|
|
359
496
|
kind: "webgpu" | "webgl";
|
|
360
497
|
reason: string;
|
|
@@ -377,7 +514,7 @@ declare const rendererPlugin: import("@moku-labs/core").PluginInstance<"renderer
|
|
|
377
514
|
* export const awaitIntent = defineNode({ scene: "board", rest: true, outcomes: { merge: type() } });
|
|
378
515
|
* ```
|
|
379
516
|
*/
|
|
380
|
-
declare const scenesPlugin: import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$
|
|
517
|
+
declare const scenesPlugin: import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$16, ScenesApi, {
|
|
381
518
|
"scenes:changed": {
|
|
382
519
|
from: string | undefined;
|
|
383
520
|
to: string;
|
|
@@ -402,7 +539,7 @@ declare const scenesPlugin: import("@moku-labs/core").PluginInstance<"scenes", R
|
|
|
402
539
|
* app.text.styles(); // ["body", "digits", "hud.digits"]
|
|
403
540
|
* ```
|
|
404
541
|
*/
|
|
405
|
-
declare const textPlugin: import("@moku-labs/core").PluginInstance<"text", Config$
|
|
542
|
+
declare const textPlugin: import("@moku-labs/core").PluginInstance<"text", Config$13, State$12, TextApi, {}> & Record<never, never>;
|
|
406
543
|
//#endregion
|
|
407
544
|
//#region src/plugins/time/index.d.ts
|
|
408
545
|
/**
|
|
@@ -417,7 +554,7 @@ declare const textPlugin: import("@moku-labs/core").PluginInstance<"text", Confi
|
|
|
417
554
|
* });
|
|
418
555
|
* ```
|
|
419
556
|
*/
|
|
420
|
-
declare const timePlugin: import("@moku-labs/core").PluginInstance<"time", Config$
|
|
557
|
+
declare const timePlugin: import("@moku-labs/core").PluginInstance<"time", Config$6, State$6, Api$4, {}> & Record<never, never>;
|
|
421
558
|
//#endregion
|
|
422
559
|
//#region src/plugins/ui/index.d.ts
|
|
423
560
|
/**
|
|
@@ -434,7 +571,7 @@ declare const timePlugin: import("@moku-labs/core").PluginInstance<"time", Confi
|
|
|
434
571
|
* app.input.tap(app.ui.find("claim") ?? 0);
|
|
435
572
|
* ```
|
|
436
573
|
*/
|
|
437
|
-
declare const uiPlugin: import("@moku-labs/core").PluginInstance<"ui", Config$
|
|
574
|
+
declare const uiPlugin: import("@moku-labs/core").PluginInstance<"ui", Config$14, State$13, UiApi, {}> & Record<never, never>;
|
|
438
575
|
//#endregion
|
|
439
576
|
//#region src/plugins/world/index.d.ts
|
|
440
577
|
/**
|
|
@@ -450,7 +587,7 @@ declare const uiPlugin: import("@moku-labs/core").PluginInstance<"ui", Config$13
|
|
|
450
587
|
* app.world.projection.entityOf("board.items", "i7"); // 1048576
|
|
451
588
|
* ```
|
|
452
589
|
*/
|
|
453
|
-
declare const worldPlugin: import("@moku-labs/core").PluginInstance<"world", Config$
|
|
590
|
+
declare const worldPlugin: import("@moku-labs/core").PluginInstance<"world", Config$7, State$7, Api$5, {
|
|
454
591
|
"world:reconciled": {
|
|
455
592
|
mode: "play" | "direct";
|
|
456
593
|
projections: number;
|
|
@@ -921,276 +1058,6 @@ type MotionSpec = {
|
|
|
921
1058
|
*/
|
|
922
1059
|
declare function defineMotion(spec: MotionSpec): ProjectionMotion<unknown>;
|
|
923
1060
|
//#endregion
|
|
924
|
-
//#region src/plugins/anim/timeline/steps.d.ts
|
|
925
|
-
/**
|
|
926
|
-
* Runs the steps one after another. The remainder past a step's end reaches the next step in the
|
|
927
|
-
* same frame, so the tree takes exactly the sum of its durations.
|
|
928
|
-
*
|
|
929
|
-
* @param steps - The steps, in order.
|
|
930
|
-
* @returns The sequence step.
|
|
931
|
-
* @example
|
|
932
|
-
* ```ts
|
|
933
|
-
* sequence(wait(100), mark("done"));
|
|
934
|
-
* // { kind: "sequence", steps: [{ kind: "wait", ms: 100 }, { kind: "mark", name: "done" }] }
|
|
935
|
-
* ```
|
|
936
|
-
*/
|
|
937
|
-
declare function sequence(...steps: readonly Step[]): Step;
|
|
938
|
-
/**
|
|
939
|
-
* Runs every step at once and ends with the longest one.
|
|
940
|
-
*
|
|
941
|
-
* @param steps - The steps.
|
|
942
|
-
* @returns The parallel step.
|
|
943
|
-
* @example
|
|
944
|
-
* ```ts
|
|
945
|
-
* parallel(wait(100), wait(300)); // ends after 300 ms
|
|
946
|
-
* ```
|
|
947
|
-
*/
|
|
948
|
-
declare function parallel(...steps: readonly Step[]): Step;
|
|
949
|
-
/**
|
|
950
|
-
* Builds one step per item and starts each one `staggerMs` later than the one before. The build
|
|
951
|
-
* function runs here, so no function survives in the data.
|
|
952
|
-
*
|
|
953
|
-
* @param items - What to build a step for.
|
|
954
|
-
* @param staggerMs - Delay between two neighbouring items, in game milliseconds.
|
|
955
|
-
* @param build - Builds the step of one item.
|
|
956
|
-
* @returns The parallel of delayed sequences.
|
|
957
|
-
* @example
|
|
958
|
-
* ```ts
|
|
959
|
-
* stagger(["a", "b"], 60, item => mark(item));
|
|
960
|
-
* // parallel(sequence(wait(0), mark("a")), sequence(wait(60), mark("b")))
|
|
961
|
-
* ```
|
|
962
|
-
*/
|
|
963
|
-
declare function stagger<Item>(items: readonly Item[], staggerMs: number, build: (item: Item, index: number) => Step): Step;
|
|
964
|
-
/**
|
|
965
|
-
* Holds still for a while.
|
|
966
|
-
*
|
|
967
|
-
* @param durationMs - How long to wait, in game milliseconds.
|
|
968
|
-
* @returns The wait step.
|
|
969
|
-
* @example
|
|
970
|
-
* ```ts
|
|
971
|
-
* wait(120); // { kind: "wait", ms: 120 }
|
|
972
|
-
* ```
|
|
973
|
-
*/
|
|
974
|
-
declare function wait(durationMs: number): Step;
|
|
975
|
-
/**
|
|
976
|
-
* Names a point in the choreography. Reaching it emits `anim:mark`, calls the `onMark` listeners
|
|
977
|
-
* and appends the name to `marks()`. It is the only way out of a timeline.
|
|
978
|
-
*
|
|
979
|
-
* @param name - Name of the mark.
|
|
980
|
-
* @returns The mark step.
|
|
981
|
-
* @example
|
|
982
|
-
* ```ts
|
|
983
|
-
* mark("landed"); // { kind: "mark", name: "landed" }
|
|
984
|
-
* ```
|
|
985
|
-
*/
|
|
986
|
-
declare function mark(name: string): Step;
|
|
987
|
-
/**
|
|
988
|
-
* Moves the numeric fields of one component of one target to an exact target value. The component
|
|
989
|
-
* is any handle `world.ecs` takes, so the kit's `Sprite` and `NineSlice` of `defineGame` pass as
|
|
990
|
-
* they are.
|
|
991
|
-
*
|
|
992
|
-
* By default the fields are local: they are written into the target's own `Transform`. With
|
|
993
|
-
* `space: "root"` the `x`, `y`, `rotation` and `scale` of a `Transform` are a root pose, the space
|
|
994
|
-
* `at()` answers in, and are turned into the space of the target's `Parent` when the track starts.
|
|
995
|
-
* That aims a hosted view, such as a board item inside the board slot, at another element. A
|
|
996
|
-
* field the step does not name stays where it is, so under a turned parent name `x` and `y`
|
|
997
|
-
* together. A target without a parent, and a component other than `Transform`, move as in the
|
|
998
|
-
* local space.
|
|
999
|
-
*
|
|
1000
|
-
* @param target - The projection key or the entity to animate.
|
|
1001
|
-
* @param component - The component to animate.
|
|
1002
|
-
* @param to - The numeric target fields.
|
|
1003
|
-
* @param options - Duration, easing, delay, the additive flag and the space of the fields.
|
|
1004
|
-
* @param options.ms - Duration in game milliseconds.
|
|
1005
|
-
* @param options.ease - Easing curve; `"out"` when omitted.
|
|
1006
|
-
* @param options.delayMs - How long the track waits before it reads its start values.
|
|
1007
|
-
* @param options.additive - `true` adds an offset instead of owning the fields.
|
|
1008
|
-
* @param options.space - `"root"` reads the `Transform` fields as a root pose; `"local"` when
|
|
1009
|
-
* omitted.
|
|
1010
|
-
* @returns The tween step.
|
|
1011
|
-
* @example
|
|
1012
|
-
* ```ts
|
|
1013
|
-
* // An order is delivered: the board item flies out of the scaled board slot onto the order card.
|
|
1014
|
-
* const deliverFly = defineAnimation("orders.deliverFly", {
|
|
1015
|
-
* slots: { item: type<Target>(), card: type<Target>() },
|
|
1016
|
-
* build: ({ item, card }, { at }) =>
|
|
1017
|
-
* tween(item, Transform, { x: at(card).x, y: at(card).y, scale: at(card).scale }, {
|
|
1018
|
-
* ms: 400, ease: "inCubic", space: "root"
|
|
1019
|
-
* })
|
|
1020
|
-
* });
|
|
1021
|
-
* app.anim.play(deliverFly, {
|
|
1022
|
-
* item: { projection: "board.items", key: "i1" },
|
|
1023
|
-
* card: { projection: "hud", key: "card0" }
|
|
1024
|
-
* });
|
|
1025
|
-
* // 400 ms later the item covers the card at the card's size; its Transform stays slot-local
|
|
1026
|
-
* ```
|
|
1027
|
-
*/
|
|
1028
|
-
declare function tween<Value extends object>(target: Target, component: ComponentHandle<Value>, to: Partial<NumericFields<Value>>, options: {
|
|
1029
|
-
ms: number;
|
|
1030
|
-
ease?: Ease;
|
|
1031
|
-
delayMs?: number;
|
|
1032
|
-
additive?: boolean;
|
|
1033
|
-
space?: "local" | "root";
|
|
1034
|
-
}): Step;
|
|
1035
|
-
/**
|
|
1036
|
-
* Writes a component patch at once. Any field may be written, not only the numeric ones. The
|
|
1037
|
-
* component is any handle `world.ecs` takes, the kit's `Sprite` and `NineSlice` included.
|
|
1038
|
-
*
|
|
1039
|
-
* @param target - The projection key or the entity to write.
|
|
1040
|
-
* @param component - The component to write.
|
|
1041
|
-
* @param patch - The fields to overwrite.
|
|
1042
|
-
* @returns The set step.
|
|
1043
|
-
* @example
|
|
1044
|
-
* ```ts
|
|
1045
|
-
* set({ projection: "hud", key: "coins" }, Sprite, { texture: "hud.coin-gold" });
|
|
1046
|
-
* // { kind: "set", patch: { texture: "hud.coin-gold" }, ... }
|
|
1047
|
-
* ```
|
|
1048
|
-
*/
|
|
1049
|
-
declare function set<Value extends object>(target: Target, component: ComponentHandle<Value>, patch: Partial<Value>): Step;
|
|
1050
|
-
/**
|
|
1051
|
-
* Plays a frame sprite: one texture key of the list per frame of `fps`, written into `Sprite`.
|
|
1052
|
-
*
|
|
1053
|
-
* @param target - The projection key or the entity to animate.
|
|
1054
|
-
* @param options - The keys, the frame rate and whether the list repeats.
|
|
1055
|
-
* @param options.keys - The texture keys, in play order.
|
|
1056
|
-
* @param options.fps - Frames per second of the list.
|
|
1057
|
-
* @param options.loop - `true` repeats the list until the step is finished.
|
|
1058
|
-
* @returns The frames step.
|
|
1059
|
-
* @example
|
|
1060
|
-
* ```ts
|
|
1061
|
-
* frames({ projection: "board", key: "c3" }, { keys: ["fx.pop-1", "fx.pop-2"], fps: 12 });
|
|
1062
|
-
* // { kind: "frames", keys: ["fx.pop-1", "fx.pop-2"], fps: 12, loop: false, ... }
|
|
1063
|
-
* ```
|
|
1064
|
-
*/
|
|
1065
|
-
declare function frames(target: Target, options: {
|
|
1066
|
-
keys: readonly string[];
|
|
1067
|
-
fps: number;
|
|
1068
|
-
loop?: boolean;
|
|
1069
|
-
}): Step;
|
|
1070
|
-
/**
|
|
1071
|
-
* Makes a temporary entity when the step is reached: a flying coin, a toast sign, a sparkle. The
|
|
1072
|
-
* entity is owned by `anim`, drawn in `layer` at `order`, and despawned when the timeline ends, is
|
|
1073
|
-
* finished or is cancelled. Later steps of the same timeline aim at it with `spawned(id)`.
|
|
1074
|
-
*
|
|
1075
|
-
* @param id - Name of the entity inside this timeline; one timeline spawns each id once.
|
|
1076
|
-
* @param components - The component values the entity starts with, as `world.ecs.spawn` takes.
|
|
1077
|
-
* @param options - Where the entity is drawn.
|
|
1078
|
-
* @param options.layer - The layer; `"ui"` when omitted.
|
|
1079
|
-
* @param options.order - The draw order inside the layer; `0` when omitted.
|
|
1080
|
-
* @returns The spawn step.
|
|
1081
|
-
* @example
|
|
1082
|
-
* ```ts
|
|
1083
|
-
* spawn("coin1", [Sprite({ texture: "ui.icon-coin" }), Transform({ x: 540, y: 900 })], { order: 50 });
|
|
1084
|
-
* // { kind: "spawn", id: "coin1", components: [...], layer: "ui", order: 50 }
|
|
1085
|
-
* ```
|
|
1086
|
-
*/
|
|
1087
|
-
declare function spawn(id: string, components: readonly AnyComponentValue[], options?: {
|
|
1088
|
-
layer?: string;
|
|
1089
|
-
order?: number;
|
|
1090
|
-
}): Step;
|
|
1091
|
-
/**
|
|
1092
|
-
* Aims a later step at the entity a `spawn` step of the same timeline made. Before that step is
|
|
1093
|
-
* reached nothing answers the id, so a step aimed at it ends silently.
|
|
1094
|
-
*
|
|
1095
|
-
* @param id - The id the `spawn` step was given.
|
|
1096
|
-
* @returns The target.
|
|
1097
|
-
* @example
|
|
1098
|
-
* ```ts
|
|
1099
|
-
* tween(spawned("coin1"), Transform, { x: 40, y: 120 }, { ms: 600, ease: "inCubic" });
|
|
1100
|
-
* // { kind: "tween", target: { spawned: "coin1" }, ... }
|
|
1101
|
-
* ```
|
|
1102
|
-
*/
|
|
1103
|
-
declare function spawned(id: string): {
|
|
1104
|
-
spawned: string;
|
|
1105
|
-
};
|
|
1106
|
-
/**
|
|
1107
|
-
* A sound. `anim` owns the descriptor because it sits below `audio`; `audio` owns the handler,
|
|
1108
|
-
* and a game without `audio` plays nothing and hears no error.
|
|
1109
|
-
*
|
|
1110
|
-
* @param key - Asset key of the sound.
|
|
1111
|
-
* @param options - The bus to play it on.
|
|
1112
|
-
* @param options.bus - `"sfx"` when omitted.
|
|
1113
|
-
* @returns The descriptor, usable as a timeline step and as `fx(...)` in a node.
|
|
1114
|
-
* @example
|
|
1115
|
-
* ```ts
|
|
1116
|
-
* sfx("board.merge"); // { kind: "sfx", payload: { key: "board.merge", bus: "sfx" }, cosmetic: true }
|
|
1117
|
-
* ```
|
|
1118
|
-
*/
|
|
1119
|
-
declare function sfx(key: string, options?: {
|
|
1120
|
-
bus?: string;
|
|
1121
|
-
}): SfxDescriptor;
|
|
1122
|
-
/**
|
|
1123
|
-
* A haptic tick. `platform` owns the handler; a device without one stays still.
|
|
1124
|
-
*
|
|
1125
|
-
* @param kind - Which tick to play, for example `"light"`.
|
|
1126
|
-
* @returns The descriptor, usable as a timeline step and as `fx(...)` in a node.
|
|
1127
|
-
* @example
|
|
1128
|
-
* ```ts
|
|
1129
|
-
* haptic("light"); // { kind: "haptic", payload: { kind: "light" }, cosmetic: true }
|
|
1130
|
-
* ```
|
|
1131
|
-
*/
|
|
1132
|
-
declare function haptic(kind: string): HapticDescriptor;
|
|
1133
|
-
/**
|
|
1134
|
-
* Reserved for Spine and the other external players. It throws until one arrives, so nobody
|
|
1135
|
-
* builds a choreography on a door that is not open yet.
|
|
1136
|
-
*
|
|
1137
|
-
* @param _player - The player that would run the clip.
|
|
1138
|
-
* @param _clip - Name of the clip.
|
|
1139
|
-
* @throws {Error} Always.
|
|
1140
|
-
* @example
|
|
1141
|
-
* ```ts
|
|
1142
|
-
* external(spine, "idle"); // throws: External players arrive with Spine.
|
|
1143
|
-
* ```
|
|
1144
|
-
*/
|
|
1145
|
-
declare function external(_player: ExternalPlayer, _clip: string): never;
|
|
1146
|
-
/**
|
|
1147
|
-
* Nests one animation inside another. The nested tree is built here, so its marks are reported
|
|
1148
|
-
* under the nested id and no function survives in the data. Pass the outer `tools` when the
|
|
1149
|
-
* nested `build` reads `at`.
|
|
1150
|
-
*
|
|
1151
|
-
* @param animation - The animation to nest.
|
|
1152
|
-
* @param slots - One target, or a list of targets, per slot of the nested animation.
|
|
1153
|
-
* @param tools - The build tools of the outer animation; without them `at` is the identity pose.
|
|
1154
|
-
* @returns The use step.
|
|
1155
|
-
* @example
|
|
1156
|
-
* ```ts
|
|
1157
|
-
* use(popCard, { card: { projection: "hud", key: "order" } });
|
|
1158
|
-
* // { kind: "use", id: "hud.popCard", step: { kind: "sequence", ... } }
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
declare function use<Tags extends SlotTags>(animation: AnimationDefinition<Tags>, slots: SlotValues<Tags>, tools?: BuildTools): Step;
|
|
1162
|
-
/**
|
|
1163
|
-
* The effect descriptor a node awaits to play a choreography. The payload names the animation,
|
|
1164
|
-
* so the handler resolves the definition from the registry the features filled.
|
|
1165
|
-
*
|
|
1166
|
-
* @param animation - The animation to play.
|
|
1167
|
-
* @param slots - One target, or a list of targets, per slot.
|
|
1168
|
-
* @returns The descriptor, cosmetic, so a failing build never breaks the node.
|
|
1169
|
-
* @example
|
|
1170
|
-
* ```ts
|
|
1171
|
-
* play(coinsFly, { from: { projection: "hud", key: "purse" } });
|
|
1172
|
-
* // { kind: "play", payload: { animation: "hud.coinsFly", slots: { from: { ... } } }, cosmetic: true }
|
|
1173
|
-
* ```
|
|
1174
|
-
*/
|
|
1175
|
-
declare function play<Tags extends SlotTags>(animation: AnimationDefinition<Tags>, slots: SlotValues<Tags>): PlayDescriptor;
|
|
1176
|
-
/**
|
|
1177
|
-
* Declares one animation: an id, the slots it takes and the pure function that builds its step
|
|
1178
|
-
* tree. `build` runs once per play, so the same animation may play twice at once.
|
|
1179
|
-
*
|
|
1180
|
-
* @param id - Animation id, unique across the features of a game.
|
|
1181
|
-
* @param spec - The slots and the build function.
|
|
1182
|
-
* @returns The animation as frozen plain data.
|
|
1183
|
-
* @example
|
|
1184
|
-
* ```ts
|
|
1185
|
-
* const coinsFly = defineAnimation("hud.coinsFly", {
|
|
1186
|
-
* slots: { from: type<Target>() },
|
|
1187
|
-
* build: ({ from }) => tween(from, Transform, { scale: 0.4 }, { ms: 600 })
|
|
1188
|
-
* });
|
|
1189
|
-
* coinsFly.id; // "hud.coinsFly"
|
|
1190
|
-
* ```
|
|
1191
|
-
*/
|
|
1192
|
-
declare function defineAnimation<Tags extends SlotTags>(id: string, spec: AnimationSpec<Tags>): AnimationDefinition<Tags>;
|
|
1193
|
-
//#endregion
|
|
1194
1061
|
//#region src/plugins/i18n/tr.d.ts
|
|
1195
1062
|
/**
|
|
1196
1063
|
* Builds a message. The result is frozen and the parameters are copied, so the caller's object
|
|
@@ -1281,7 +1148,9 @@ declare function music(key: string | null, options?: MusicOptions): Descriptor;
|
|
|
1281
1148
|
* wide, that follows the shape: rounded corners stay rounded. Its alpha is
|
|
1282
1149
|
* `strength × alpha ×` the share of the disc of radius `distance` around the pixel the view
|
|
1283
1150
|
* covers, so `strength: 2` is full next to a straight edge and fades to nothing at `distance`.
|
|
1284
|
-
*
|
|
1151
|
+
* It takes 64 to 256 probes, by radius in physical pixels: about 3.5 physical pixels apart up to
|
|
1152
|
+
* a radius of 32 physical pixels. The view is padded by its live `distance`. One render pass per
|
|
1153
|
+
* apply.
|
|
1285
1154
|
*
|
|
1286
1155
|
* @example
|
|
1287
1156
|
* ```ts
|
|
@@ -1359,23 +1228,27 @@ declare const Alpha: ComponentType<AlphaValue>;
|
|
|
1359
1228
|
//#endregion
|
|
1360
1229
|
//#region src/plugins/effects/filters/define.d.ts
|
|
1361
1230
|
/**
|
|
1362
|
-
* Turns a WGSL fragment body into a filter component type
|
|
1363
|
-
* the
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1231
|
+
* Turns a WGSL fragment body and its GLSL ES 3.0 twin into a filter component type; Pixi draws
|
|
1232
|
+
* the one of the running backend. To the WGSL the engine prepends the vertex stage, the input
|
|
1233
|
+
* bindings and a `FilterUniforms` struct in declaration order, bound as `fu`. To the GLSL it
|
|
1234
|
+
* prepends `#version 300 es`, `vTextureCoord`, `finalColor`, `uTexture`, the global filter
|
|
1235
|
+
* uniforms as `vec4` and one `uniform` per declared uniform under its bare name. Every number
|
|
1236
|
+
* uniform is a number field, so the existing `tween` drives it; a colour is one hex field sent as
|
|
1237
|
+
* a `vec3`; a tuple is an array field and not tweenable. Every filter component also carries
|
|
1238
|
+
* `enabled: true` and `order: 0`. Register it through the `filters` key of a feature.
|
|
1367
1239
|
*
|
|
1368
1240
|
* @param id - The filter id, also the component name; unique, and not one of the built-ins.
|
|
1369
|
-
* @param spec -
|
|
1241
|
+
* @param spec - Both bodies, the uniforms, the passes one apply costs and the padding.
|
|
1370
1242
|
* @returns The component type, with the frozen `filter` definition attached.
|
|
1371
|
-
* @throws {Error} When the id is empty, the
|
|
1372
|
-
* badly named or of no known form, or the passes or the padding break
|
|
1243
|
+
* @throws {Error} When the id is empty, the WGSL has no `mainFragment`, the GLSL no `void main(`,
|
|
1244
|
+
* a uniform is reserved, badly named or of no known form, or the passes or the padding break
|
|
1245
|
+
* their rules.
|
|
1373
1246
|
* @example
|
|
1374
1247
|
* ```ts
|
|
1375
|
-
* // features/board/effects.ts: a gold tint a motion hook tweens on a merge.
|
|
1376
|
-
* const Tint = defineFilter("fx.tint", { wgsl:
|
|
1248
|
+
* // features/board/effects.ts: a gold tint a motion hook tweens on a merge, on WebGPU and WebGL.
|
|
1249
|
+
* const Tint = defineFilter("fx.tint", { wgsl: tintWgsl, glsl: tintGlsl, uniforms: { amount: 0, color: { color: 0xffd700 } } });
|
|
1377
1250
|
* Tint({ amount: 1 }).value; // { amount: 1, color: 0xffd700, enabled: true, order: 0 }
|
|
1378
|
-
* Tint.filter.
|
|
1251
|
+
* Tint.filter.glsl.includes("uniform vec3 color;"); // true
|
|
1379
1252
|
* ```
|
|
1380
1253
|
*/
|
|
1381
1254
|
declare function defineFilter<Uniforms extends Record<string, UniformDeclaration> = Record<never, never>>(id: string, spec: FilterSpec<Uniforms>): FilterComponent<FilterValueOf<Uniforms>>;
|
|
@@ -1429,7 +1302,7 @@ declare function defineEmitter(id: string, config: EmitterConfig): EmitterDefini
|
|
|
1429
1302
|
* });
|
|
1430
1303
|
* ```
|
|
1431
1304
|
*/
|
|
1432
|
-
declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs/core").AnyPluginInstance[] = readonly []>(options?: import("@moku-labs/core").CreateAppOptions<Config$
|
|
1305
|
+
declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs/core").AnyPluginInstance[] = readonly []>(options?: import("@moku-labs/core").CreateAppOptions<Config$8, Events$1, (import("@moku-labs/core").PluginInstance<"time", Config$6, State$6, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"lifecycle", Config$3, State$3, Api$2, {
|
|
1433
1306
|
"lifecycle:changed": {
|
|
1434
1307
|
reason: PauseReason;
|
|
1435
1308
|
action: "push" | "pop";
|
|
@@ -1437,7 +1310,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1437
1310
|
paused: boolean;
|
|
1438
1311
|
resumed: boolean;
|
|
1439
1312
|
};
|
|
1440
|
-
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"model", Config$
|
|
1313
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"model", Config$4, State$4, {
|
|
1441
1314
|
store: StoreApi;
|
|
1442
1315
|
rng: RngApi;
|
|
1443
1316
|
}, {
|
|
@@ -1445,7 +1318,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1445
1318
|
roots: readonly Root[];
|
|
1446
1319
|
cause: "edge" | "rollback" | "restore" | "load";
|
|
1447
1320
|
};
|
|
1448
|
-
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"clock", Config, State, Api, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"flow", Config$
|
|
1321
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"clock", Config$1, State$1, Api, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"flow", Config$2, State$2, Api$1, {
|
|
1449
1322
|
"flow:edge": {
|
|
1450
1323
|
flow: string;
|
|
1451
1324
|
node: string;
|
|
@@ -1469,7 +1342,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1469
1342
|
rolledBackTo: string;
|
|
1470
1343
|
retry: boolean;
|
|
1471
1344
|
};
|
|
1472
|
-
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$
|
|
1345
|
+
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$8, Events$1, (import("@moku-labs/core").PluginInstance<"time", Config$6, State$6, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"lifecycle", Config$3, State$3, Api$2, {
|
|
1473
1346
|
"lifecycle:changed": {
|
|
1474
1347
|
reason: PauseReason;
|
|
1475
1348
|
action: "push" | "pop";
|
|
@@ -1477,7 +1350,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1477
1350
|
paused: boolean;
|
|
1478
1351
|
resumed: boolean;
|
|
1479
1352
|
};
|
|
1480
|
-
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"model", Config$
|
|
1353
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"model", Config$4, State$4, {
|
|
1481
1354
|
store: StoreApi;
|
|
1482
1355
|
rng: RngApi;
|
|
1483
1356
|
}, {
|
|
@@ -1485,7 +1358,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1485
1358
|
roots: readonly Root[];
|
|
1486
1359
|
cause: "edge" | "rollback" | "restore" | "load";
|
|
1487
1360
|
};
|
|
1488
|
-
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"clock", Config, State, Api, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"flow", Config$
|
|
1361
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"clock", Config$1, State$1, Api, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"flow", Config$2, State$2, Api$1, {
|
|
1489
1362
|
"flow:edge": {
|
|
1490
1363
|
flow: string;
|
|
1491
1364
|
node: string;
|
|
@@ -1522,7 +1395,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
1522
1395
|
* });
|
|
1523
1396
|
* ```
|
|
1524
1397
|
*/
|
|
1525
|
-
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$
|
|
1398
|
+
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$8, Events$1, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common/browser").LogConfig, import("@moku-labs/common/browser").LogState, import("@moku-labs/common/browser").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common/browser").EnvConfig, import("@moku-labs/common/browser").EnvState, import("@moku-labs/common/browser").EnvApi>]>>;
|
|
1526
1399
|
/**
|
|
1527
1400
|
* Binds the authoring helpers to the types of one game: "createApp for a game". Each plugin binds
|
|
1528
1401
|
* its own helpers (`flowFor`, `projectionFor`, `componentsFor`, `bundlesFor`, `scenesFor`); this
|
|
@@ -1603,14 +1476,14 @@ declare function defineGame<Types extends GameTypes>(): {
|
|
|
1603
1476
|
};
|
|
1604
1477
|
/**
|
|
1605
1478
|
* The screen plugins, in dependency order. A game with a screen spreads them into `plugins`;
|
|
1606
|
-
* a headless test leaves them out. V2: `world`, `renderer`, `input`, `assets`, `scenes`. V3 appends `anim`, `i18n`, `text`, `ui`; `audio` and `
|
|
1479
|
+
* a headless test leaves them out. V2: `world`, `renderer`, `input`, `assets`, `scenes`. V3 appends `anim`, `i18n`, `text`, `ui`; `audio`, `effects` and `platform` stay opt-in: `[...screen, effectsPlugin, audioPlugin, platformPlugin]`.
|
|
1607
1480
|
*
|
|
1608
1481
|
* @example
|
|
1609
1482
|
* ```ts
|
|
1610
1483
|
* createApp({ plugins: [...screen, boardFeature], pluginConfigs: { renderer: { mount: "#game" } } });
|
|
1611
1484
|
* ```
|
|
1612
1485
|
*/
|
|
1613
|
-
declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world", Config$
|
|
1486
|
+
declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world", Config$7, State$7, Api$5, {
|
|
1614
1487
|
"world:reconciled": {
|
|
1615
1488
|
mode: "play" | "direct";
|
|
1616
1489
|
projections: number;
|
|
@@ -1622,12 +1495,12 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
1622
1495
|
hintsRouted: number;
|
|
1623
1496
|
hintsDropped: number;
|
|
1624
1497
|
};
|
|
1625
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"renderer", Config$
|
|
1498
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"renderer", Config$5, State$5, Api$3, {
|
|
1626
1499
|
"renderer:device-lost": {
|
|
1627
1500
|
kind: "webgpu" | "webgl";
|
|
1628
1501
|
reason: string;
|
|
1629
1502
|
};
|
|
1630
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"input", Config$
|
|
1503
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"input", Config$11, State$10, InputApi, {}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"assets", Config$9, State$8, Api$6, {
|
|
1631
1504
|
"assets:bundle-loaded": {
|
|
1632
1505
|
bundle: string;
|
|
1633
1506
|
tier: Tier;
|
|
@@ -1646,13 +1519,13 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
1646
1519
|
reason: "budget" | "request";
|
|
1647
1520
|
keys: readonly string[];
|
|
1648
1521
|
};
|
|
1649
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$
|
|
1522
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"scenes", Record<string, never>, State$16, ScenesApi, {
|
|
1650
1523
|
"scenes:changed": {
|
|
1651
1524
|
from: string | undefined;
|
|
1652
1525
|
to: string;
|
|
1653
1526
|
music: string | undefined;
|
|
1654
1527
|
};
|
|
1655
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"anim", Config$
|
|
1528
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"anim", Config$12, State$11, AnimApi, {
|
|
1656
1529
|
"anim:mark": {
|
|
1657
1530
|
animation: string;
|
|
1658
1531
|
mark: string;
|
|
@@ -1660,10 +1533,10 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
1660
1533
|
"anim:finished": {
|
|
1661
1534
|
animation: string;
|
|
1662
1535
|
};
|
|
1663
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"i18n", Config$
|
|
1536
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"i18n", Config$10, State$9, I18nApi, {
|
|
1664
1537
|
"i18n:locale-changed": {
|
|
1665
1538
|
locale: string;
|
|
1666
1539
|
};
|
|
1667
|
-
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"text", Config$
|
|
1540
|
+
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"text", Config$13, State$12, TextApi, {}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"ui", Config$14, State$13, UiApi, {}> & Record<never, never>];
|
|
1668
1541
|
//#endregion
|
|
1669
|
-
export { Alpha, types_d_exports as Anim, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, Blur, Box, types_d_exports$3 as Clock, ColorMatrix, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$4 as Effects, Emitter, Exiting, types_d_exports$5 as Flow, Frames, Glow, Held, Hovered, types_d_exports$6 as I18n, types_d_exports$7 as Input, Layer, types_d_exports$8 as Lifecycle, LocalWrite, types_d_exports$9 as Model, NineSlice, Noise, Order, Outline, Parent, Pointer, PointerOver, Pressable, Pressed, types_d_exports$
|
|
1542
|
+
export { Alpha, types_d_exports as Anim, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, Blur, Box, types_d_exports$3 as Clock, ColorMatrix, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$4 as Effects, Emitter, Exiting, types_d_exports$5 as Flow, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, types_d_exports$6 as I18n, types_d_exports$7 as Input, Layer, types_d_exports$8 as Lifecycle, LocalWrite, types_d_exports$9 as Model, NineSlice, Noise, Order, Outline, Parent, types_d_exports$10 as Platform, type PlatformProvider, Pointer, PointerOver, Pressable, Pressed, types_d_exports$11 as Renderer, SaveUnreadableError, types_d_exports$12 as Scenes, Shape, Sprite, Swipeable, Tappable, Text, types_d_exports$13 as TextTypes, types_d_exports$14 as Time, Touchable, Transform, Tree, types_d_exports$15 as Ui, types_d_exports$16 as World, animPlugin, assetsPlugin, audioPlugin, clockPlugin, component, createApp, createPlugin, defineAnimation, defineBundles, defineComponent, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flowPlugin, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|