@moku-labs/game 0.8.0 → 0.10.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 +88 -26
- package/bin/moku-game.mjs +4 -0
- package/dist/app/page.d.mts +41 -0
- package/dist/app/page.mjs +376 -0
- package/dist/app/system.d.mts +129 -0
- package/dist/app/system.mjs +307 -0
- package/dist/app.d.mts +37 -0
- package/dist/app.mjs +235 -0
- package/dist/assets-BHwTLVta.mjs +7391 -0
- package/dist/assets.d.mts +97 -33
- package/dist/assets.mjs +1 -7150
- package/dist/{capture-BX5Gfoty.mjs → capture-fpd83Mi5.mjs} +384 -1
- package/dist/cli.d.mts +70 -0
- package/dist/cli.mjs +1650 -0
- package/dist/{commands-C1kIfOG5.d.mts → commands-C4QlqijJ.d.mts} +5 -6
- package/dist/config-CdARrrhU.mjs +81 -0
- package/dist/control.d.mts +11 -10
- package/dist/control.mjs +3 -3
- package/dist/{define-BPpZcpxW.d.mts → define-CCc0ozKe.d.mts} +2 -2
- package/dist/{dev-wKLgOw7c.mjs → dev-Cc50Dk7H.mjs} +1 -1
- package/dist/{memory-CvgdnsQO.mjs → drafts-BawpSaVp.mjs} +1 -104
- package/dist/fake-MpzwZhIZ.mjs +87 -0
- package/dist/{headless-CvamCUcR.mjs → headless-BsNdJs9W.mjs} +1 -1
- package/dist/{headless-q98SwADR.d.mts → headless-G4nuZ-xz.d.mts} +1 -1
- package/dist/hot.d.mts +8 -8
- package/dist/hot.mjs +15 -14
- package/dist/index-xxSxKJJW.d.mts +1611 -0
- package/dist/index.d.mts +6 -1597
- package/dist/index.mjs +4 -34343
- package/dist/inspect-la_KkjCS.mjs +1 -0
- package/dist/inspect.d.mts +7 -8
- package/dist/inspect.mjs +3 -2
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/lint.d.mts +55 -4
- package/dist/lint.mjs +999 -42
- package/dist/memory-CWlqhS7l.mjs +136 -0
- package/dist/memory-DwDhfFWK.d.mts +50 -0
- package/dist/project.d.mts +29 -13
- package/dist/project.mjs +1120 -631
- package/dist/{run-CUPSFM85.mjs → run-wYty_Lwo.mjs} +4 -4
- package/dist/{runtime-CvDZZg1S.d.mts → runtime-DOBYM6g4.d.mts} +1 -1
- package/dist/{input-z_35Jwfn.mjs → session-DgukhR_7.mjs} +20 -20
- package/dist/{sources-BBUd15vQ.mjs → sources-Duzj6lhV.mjs} +3 -3
- package/dist/src-DSl1eNB1.mjs +34366 -0
- package/dist/testing.d.mts +115 -34
- package/dist/testing.mjs +175 -70
- package/dist/{types-DlgsfOmW.d.mts → types-BM4shh8K.d.mts} +300 -263
- package/dist/{types-DgdMLZnV.d.mts → types-BUwDHKXm.d.mts} +1372 -1373
- package/dist/{types-DF5kkW-C.d.mts → types-CefgYzFt.d.mts} +4 -5
- package/dist/{types-CDSKa0vl.d.mts → types-DAdwEJMp.d.mts} +2 -2
- package/dist/{types-BWzCSRM2.d.mts → types-ZQLYXo5X.d.mts} +2983 -20
- package/dist/types-hQgI_wrq.d.mts +544 -0
- package/dist/{visual-DUvvPPCt.mjs → visual-dMW8iqAE.mjs} +8 -4
- package/dist/visual.d.mts +10 -11
- package/dist/visual.mjs +5 -5
- package/llms.txt +170 -57
- package/package.json +30 -2
- package/dist/registry-DlpRCibU.mjs +0 -384
- package/dist/types-ERb2Y9U5.d.mts +0 -2967
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { D as TextApi, H as InputApi, I as I18nApi, c as UiNode, i as Finding, n as ElementChange, o as JsxState, r as ElementMotion, v as StylesState } from "./types-DgdMLZnV.mjs";
|
|
1
|
+
import { A as Api$2, B as ComponentType, F as AnyComponent, H as Entity, It as TypeTag, L as AnyComponentValue, Lt as Descriptor, R as ComponentHandle, Sn as Require, Xt as Json, Yt as Events$2, at as NumericFields, ct as TrackOptions, dn as Events$3, dt as Api$1, et as Ease, h as Api$5, hn as Api, it as MotionHandle, lt as TrackSegment, nt as LayerSpec, q as Owner, qt as Api$4, s as Events$4, t as Api$3, tt as LayerSort, xn as Events$5 } from "./types-ZQLYXo5X.mjs";
|
|
2
|
+
import { A as InputApi, c as UiNode, i as Finding, n as ElementChange, o as JsxState, q as I18nApi, r as ElementMotion, tt as StylesState, x as TextApi } from "./types-BUwDHKXm.mjs";
|
|
4
3
|
import { Log } from "@moku-labs/common/browser";
|
|
5
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
5
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -633,7 +632,7 @@ type RunningTimeline = {
|
|
|
633
632
|
ended: boolean;
|
|
634
633
|
};
|
|
635
634
|
declare namespace types_d_exports$3 {
|
|
636
|
-
export { AnimApi, AnimCtx, AnimationDefinition, AnimationSpec, AnyAnimationDefinition, BuildTools, Config$3 as Config, Cursor, Deps$3 as Deps, ErasedFields, Events$1 as Events, ExternalPlayer, FrameLoop, FramesValue, FxStep, HapticDescriptor, HapticKind, KernelSlice$3 as KernelSlice, MarkListener, MotionKeyframe, PlayDescriptor, PlayHandle, Pose, RunningTimeline, SfxDescriptor, SlotRecord, SlotTags, SlotValue, SlotValues, State$3 as State, Step, StepMotion, Target, TimelineRuntime, Track };
|
|
635
|
+
export { AnimApi, AnimCtx, AnimPlayerValue, AnimationDefinition, AnimationSpec, AnyAnimationDefinition, BuildTools, Config$3 as Config, Cursor, Deps$3 as Deps, ErasedFields, Events$1 as Events, ExternalPlayer, FrameLoop, FramesValue, FxStep, HapticDescriptor, HapticKind, KernelSlice$3 as KernelSlice, MarkListener, MotionKeyframe, PlayDescriptor, PlayHandle, Pose, RunningTimeline, SfxDescriptor, SlotRecord, SlotTags, SlotValue, SlotValues, State$3 as State, Step, StepMotion, Target, TimelineRuntime, Track };
|
|
637
636
|
}
|
|
638
637
|
/**
|
|
639
638
|
* What a step and a slot are pointed at: the projection key of a live view or of an element a
|
|
@@ -1057,6 +1056,44 @@ type AnimApi = {
|
|
|
1057
1056
|
*/
|
|
1058
1057
|
replace(definition: AnyAnimationDefinition): void;
|
|
1059
1058
|
};
|
|
1059
|
+
/**
|
|
1060
|
+
* What a system may do with anim, read with `res(AnimPlayer)`: play. A system that needs more
|
|
1061
|
+
* than play is a plugin. Play on a change, never on every frame: keep the handle in a resource, or
|
|
1062
|
+
* take away the tag that asked for the play.
|
|
1063
|
+
*
|
|
1064
|
+
* @example
|
|
1065
|
+
* ```ts
|
|
1066
|
+
* // A fresh item pops once: the system plays, then takes the Fresh tag away.
|
|
1067
|
+
* const popIn = system({ name: "popIn", phase: "input", query: [Fresh], run: (items, { world, res }) => {
|
|
1068
|
+
* for (const [entity] of items) {
|
|
1069
|
+
* res(AnimPlayer).play(pop, { thing: entity });
|
|
1070
|
+
* world.untag(entity, Fresh);
|
|
1071
|
+
* }
|
|
1072
|
+
* } });
|
|
1073
|
+
* ```
|
|
1074
|
+
*/
|
|
1075
|
+
type AnimPlayerValue = {
|
|
1076
|
+
/**
|
|
1077
|
+
* Plays an animation from a system, the way `app.anim.play` does. The registered animation of
|
|
1078
|
+
* `animation.id` wins when a feature brought one, so a hot swap reaches the system. Played from
|
|
1079
|
+
* phase `input`, the tree moves in `animate` of the same frame; from a later phase it moves
|
|
1080
|
+
* from the next frame.
|
|
1081
|
+
*
|
|
1082
|
+
* @param animation - What `defineAnimation` returned.
|
|
1083
|
+
* @param slots - One target, or a list of targets, per declared slot.
|
|
1084
|
+
* @returns The handle: `cancel()`, `finish()`, `active()`, `done`, `marks()`.
|
|
1085
|
+
* @throws {Error} Before `anim` started: `[game] AnimPlayer is not ready: anim has not started.`
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```ts
|
|
1088
|
+
* const lift = defineAnimation("look.hover", { slots: { thing: type<Target>() },
|
|
1089
|
+
* build: ({ thing }) => tween(thing, Transform, { scale: 1.1 }, { ms: 100 }) });
|
|
1090
|
+
* // Inside a system of phase "input": entity 1048576 is the item under the pointer.
|
|
1091
|
+
* const handle = res(AnimPlayer).play(lift, { thing: 1_048_576 });
|
|
1092
|
+
* handle.active(); // true until the lift lands 100 ms later, then false
|
|
1093
|
+
* ```
|
|
1094
|
+
*/
|
|
1095
|
+
play<Tags extends SlotTags>(animation: AnimationDefinition<Tags>, slots: SlotValues<Tags>): PlayHandle;
|
|
1096
|
+
};
|
|
1060
1097
|
/**
|
|
1061
1098
|
* Resolved dependency APIs. `renderer` is not among them: `anim` writes its `Sprite` and reads
|
|
1062
1099
|
* its `Transform` through the component objects, which are plain data, composes the root pose
|
|
@@ -1066,7 +1103,7 @@ type AnimApi = {
|
|
|
1066
1103
|
type Deps$3 = {
|
|
1067
1104
|
time: Api;
|
|
1068
1105
|
flow: Api$1;
|
|
1069
|
-
world: Api$
|
|
1106
|
+
world: Api$2;
|
|
1070
1107
|
};
|
|
1071
1108
|
/**
|
|
1072
1109
|
* What the kernel context offers before the deps are attached.
|
|
@@ -1086,243 +1123,8 @@ type KernelSlice$3 = PluginCtx<Config$3, State$3, Events$1> & {
|
|
|
1086
1123
|
type AnimCtx = KernelSlice$3 & {
|
|
1087
1124
|
readonly deps: Deps$3;
|
|
1088
1125
|
};
|
|
1089
|
-
//#endregion
|
|
1090
|
-
//#region src/plugins/ui/layout/types.d.ts
|
|
1091
|
-
/**
|
|
1092
|
-
* layout module state. `nodes` is attach minus detach: Yoga 3.2.1 has no instance counter.
|
|
1093
|
-
*/
|
|
1094
|
-
type LayoutState = {
|
|
1095
|
-
yoga: Yoga | undefined;
|
|
1096
|
-
byEntity: Map<Entity, Node>;
|
|
1097
|
-
nodes: number;
|
|
1098
|
-
measured: number;
|
|
1099
|
-
solves: number;
|
|
1100
|
-
scrolling: Entity | undefined;
|
|
1101
|
-
scrollStart: {
|
|
1102
|
-
pointerY: number;
|
|
1103
|
-
offset: number;
|
|
1104
|
-
};
|
|
1105
|
-
order: number;
|
|
1106
|
-
cleanups: Array<() => void>;
|
|
1107
|
-
};
|
|
1108
1126
|
declare namespace types_d_exports$2 {
|
|
1109
|
-
export { Config$2 as Config, Deps$2 as Deps,
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* The look of the keyboard focus ring: a dashed ring with a solid halo under it, drawn around the
|
|
1113
|
-
* focused control. Colours are `0xRRGGBB`, lengths reference units.
|
|
1114
|
-
*
|
|
1115
|
-
* @example
|
|
1116
|
-
* ```ts
|
|
1117
|
-
* // A dashed ink ring with a cream halo, 9 u outside the control.
|
|
1118
|
-
* const ring: FocusRing = {
|
|
1119
|
-
* stroke: 0x3a2212, strokeWidth: 4, dash: 10, offset: 9, halo: 0xfff3d6, haloWidth: 12
|
|
1120
|
-
* };
|
|
1121
|
-
* ```
|
|
1122
|
-
*/
|
|
1123
|
-
type FocusRing = {
|
|
1124
|
-
/** The colour of the dashed ring. */stroke: number; /** The stroke width of the dashed ring. */
|
|
1125
|
-
strokeWidth: number; /** The dash length of the ring, with gaps of half a dash; 0 draws it solid. */
|
|
1126
|
-
dash: number; /** How far outside the control's rect the ring runs, on every side. */
|
|
1127
|
-
offset: number; /** The colour of the solid halo drawn under the ring. */
|
|
1128
|
-
halo: number; /** The stroke width of the halo, centred on the same path as the ring. */
|
|
1129
|
-
haloWidth: number;
|
|
1130
|
-
};
|
|
1131
|
-
/**
|
|
1132
|
-
* The look of a text field while it is edited: the caret, the selection box and the IME
|
|
1133
|
-
* underline. Colours are `0xRRGGBB`, lengths reference units, `keyboardMargin` CSS px. The caret
|
|
1134
|
-
* does not blink.
|
|
1135
|
-
*
|
|
1136
|
-
* @example
|
|
1137
|
-
* ```ts
|
|
1138
|
-
* // A thick ink caret, a pale blue selection, the field 16 px above the keyboard.
|
|
1139
|
-
* const look: TextInputLook = {
|
|
1140
|
-
* caretWidth: 3, caret: 0x3a2212, selection: 0x3390ff, selectionAlpha: 0.35,
|
|
1141
|
-
* composingUnderline: 3, keyboardMargin: 16
|
|
1142
|
-
* };
|
|
1143
|
-
* ```
|
|
1144
|
-
*/
|
|
1145
|
-
type TextInputLook = {
|
|
1146
|
-
/** The width of the caret. */caretWidth: number; /** The colour of the caret and of the underline under an IME composing range. */
|
|
1147
|
-
caret: number; /** The colour of the selection box. */
|
|
1148
|
-
selection: number; /** The alpha of the selection box. */
|
|
1149
|
-
selectionAlpha: number; /** The height of the underline under an IME composing range. */
|
|
1150
|
-
composingUnderline: number; /** How far above the keyboard the bottom of the edited field is lifted, in CSS px. */
|
|
1151
|
-
keyboardMargin: number;
|
|
1152
|
-
};
|
|
1153
|
-
/**
|
|
1154
|
-
* ui plugin config.
|
|
1155
|
-
*
|
|
1156
|
-
* @example
|
|
1157
|
-
* ```ts
|
|
1158
|
-
* createApp({ pluginConfigs: { ui: { tapTargetPt: 48, breakpoints: { tall: 2, wide: 1.5 } } } });
|
|
1159
|
-
* // A game with a white focus ring on a dark board.
|
|
1160
|
-
* createApp({
|
|
1161
|
-
* pluginConfigs: {
|
|
1162
|
-
* ui: {
|
|
1163
|
-
* focusRing: {
|
|
1164
|
-
* stroke: 0xffffff, strokeWidth: 4, dash: 10, offset: 9, halo: 0x000000, haloWidth: 12
|
|
1165
|
-
* }
|
|
1166
|
-
* }
|
|
1167
|
-
* }
|
|
1168
|
-
* });
|
|
1169
|
-
* // A game whose text fields have an ink caret.
|
|
1170
|
-
* createApp({
|
|
1171
|
-
* pluginConfigs: {
|
|
1172
|
-
* ui: {
|
|
1173
|
-
* textInput: {
|
|
1174
|
-
* caretWidth: 3, caret: 0x3a2212, selection: 0x3390ff, selectionAlpha: 0.35,
|
|
1175
|
-
* composingUnderline: 3, keyboardMargin: 16
|
|
1176
|
-
* }
|
|
1177
|
-
* }
|
|
1178
|
-
* }
|
|
1179
|
-
* });
|
|
1180
|
-
* ```
|
|
1181
|
-
*/
|
|
1182
|
-
type Config$2 = {
|
|
1183
|
-
/** Smallest tap target `lint()` accepts, in CSS px (points). */tapTargetPt: number; /** `when` flags: `tall` when height / width is at least `tall`, `wide` the other way round. */
|
|
1184
|
-
breakpoints: {
|
|
1185
|
-
tall: number;
|
|
1186
|
-
wide: number;
|
|
1187
|
-
};
|
|
1188
|
-
/**
|
|
1189
|
-
* The ring drawn around the control the keyboard focused. Shallow merge: a game that sets
|
|
1190
|
-
* `focusRing` gives all six fields.
|
|
1191
|
-
*/
|
|
1192
|
-
focusRing: FocusRing;
|
|
1193
|
-
/**
|
|
1194
|
-
* The caret, the selection and the IME underline of a text field. Shallow merge: a game that
|
|
1195
|
-
* sets `textInput` gives all six fields.
|
|
1196
|
-
*/
|
|
1197
|
-
textInput: TextInputLook;
|
|
1198
|
-
};
|
|
1199
|
-
/**
|
|
1200
|
-
* ui plugin state: one branch per module.
|
|
1201
|
-
*/
|
|
1202
|
-
type State$2 = {
|
|
1203
|
-
jsx: JsxState;
|
|
1204
|
-
styles: StylesState;
|
|
1205
|
-
layout: LayoutState;
|
|
1206
|
-
};
|
|
1207
|
-
/**
|
|
1208
|
-
* Resolved dependency APIs. `anim` is here for the dev hot swap, which replaces animations; the
|
|
1209
|
-
* motions of `ui` reach `anim` through the tween driver behind every `ViewHandle`.
|
|
1210
|
-
*/
|
|
1211
|
-
type Deps$2 = {
|
|
1212
|
-
anim: AnimApi;
|
|
1213
|
-
time: Api;
|
|
1214
|
-
flow: Api$1;
|
|
1215
|
-
world: Api$3;
|
|
1216
|
-
renderer: Api$4;
|
|
1217
|
-
input: InputApi;
|
|
1218
|
-
i18n: I18nApi;
|
|
1219
|
-
text: TextApi;
|
|
1220
|
-
};
|
|
1221
|
-
/**
|
|
1222
|
-
* What the kernel context offers before the deps are attached.
|
|
1223
|
-
*
|
|
1224
|
-
* `ui` owns no event of its own; `emit` sends the global `ui:hot-swap` of the dev hot swap.
|
|
1225
|
-
*/
|
|
1226
|
-
type KernelSlice$2 = PluginCtx<Config$2, State$2, Events$2> & {
|
|
1227
|
-
readonly global: object;
|
|
1228
|
-
readonly log: Log.LogApi;
|
|
1229
|
-
readonly require: Require;
|
|
1230
|
-
};
|
|
1231
|
-
/**
|
|
1232
|
-
* Domain context shared by the three modules: the kernel slice plus the resolved deps.
|
|
1233
|
-
*/
|
|
1234
|
-
type UiCtx = KernelSlice$2 & {
|
|
1235
|
-
readonly deps: Deps$2;
|
|
1236
|
-
};
|
|
1237
|
-
/**
|
|
1238
|
-
* ui plugin API, `app.ui`. The screen is one more projection, so three members read it the way a
|
|
1239
|
-
* test reads the board: a snapshot, a key lookup and a list of findings; the fourth types into a
|
|
1240
|
-
* text field.
|
|
1241
|
-
*
|
|
1242
|
-
* @example
|
|
1243
|
-
* ```ts
|
|
1244
|
-
* // A headless scenario taps the claim button of the reward popup.
|
|
1245
|
-
* app.ui.tree().type; // "row", the root element of the HUD
|
|
1246
|
-
* app.input.tap(app.ui.find("claim") ?? 0);
|
|
1247
|
-
* app.ui.lint(); // []
|
|
1248
|
-
* ```
|
|
1249
|
-
*/
|
|
1250
|
-
type UiApi = {
|
|
1251
|
-
/**
|
|
1252
|
-
* The live screen as plain data: every root in layer order, every element in child order, with
|
|
1253
|
-
* its rect in root coordinates, its resolved style and its seven state flags. A rect is natural:
|
|
1254
|
-
* under a `fit: "contain"` element it is the rect before that scale, and the fitted element
|
|
1255
|
-
* adds `fitScale`. A windowed scroll adds `window`, and its content lists the live rows only.
|
|
1256
|
-
* Works headless.
|
|
1257
|
-
*
|
|
1258
|
-
* @returns The root node; several roots come back under one `screen` node.
|
|
1259
|
-
* @example
|
|
1260
|
-
* ```ts
|
|
1261
|
-
* // On an iPhone SE the 970 u board is drawn smaller to fit the slot between the bars.
|
|
1262
|
-
* const screen = app.ui.tree();
|
|
1263
|
-
* screen.children.map(child => child.key); // ["fitTop", "slot", "fitBottom"]
|
|
1264
|
-
* const board = screen.children[1]?.children[0];
|
|
1265
|
-
* board?.rect.w; // 970, the natural width
|
|
1266
|
-
* board?.fitScale; // 0.805, the 781 u the slot leaves over 970 u
|
|
1267
|
-
* ```
|
|
1268
|
-
*/
|
|
1269
|
-
tree(): UiNode;
|
|
1270
|
-
/**
|
|
1271
|
-
* The entity of a keyed element, so a test can tap it and `anim` can aim at it. Popup roots
|
|
1272
|
-
* come first, then the projection roots in layer order.
|
|
1273
|
-
*
|
|
1274
|
-
* @param key - The `key` prop of the element.
|
|
1275
|
-
* @returns The entity, or `undefined` for an unknown or exiting element.
|
|
1276
|
-
* @example
|
|
1277
|
-
* ```ts
|
|
1278
|
-
* // A headless scenario answers the gate through the button of the popup.
|
|
1279
|
-
* app.input.tap(app.ui.find("claim") ?? 0); // true
|
|
1280
|
-
* app.ui.find("nothing"); // undefined
|
|
1281
|
-
* ```
|
|
1282
|
-
*/
|
|
1283
|
-
find(key: string): Entity | undefined;
|
|
1284
|
-
/**
|
|
1285
|
-
* Reads the live screen against the five rules: a tap target under `tapTargetPt` at the size
|
|
1286
|
-
* it is drawn (a `fit: "contain"` on it or above it shrinks it), a text that does not fit its
|
|
1287
|
-
* box in some registered locale, an absolute element with no `reason`, a clipping element
|
|
1288
|
-
* (`scroll`, `overflow: "hidden"`) whose style names a nine-slice it never draws, and a root
|
|
1289
|
-
* element whose style sets a `zIndex` it ignores. Never throws; empty when nothing is mounted.
|
|
1290
|
-
*
|
|
1291
|
-
* @returns One finding per rule and element.
|
|
1292
|
-
* @example
|
|
1293
|
-
* ```ts
|
|
1294
|
-
* // A game test keeps the board honest on an iPhone SE: a 140 u cell in the 0.8 slot.
|
|
1295
|
-
* app.ui.lint(); // [{ rule: "tap-target", key: "cell", detail: "39 x 39 pt" }]
|
|
1296
|
-
* // A list styled with a nine-slice: the clip keeps it from drawing.
|
|
1297
|
-
* app.ui.lint(); // [{ rule: "nine-slice-clipped", key: "orders", detail: "scroll" }]
|
|
1298
|
-
* // A screen root that asks to be drawn over the others: the layer decides that.
|
|
1299
|
-
* app.ui.lint(); // [{ rule: "z-index-on-root", key: "board", detail: "zIndex 2" }]
|
|
1300
|
-
* ```
|
|
1301
|
-
*/
|
|
1302
|
-
lint(): readonly Finding[];
|
|
1303
|
-
/**
|
|
1304
|
-
* Types into a text field the way a player does, for a headless test or an agent: the field
|
|
1305
|
-
* becomes the one being edited, `value` cut to its `maxLength` is written into it, and the
|
|
1306
|
-
* local field it names is written, so the component re-renders on the next frame. Nothing
|
|
1307
|
-
* reaches the gate: Enter submits.
|
|
1308
|
-
*
|
|
1309
|
-
* @param key - The `key` prop of the `input` element.
|
|
1310
|
-
* @param value - The text to type.
|
|
1311
|
-
* @returns True when the field took the text; false with one warning when no live `input` has
|
|
1312
|
-
* the key.
|
|
1313
|
-
* @example
|
|
1314
|
-
* ```ts
|
|
1315
|
-
* // A headless test renames the player through the Rename popup.
|
|
1316
|
-
* app.ui.fill("nameField", "Alex"); // true
|
|
1317
|
-
* app.time.step(16);
|
|
1318
|
-
* app.input.pressKey("Enter"); // true: the gate took { intent: "save", payload: { name: "Alex" } }
|
|
1319
|
-
* app.ui.fill("nothing", "Alex"); // false, with the warning "ui:fill-without-input"
|
|
1320
|
-
* ```
|
|
1321
|
-
*/
|
|
1322
|
-
fill(key: string, value: string): boolean;
|
|
1323
|
-
};
|
|
1324
|
-
declare namespace types_d_exports$1 {
|
|
1325
|
-
export { AnySceneProjection, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events, KernelSlice$1 as KernelSlice, LayerMap, RunContext, SceneDefinition, SceneLayer, SceneOwner, SceneProjection, SceneSpec, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
1127
|
+
export { AnySceneProjection, CheckedProjections, Config$2 as Config, DefineScene, Deps$2 as Deps, Events, KernelSlice$2 as KernelSlice, LayerMap, RunContext, SceneDefinition, SceneLayer, SceneOwner, SceneProjection, SceneSpec, ScenesApi, ScenesCtx, SortRule, State$2 as State, UiLayer };
|
|
1326
1128
|
}
|
|
1327
1129
|
/**
|
|
1328
1130
|
* How a layer orders what is drawn in it. The scene's name for the rule `world` stores.
|
|
@@ -1487,11 +1289,11 @@ type SceneOwner = Owner & {
|
|
|
1487
1289
|
* const config: Config = {};
|
|
1488
1290
|
* ```
|
|
1489
1291
|
*/
|
|
1490
|
-
type Config$
|
|
1292
|
+
type Config$2 = Record<string, never>;
|
|
1491
1293
|
/**
|
|
1492
1294
|
* scenes plugin state.
|
|
1493
1295
|
*/
|
|
1494
|
-
type State$
|
|
1296
|
+
type State$2 = {
|
|
1495
1297
|
/** Scene id to its declaration, filled in `onStart` from `flow.features`. */scenes: Map<string, SceneDefinition>; /** Id of the scene that is mounted now. */
|
|
1496
1298
|
current: string | undefined;
|
|
1497
1299
|
/**
|
|
@@ -1567,10 +1369,10 @@ type ScenesApi = {
|
|
|
1567
1369
|
/**
|
|
1568
1370
|
* Resolved dependency APIs.
|
|
1569
1371
|
*/
|
|
1570
|
-
type Deps$
|
|
1372
|
+
type Deps$2 = {
|
|
1571
1373
|
flow: Api$1;
|
|
1572
|
-
world: Api$
|
|
1573
|
-
assets: Api$
|
|
1374
|
+
world: Api$2;
|
|
1375
|
+
assets: Api$3;
|
|
1574
1376
|
time: Api;
|
|
1575
1377
|
};
|
|
1576
1378
|
/**
|
|
@@ -1580,7 +1382,7 @@ type Deps$1 = {
|
|
|
1580
1382
|
* row 8), so the own event reaches the context the kernel hands the factories and `emit` is the
|
|
1581
1383
|
* kernel's own, scenes-typed one. No member of the context is cast.
|
|
1582
1384
|
*/
|
|
1583
|
-
type KernelSlice$
|
|
1385
|
+
type KernelSlice$2 = PluginCtx<Config$2, State$2, Events> & {
|
|
1584
1386
|
readonly global: object;
|
|
1585
1387
|
readonly log: Log.LogApi;
|
|
1586
1388
|
readonly require: Require;
|
|
@@ -1588,8 +1390,8 @@ type KernelSlice$1 = PluginCtx<Config$1, State$1, Events> & {
|
|
|
1588
1390
|
/**
|
|
1589
1391
|
* Domain context shared by the files of the plugin.
|
|
1590
1392
|
*/
|
|
1591
|
-
type ScenesCtx = KernelSlice$
|
|
1592
|
-
readonly deps: Deps$
|
|
1393
|
+
type ScenesCtx = KernelSlice$2 & {
|
|
1394
|
+
readonly deps: Deps$2;
|
|
1593
1395
|
};
|
|
1594
1396
|
/**
|
|
1595
1397
|
* The mode and the abort signal `flow.onEnter` hands every callback.
|
|
@@ -1603,8 +1405,8 @@ type RunContext = {
|
|
|
1603
1405
|
mode: "live" | "fast";
|
|
1604
1406
|
signal: AbortSignal;
|
|
1605
1407
|
};
|
|
1606
|
-
declare namespace types_d_exports {
|
|
1607
|
-
export { AudioApi, AudioContextLike, AudioCtx, AudioSessionLike, AudioSessionType, BundleUnloaded, Bus, BusState, Config, Deps, KernelSlice, LifecycleChanged, ModelCommitted, MusicDescriptor, MusicMode, MusicOptions, MusicRequest, MusicSwitch, MusicTrack, RetiringTrack, SceneChanged, SfxRequest, SoundEntry, State, StreamTrack, Volumes };
|
|
1408
|
+
declare namespace types_d_exports$1 {
|
|
1409
|
+
export { AudioApi, AudioContextLike, AudioCtx, AudioSessionLike, AudioSessionType, BundleUnloaded, Bus, BusState, Config$1 as Config, Deps$1 as Deps, KernelSlice$1 as KernelSlice, LifecycleChanged, ModelCommitted, MusicDescriptor, MusicMode, MusicOptions, MusicRequest, MusicSwitch, MusicTrack, RetiringTrack, SceneChanged, SfxRequest, SoundEntry, State$1 as State, StreamTrack, Volumes };
|
|
1608
1410
|
}
|
|
1609
1411
|
/**
|
|
1610
1412
|
* The three volume buses. `master` carries the whole game, `music` the scene track, `sfx` every
|
|
@@ -1742,7 +1544,7 @@ type RetiringTrack = {
|
|
|
1742
1544
|
* });
|
|
1743
1545
|
* ```
|
|
1744
1546
|
*/
|
|
1745
|
-
type Config = {
|
|
1547
|
+
type Config$1 = {
|
|
1746
1548
|
/** Start gain of each bus, 0..1. Overridden per commit when `volumes` is set. */buses: {
|
|
1747
1549
|
master: number;
|
|
1748
1550
|
music: number;
|
|
@@ -1815,7 +1617,7 @@ type MusicSwitch = {
|
|
|
1815
1617
|
/**
|
|
1816
1618
|
* audio plugin state.
|
|
1817
1619
|
*/
|
|
1818
|
-
type State = {
|
|
1620
|
+
type State$1 = {
|
|
1819
1621
|
/** `undefined` means headless: no graph, no sound, every member still keeps its value. */context: AudioContextLike | undefined;
|
|
1820
1622
|
buses: Record<Bus, BusState>; /** A lifecycle push is in force: every bus is held at zero. */
|
|
1821
1623
|
paused: boolean;
|
|
@@ -1943,10 +1745,10 @@ type AudioApi = {
|
|
|
1943
1745
|
/**
|
|
1944
1746
|
* Resolved dependency APIs.
|
|
1945
1747
|
*/
|
|
1946
|
-
type Deps = {
|
|
1748
|
+
type Deps$1 = {
|
|
1947
1749
|
flow: Api$1;
|
|
1948
|
-
assets: Api$
|
|
1949
|
-
model: Api$
|
|
1750
|
+
assets: Api$3;
|
|
1751
|
+
model: Api$4;
|
|
1950
1752
|
time: Api;
|
|
1951
1753
|
};
|
|
1952
1754
|
/**
|
|
@@ -1954,7 +1756,7 @@ type Deps = {
|
|
|
1954
1756
|
*
|
|
1955
1757
|
* `audio` owns no event, so `emit` is the kernel's and never called here.
|
|
1956
1758
|
*/
|
|
1957
|
-
type KernelSlice = PluginCtx<Config, State> & {
|
|
1759
|
+
type KernelSlice$1 = PluginCtx<Config$1, State$1> & {
|
|
1958
1760
|
readonly global: object;
|
|
1959
1761
|
readonly log: Log.LogApi;
|
|
1960
1762
|
readonly require: Require;
|
|
@@ -1962,13 +1764,13 @@ type KernelSlice = PluginCtx<Config, State> & {
|
|
|
1962
1764
|
/**
|
|
1963
1765
|
* Domain context shared by the files of the plugin: the kernel slice plus the resolved deps.
|
|
1964
1766
|
*/
|
|
1965
|
-
type AudioCtx = KernelSlice & {
|
|
1966
|
-
readonly deps: Deps;
|
|
1767
|
+
type AudioCtx = KernelSlice$1 & {
|
|
1768
|
+
readonly deps: Deps$1;
|
|
1967
1769
|
};
|
|
1968
1770
|
/**
|
|
1969
1771
|
* Payload of the `model:committed` hook: the source of every volume a game sets.
|
|
1970
1772
|
*/
|
|
1971
|
-
type ModelCommitted = Events$
|
|
1773
|
+
type ModelCommitted = Events$2["model:committed"];
|
|
1972
1774
|
/**
|
|
1973
1775
|
* Payload of the `scenes:changed` hook: `music` is the track the next scene declared.
|
|
1974
1776
|
*/
|
|
@@ -1976,11 +1778,11 @@ type SceneChanged = Events["scenes:changed"];
|
|
|
1976
1778
|
/**
|
|
1977
1779
|
* Payload of the `lifecycle:changed` hook: the pause that holds every bus at zero.
|
|
1978
1780
|
*/
|
|
1979
|
-
type LifecycleChanged = Events$
|
|
1781
|
+
type LifecycleChanged = Events$3["lifecycle:changed"];
|
|
1980
1782
|
/**
|
|
1981
1783
|
* Payload of the `assets:bundle-unloaded` hook: `keys` names every decoded sound that is gone.
|
|
1982
1784
|
*/
|
|
1983
|
-
type BundleUnloaded = Events$
|
|
1785
|
+
type BundleUnloaded = Events$4["assets:bundle-unloaded"];
|
|
1984
1786
|
/**
|
|
1985
1787
|
* What one play of a sound asks for: the key and the bus the sound goes to.
|
|
1986
1788
|
*/
|
|
@@ -1996,4 +1798,239 @@ type MusicRequest = {
|
|
|
1996
1798
|
fadeMs: number;
|
|
1997
1799
|
};
|
|
1998
1800
|
//#endregion
|
|
1999
|
-
|
|
1801
|
+
//#region src/plugins/ui/layout/types.d.ts
|
|
1802
|
+
/**
|
|
1803
|
+
* layout module state. `nodes` is attach minus detach: Yoga 3.2.1 has no instance counter.
|
|
1804
|
+
*/
|
|
1805
|
+
type LayoutState = {
|
|
1806
|
+
yoga: Yoga | undefined;
|
|
1807
|
+
byEntity: Map<Entity, Node>;
|
|
1808
|
+
nodes: number;
|
|
1809
|
+
measured: number;
|
|
1810
|
+
solves: number;
|
|
1811
|
+
scrolling: Entity | undefined;
|
|
1812
|
+
scrollStart: {
|
|
1813
|
+
pointerY: number;
|
|
1814
|
+
offset: number;
|
|
1815
|
+
};
|
|
1816
|
+
order: number;
|
|
1817
|
+
cleanups: Array<() => void>;
|
|
1818
|
+
};
|
|
1819
|
+
declare namespace types_d_exports {
|
|
1820
|
+
export { Config, Deps, ElementChange, ElementMotion, Finding, FocusRing, KernelSlice, State, TextInputLook, UiApi, UiCtx, UiNode };
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* The look of the keyboard focus ring: a dashed ring with a solid halo under it, drawn around the
|
|
1824
|
+
* focused control. Colours are `0xRRGGBB`, lengths reference units.
|
|
1825
|
+
*
|
|
1826
|
+
* @example
|
|
1827
|
+
* ```ts
|
|
1828
|
+
* // A dashed ink ring with a cream halo, 9 u outside the control.
|
|
1829
|
+
* const ring: FocusRing = {
|
|
1830
|
+
* stroke: 0x3a2212, strokeWidth: 4, dash: 10, offset: 9, halo: 0xfff3d6, haloWidth: 12
|
|
1831
|
+
* };
|
|
1832
|
+
* ```
|
|
1833
|
+
*/
|
|
1834
|
+
type FocusRing = {
|
|
1835
|
+
/** The colour of the dashed ring. */stroke: number; /** The stroke width of the dashed ring. */
|
|
1836
|
+
strokeWidth: number; /** The dash length of the ring, with gaps of half a dash; 0 draws it solid. */
|
|
1837
|
+
dash: number; /** How far outside the control's rect the ring runs, on every side. */
|
|
1838
|
+
offset: number; /** The colour of the solid halo drawn under the ring. */
|
|
1839
|
+
halo: number; /** The stroke width of the halo, centred on the same path as the ring. */
|
|
1840
|
+
haloWidth: number;
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* The look of a text field while it is edited: the caret, the selection box and the IME
|
|
1844
|
+
* underline. Colours are `0xRRGGBB`, lengths reference units, `keyboardMargin` CSS px. The caret
|
|
1845
|
+
* does not blink.
|
|
1846
|
+
*
|
|
1847
|
+
* @example
|
|
1848
|
+
* ```ts
|
|
1849
|
+
* // A thick ink caret, a pale blue selection, the field 16 px above the keyboard.
|
|
1850
|
+
* const look: TextInputLook = {
|
|
1851
|
+
* caretWidth: 3, caret: 0x3a2212, selection: 0x3390ff, selectionAlpha: 0.35,
|
|
1852
|
+
* composingUnderline: 3, keyboardMargin: 16
|
|
1853
|
+
* };
|
|
1854
|
+
* ```
|
|
1855
|
+
*/
|
|
1856
|
+
type TextInputLook = {
|
|
1857
|
+
/** The width of the caret. */caretWidth: number; /** The colour of the caret and of the underline under an IME composing range. */
|
|
1858
|
+
caret: number; /** The colour of the selection box. */
|
|
1859
|
+
selection: number; /** The alpha of the selection box. */
|
|
1860
|
+
selectionAlpha: number; /** The height of the underline under an IME composing range. */
|
|
1861
|
+
composingUnderline: number; /** How far above the keyboard the bottom of the edited field is lifted, in CSS px. */
|
|
1862
|
+
keyboardMargin: number;
|
|
1863
|
+
};
|
|
1864
|
+
/**
|
|
1865
|
+
* ui plugin config.
|
|
1866
|
+
*
|
|
1867
|
+
* @example
|
|
1868
|
+
* ```ts
|
|
1869
|
+
* createApp({ pluginConfigs: { ui: { tapTargetPt: 48, breakpoints: { tall: 2, wide: 1.5 } } } });
|
|
1870
|
+
* // A game with a white focus ring on a dark board.
|
|
1871
|
+
* createApp({
|
|
1872
|
+
* pluginConfigs: {
|
|
1873
|
+
* ui: {
|
|
1874
|
+
* focusRing: {
|
|
1875
|
+
* stroke: 0xffffff, strokeWidth: 4, dash: 10, offset: 9, halo: 0x000000, haloWidth: 12
|
|
1876
|
+
* }
|
|
1877
|
+
* }
|
|
1878
|
+
* }
|
|
1879
|
+
* });
|
|
1880
|
+
* // A game whose text fields have an ink caret.
|
|
1881
|
+
* createApp({
|
|
1882
|
+
* pluginConfigs: {
|
|
1883
|
+
* ui: {
|
|
1884
|
+
* textInput: {
|
|
1885
|
+
* caretWidth: 3, caret: 0x3a2212, selection: 0x3390ff, selectionAlpha: 0.35,
|
|
1886
|
+
* composingUnderline: 3, keyboardMargin: 16
|
|
1887
|
+
* }
|
|
1888
|
+
* }
|
|
1889
|
+
* }
|
|
1890
|
+
* });
|
|
1891
|
+
* ```
|
|
1892
|
+
*/
|
|
1893
|
+
type Config = {
|
|
1894
|
+
/** Smallest tap target `lint()` accepts, in CSS px (points). */tapTargetPt: number; /** `when` flags: `tall` when height / width is at least `tall`, `wide` the other way round. */
|
|
1895
|
+
breakpoints: {
|
|
1896
|
+
tall: number;
|
|
1897
|
+
wide: number;
|
|
1898
|
+
};
|
|
1899
|
+
/**
|
|
1900
|
+
* The ring drawn around the control the keyboard focused. Shallow merge: a game that sets
|
|
1901
|
+
* `focusRing` gives all six fields.
|
|
1902
|
+
*/
|
|
1903
|
+
focusRing: FocusRing;
|
|
1904
|
+
/**
|
|
1905
|
+
* The caret, the selection and the IME underline of a text field. Shallow merge: a game that
|
|
1906
|
+
* sets `textInput` gives all six fields.
|
|
1907
|
+
*/
|
|
1908
|
+
textInput: TextInputLook;
|
|
1909
|
+
};
|
|
1910
|
+
/**
|
|
1911
|
+
* ui plugin state: one branch per module.
|
|
1912
|
+
*/
|
|
1913
|
+
type State = {
|
|
1914
|
+
jsx: JsxState;
|
|
1915
|
+
styles: StylesState;
|
|
1916
|
+
layout: LayoutState;
|
|
1917
|
+
};
|
|
1918
|
+
/**
|
|
1919
|
+
* Resolved dependency APIs. `anim` is here for the dev hot swap, which replaces animations; the
|
|
1920
|
+
* motions of `ui` reach `anim` through the tween driver behind every `ViewHandle`.
|
|
1921
|
+
*/
|
|
1922
|
+
type Deps = {
|
|
1923
|
+
anim: AnimApi;
|
|
1924
|
+
time: Api;
|
|
1925
|
+
flow: Api$1;
|
|
1926
|
+
world: Api$2;
|
|
1927
|
+
renderer: Api$5;
|
|
1928
|
+
input: InputApi;
|
|
1929
|
+
i18n: I18nApi;
|
|
1930
|
+
text: TextApi;
|
|
1931
|
+
};
|
|
1932
|
+
/**
|
|
1933
|
+
* What the kernel context offers before the deps are attached.
|
|
1934
|
+
*
|
|
1935
|
+
* `ui` owns no event of its own; `emit` sends the global `ui:hot-swap` of the dev hot swap.
|
|
1936
|
+
*/
|
|
1937
|
+
type KernelSlice = PluginCtx<Config, State, Events$5> & {
|
|
1938
|
+
readonly global: object;
|
|
1939
|
+
readonly log: Log.LogApi;
|
|
1940
|
+
readonly require: Require;
|
|
1941
|
+
};
|
|
1942
|
+
/**
|
|
1943
|
+
* Domain context shared by the three modules: the kernel slice plus the resolved deps.
|
|
1944
|
+
*/
|
|
1945
|
+
type UiCtx = KernelSlice & {
|
|
1946
|
+
readonly deps: Deps;
|
|
1947
|
+
};
|
|
1948
|
+
/**
|
|
1949
|
+
* ui plugin API, `app.ui`. The screen is one more projection, so three members read it the way a
|
|
1950
|
+
* test reads the board: a snapshot, a key lookup and a list of findings; the fourth types into a
|
|
1951
|
+
* text field.
|
|
1952
|
+
*
|
|
1953
|
+
* @example
|
|
1954
|
+
* ```ts
|
|
1955
|
+
* // A headless scenario taps the claim button of the reward popup.
|
|
1956
|
+
* app.ui.tree().type; // "row", the root element of the HUD
|
|
1957
|
+
* app.input.tap(app.ui.find("claim") ?? 0);
|
|
1958
|
+
* app.ui.lint(); // []
|
|
1959
|
+
* ```
|
|
1960
|
+
*/
|
|
1961
|
+
type UiApi = {
|
|
1962
|
+
/**
|
|
1963
|
+
* The live screen as plain data: every root in layer order, every element in child order, with
|
|
1964
|
+
* its rect in root coordinates, its resolved style and its seven state flags. A rect is natural:
|
|
1965
|
+
* under a `fit: "contain"` element it is the rect before that scale, and the fitted element
|
|
1966
|
+
* adds `fitScale`. A windowed scroll adds `window`, and its content lists the live rows only.
|
|
1967
|
+
* Works headless.
|
|
1968
|
+
*
|
|
1969
|
+
* @returns The root node; several roots come back under one `screen` node.
|
|
1970
|
+
* @example
|
|
1971
|
+
* ```ts
|
|
1972
|
+
* // On an iPhone SE the 970 u board is drawn smaller to fit the slot between the bars.
|
|
1973
|
+
* const screen = app.ui.tree();
|
|
1974
|
+
* screen.children.map(child => child.key); // ["fitTop", "slot", "fitBottom"]
|
|
1975
|
+
* const board = screen.children[1]?.children[0];
|
|
1976
|
+
* board?.rect.w; // 970, the natural width
|
|
1977
|
+
* board?.fitScale; // 0.805, the 781 u the slot leaves over 970 u
|
|
1978
|
+
* ```
|
|
1979
|
+
*/
|
|
1980
|
+
tree(): UiNode;
|
|
1981
|
+
/**
|
|
1982
|
+
* The entity of a keyed element, so a test can tap it and `anim` can aim at it. Popup roots
|
|
1983
|
+
* come first, then the projection roots in layer order.
|
|
1984
|
+
*
|
|
1985
|
+
* @param key - The `key` prop of the element.
|
|
1986
|
+
* @returns The entity, or `undefined` for an unknown or exiting element.
|
|
1987
|
+
* @example
|
|
1988
|
+
* ```ts
|
|
1989
|
+
* // A headless scenario answers the gate through the button of the popup.
|
|
1990
|
+
* app.input.tap(app.ui.find("claim") ?? 0); // true
|
|
1991
|
+
* app.ui.find("nothing"); // undefined
|
|
1992
|
+
* ```
|
|
1993
|
+
*/
|
|
1994
|
+
find(key: string): Entity | undefined;
|
|
1995
|
+
/**
|
|
1996
|
+
* Reads the live screen against the five rules: a tap target under `tapTargetPt` at the size
|
|
1997
|
+
* it is drawn (a `fit: "contain"` on it or above it shrinks it), a text that does not fit its
|
|
1998
|
+
* box in some registered locale, an absolute element with no `reason`, a clipping element
|
|
1999
|
+
* (`scroll`, `overflow: "hidden"`) whose style names a nine-slice it never draws, and a root
|
|
2000
|
+
* element whose style sets a `zIndex` it ignores. Never throws; empty when nothing is mounted.
|
|
2001
|
+
*
|
|
2002
|
+
* @returns One finding per rule and element.
|
|
2003
|
+
* @example
|
|
2004
|
+
* ```ts
|
|
2005
|
+
* // A game test keeps the board honest on an iPhone SE: a 140 u cell in the 0.8 slot.
|
|
2006
|
+
* app.ui.lint(); // [{ rule: "tap-target", key: "cell", detail: "39 x 39 pt" }]
|
|
2007
|
+
* // A list styled with a nine-slice: the clip keeps it from drawing.
|
|
2008
|
+
* app.ui.lint(); // [{ rule: "nine-slice-clipped", key: "orders", detail: "scroll" }]
|
|
2009
|
+
* // A screen root that asks to be drawn over the others: the layer decides that.
|
|
2010
|
+
* app.ui.lint(); // [{ rule: "z-index-on-root", key: "board", detail: "zIndex 2" }]
|
|
2011
|
+
* ```
|
|
2012
|
+
*/
|
|
2013
|
+
lint(): readonly Finding[];
|
|
2014
|
+
/**
|
|
2015
|
+
* Types into a text field the way a player does, for a headless test or an agent: the field
|
|
2016
|
+
* becomes the one being edited, `value` cut to its `maxLength` is written into it, and the
|
|
2017
|
+
* local field it names is written, so the component re-renders on the next frame. Nothing
|
|
2018
|
+
* reaches the gate: Enter submits.
|
|
2019
|
+
*
|
|
2020
|
+
* @param key - The `key` prop of the `input` element.
|
|
2021
|
+
* @param value - The text to type.
|
|
2022
|
+
* @returns True when the field took the text; false with one warning when no live `input` has
|
|
2023
|
+
* the key.
|
|
2024
|
+
* @example
|
|
2025
|
+
* ```ts
|
|
2026
|
+
* // A headless test renames the player through the Rename popup.
|
|
2027
|
+
* app.ui.fill("nameField", "Alex"); // true
|
|
2028
|
+
* app.time.step(16);
|
|
2029
|
+
* app.input.pressKey("Enter"); // true: the gate took { intent: "save", payload: { name: "Alex" } }
|
|
2030
|
+
* app.ui.fill("nothing", "Alex"); // false, with the warning "ui:fill-without-input"
|
|
2031
|
+
* ```
|
|
2032
|
+
*/
|
|
2033
|
+
fill(key: string, value: string): boolean;
|
|
2034
|
+
};
|
|
2035
|
+
//#endregion
|
|
2036
|
+
export { SfxDescriptor as A, sequence as B, Config$3 as C, Target as D, State$3 as E, frames as F, stagger as G, sfx as H, haptic as I, wait as J, tween as K, mark as L, HAPTIC_KINDS as M, defineAnimation as N, types_d_exports$3 as O, external as P, parallel as R, AnimPlayerValue as S, MotionKeyframe as T, spawn as U, set as V, spawned as W, SceneSpec as _, AudioApi as a, types_d_exports$2 as b, MusicDescriptor as c, State$1 as d, types_d_exports$1 as f, SceneDefinition as g, LayerMap as h, types_d_exports as i, Step as j, HapticKind as k, MusicOptions as l, DefineScene as m, State as n, AudioContextLike as o, AnySceneProjection as p, use as q, UiApi as r, Config$1 as s, Config as t, SoundEntry as u, ScenesApi as v, FramesValue as w, AnimApi as x, State$2 as y, play as z };
|