@moku-labs/game 0.15.39 → 0.15.41
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 +1 -1
- package/dist/app/page.d.mts +1 -1
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{capture-PTJXDpxK.mjs → capture-BtS6_oWr.mjs} +61 -1
- package/dist/{commands-CMFdiDcg.d.mts → commands-DLk06fiL.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/control.mjs +1 -1
- package/dist/{define-D27mfOhZ.d.mts → define-CgU4dz0e.d.mts} +2 -2
- package/dist/{headless-CRqMxzqv.d.mts → headless-1e3gEF1Y.d.mts} +1 -1
- package/dist/{headless-Bxxl_mQX.mjs → headless-CCiUwvlp.mjs} +1 -1
- package/dist/{index-DFAjLwxi.d.mts → index-D12s9KZ2.d.mts} +19 -7
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +6 -6
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{run-G4m1APMv.mjs → run-8s7kh2QD.mjs} +2 -2
- package/dist/{runtime-CbLZyDXj.d.mts → runtime-Bpg0WmM8.d.mts} +1 -1
- package/dist/{src-B2vblgmb.mjs → src-CWVwT9UM.mjs} +1858 -721
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +2 -2
- package/dist/{types-54KzmAA6.d.mts → types-B-o8Ul1v.d.mts} +2 -2
- package/dist/{types-0Br0SjTB.d.mts → types-CFEtGENK.d.mts} +1 -1
- package/dist/{types-H1FiWmKa.d.mts → types-DQ9VHXun.d.mts} +4 -4
- package/dist/{types-C_dk-lXz.d.mts → types-DrkR03nL.d.mts} +413 -31
- package/dist/{types-CGPWYbZO.d.mts → types-gQATSj41.d.mts} +2 -2
- package/dist/{visual-DjTJ02c3.d.mts → visual-pHKIFBSQ.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +14 -4
- package/package.json +1 -1
|
@@ -2618,21 +2618,25 @@ type NodeSpec<Game extends GameState, Input, Tags extends OutcomeTags> = {
|
|
|
2618
2618
|
*/
|
|
2619
2619
|
type DefineNode<Game extends GameState> = <Input = void, const Tags extends OutcomeTags = OutcomeTags>(spec: NodeSpec<Game, Input, Tags>) => NodeDefinition<Input, Tags, Game>;
|
|
2620
2620
|
/**
|
|
2621
|
-
* An extension point inside a flow: a node whose body is "run the contributions in order".
|
|
2622
|
-
*
|
|
2621
|
+
* An extension point inside a flow: a node whose body is "run the contributions in order". Its
|
|
2622
|
+
* outcomes are `done` and the named outcomes `slot()` declares, so the flow that holds it routes
|
|
2623
|
+
* each of them with an ordinary edge. Without type arguments it is a slot that declares none.
|
|
2623
2624
|
*
|
|
2624
2625
|
* @example
|
|
2625
2626
|
* ```ts
|
|
2626
|
-
*
|
|
2627
|
+
* // A feature may send the player from the slot to the shop, on the tab it names.
|
|
2628
|
+
* const afterOrder: SlotNode<{ shop: TypeTag<{ tab: string }> }, "afterOrder"> = slot("afterOrder", {
|
|
2629
|
+
* shop: type<{ tab: string }>()
|
|
2630
|
+
* });
|
|
2627
2631
|
* // { kind: "slot", name: "afterOrder", input: { kind: "type" },
|
|
2628
|
-
* // outcomes: { done: { kind: "type" } } }
|
|
2632
|
+
* // outcomes: { done: { kind: "type" }, shop: { kind: "type" } } }
|
|
2629
2633
|
* ```
|
|
2630
2634
|
*/
|
|
2631
|
-
type SlotNode = Wired<void, {
|
|
2635
|
+
type SlotNode<Tags extends OutcomeTags = Record<never, never>, Name extends string = string> = Wired<void, {
|
|
2632
2636
|
readonly done: TypeTag<void>;
|
|
2633
|
-
}> & {
|
|
2637
|
+
} & Tags> & {
|
|
2634
2638
|
readonly kind: "slot";
|
|
2635
|
-
readonly name:
|
|
2639
|
+
readonly name: Name;
|
|
2636
2640
|
};
|
|
2637
2641
|
/**
|
|
2638
2642
|
* Edge target that leaves the sub-flow with this outcome. The payload passes through.
|
|
@@ -2774,6 +2778,32 @@ type CheckTarget<Nodes extends NodeTable, FlowTags extends OutcomeTags, NodeName
|
|
|
2774
2778
|
* ```
|
|
2775
2779
|
*/
|
|
2776
2780
|
type CheckedEdges<Nodes extends NodeTable, FlowTags extends OutcomeTags, Table> = { readonly [Name in keyof Nodes & string]: { readonly [Outcome in keyof Nodes[Name]["outcomes"] & string]: Name extends keyof Table ? Outcome extends keyof Table[Name] ? CheckTarget<Nodes, FlowTags, Name, Outcome, PayloadOf<Nodes[Name]["outcomes"][Outcome]>, Table[Name][Outcome]> : AnyTargetOf<Nodes, FlowTags> : AnyTargetOf<Nodes, FlowTags> } & (Name extends keyof Table ? { readonly [Extra in Exclude<keyof Table[Name], keyof Nodes[Name]["outcomes"]> & string]: GraphError<`Node "${Name}" has no outcome "${Extra}".`> } : unknown) } & { readonly [Extra in Exclude<keyof Table, keyof Nodes> & string]: GraphError<`"${Extra}" is not a node of this flow.`> };
|
|
2781
|
+
/**
|
|
2782
|
+
* Checks one outcome `Outcome` of the contributed flow `Contributed` against the slot `Host`:
|
|
2783
|
+
* `never` when it is `done`, or an outcome the slot declares whose payload fits; a `GraphError`
|
|
2784
|
+
* sentence otherwise.
|
|
2785
|
+
*/
|
|
2786
|
+
type OutcomeFit<Contributed extends AnyFlow, Host extends SlotNode<OutcomeTags, string>, Outcome extends keyof Contributed["outcomes"]> = Outcome extends "done" ? never : Outcome extends Exclude<keyof Host["outcomes"], "done"> ? Accepts<PayloadOf<Contributed["outcomes"][Outcome]>, PayloadOf<Host["outcomes"][Outcome]>> extends true ? never : GraphError<`Payload of outcome "${Outcome & string}" does not fit slot "${Host["name"]}".`> : GraphError<`Slot "${Host["name"]}" declares no outcome "${Outcome & string}".`>;
|
|
2787
|
+
/**
|
|
2788
|
+
* The outcomes of `Contributed` that do not fit the slot `Host`, as `GraphError` sentences, or
|
|
2789
|
+
* `never` when every outcome fits.
|
|
2790
|
+
*/
|
|
2791
|
+
type MisfitOutcomes<Contributed extends AnyFlow, Host extends SlotNode<OutcomeTags, string>> = { [Outcome in keyof Contributed["outcomes"]]: OutcomeFit<Contributed, Host, Outcome> }[keyof Contributed["outcomes"]];
|
|
2792
|
+
/**
|
|
2793
|
+
* Checking type of `contribution()`: whether the flow `Contributed` fits the slot `Host`. Every
|
|
2794
|
+
* outcome of the flow is `done`, or an outcome the slot declares whose payload fits; then it is
|
|
2795
|
+
* `unknown`, otherwise the `GraphError` sentence of the misfit. A slot that declares no outcome
|
|
2796
|
+
* accepts any flow, and a flow without outcomes fits any slot.
|
|
2797
|
+
*
|
|
2798
|
+
* @example
|
|
2799
|
+
* ```ts
|
|
2800
|
+
* // episodeStep = slot("episodeStep", { shop: type<{ tab: string }>() })
|
|
2801
|
+
* type Fitting = Fits<typeof storyFlow, typeof episodeStep>; // unknown: outcomes done and shop
|
|
2802
|
+
* type Misfit = Fits<typeof giftFlow, typeof episodeStep>; // giftFlow exits "gift":
|
|
2803
|
+
* // GraphError<'Slot "episodeStep" declares no outcome "gift".'>
|
|
2804
|
+
* ```
|
|
2805
|
+
*/
|
|
2806
|
+
type Fits<Contributed extends AnyFlow, Host extends SlotNode<OutcomeTags, string>> = [Exclude<keyof Host["outcomes"], "done">] extends [never] ? unknown : [MisfitOutcomes<Contributed, Host>] extends [never] ? unknown : MisfitOutcomes<Contributed, Host>;
|
|
2777
2807
|
/**
|
|
2778
2808
|
* A flow as `defineFlow` returns it: plain data. A flow that declares `input` and `outcomes`
|
|
2779
2809
|
* is used as a node of another flow.
|
|
@@ -3118,7 +3148,13 @@ type RunnerState = {
|
|
|
3118
3148
|
* transit nodes, so `bookmark()` writes its `rest` only when these frames name a rest node.
|
|
3119
3149
|
*/
|
|
3120
3150
|
restFrame: Frame[] | undefined; /** Inside a slot: the contribution the loop just finished. The slot continues after it. */
|
|
3121
|
-
slotAfter: string | undefined; /**
|
|
3151
|
+
slotAfter: string | undefined; /** Inside a slot: the declared outcome a contribution left on. The slot takes its edge next. */
|
|
3152
|
+
slotLeave: {
|
|
3153
|
+
outcome: string;
|
|
3154
|
+
payload: Json;
|
|
3155
|
+
} | undefined; /** Edges committed since the loop last arrived at a rest node. */
|
|
3156
|
+
restless: number; /** Edges without a rest node after which the next one fails: `max(64, 4 × expanded nodes)`. */
|
|
3157
|
+
restlessCap: number; /** Edges since the last checkpoint. */
|
|
3122
3158
|
journal: JournalEntry[];
|
|
3123
3159
|
journalIndex: number; /** The promise of `run()`. `undefined`: not started. */
|
|
3124
3160
|
running: Promise<void> | undefined; /** Aborts the active node. */
|
|
@@ -3442,12 +3478,19 @@ type FeatureTextStyles = {
|
|
|
3442
3478
|
*/
|
|
3443
3479
|
type FeatureDescription = {
|
|
3444
3480
|
/** Nodes the feature owns. Recorded for `describe()` and hot swap. */nodes?: readonly AnyNode[]; /** Flows the feature owns. */
|
|
3445
|
-
flows?: readonly AnyFlow[];
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3481
|
+
flows?: readonly AnyFlow[];
|
|
3482
|
+
/**
|
|
3483
|
+
* Slot name to the sub-flow run in that slot. Written by hand, an entry is checked by name at
|
|
3484
|
+
* `run()`; `...contribution(slot, spec)` also checks its outcomes against the slot at compile time.
|
|
3485
|
+
*
|
|
3486
|
+
* @example
|
|
3487
|
+
* ```ts
|
|
3488
|
+
* // The story runs in the slot "episodeStep" and may leave it on one of the slot's outcomes.
|
|
3489
|
+
* contribute: { ...contribution(episodeStep, { flow: storyFlow, order: 10 }) }
|
|
3490
|
+
* // { episodeStep: { flow: storyFlow, order: 10 } }
|
|
3491
|
+
* ```
|
|
3492
|
+
*/
|
|
3493
|
+
contribute?: Record<string, ContributionSpec>;
|
|
3451
3494
|
/**
|
|
3452
3495
|
* Sub-features this feature declares, each in a folder of its own inside this feature's folder,
|
|
3453
3496
|
* in the order they are composed. `defineGameApp` composes them right after this feature; this
|
|
@@ -3483,19 +3526,37 @@ type FeaturePlugin = AnyPluginInstance & {
|
|
|
3483
3526
|
readonly features: readonly FeaturePlugin[];
|
|
3484
3527
|
};
|
|
3485
3528
|
/**
|
|
3486
|
-
* One sub-flow
|
|
3529
|
+
* One entry of a feature's `contribute`: the sub-flow a slot runs, its place among the slot's
|
|
3530
|
+
* contributions (lowest `order` first) and the `when` that may skip it. `when` reads the committed
|
|
3531
|
+
* state. `contribution(slot, spec)` builds the entry under the slot's name.
|
|
3487
3532
|
*
|
|
3488
3533
|
* @example
|
|
3489
3534
|
* ```ts
|
|
3490
|
-
*
|
|
3535
|
+
* // The story of episode 1 runs in the slot "episodeStep" while the player is in episode 1.
|
|
3536
|
+
* // `episodeOf` is the game's reader of the committed player tree.
|
|
3537
|
+
* const story: ContributionSpec = {
|
|
3538
|
+
* flow: storyFlow,
|
|
3539
|
+
* order: 10,
|
|
3540
|
+
* when: snapshot => episodeOf(snapshot.player) === "ep01"
|
|
3541
|
+
* };
|
|
3491
3542
|
* ```
|
|
3492
3543
|
*/
|
|
3493
|
-
type
|
|
3494
|
-
feature: string;
|
|
3544
|
+
type ContributionSpec = {
|
|
3495
3545
|
flow: AnyFlow;
|
|
3496
3546
|
order: number;
|
|
3497
3547
|
when?: (snapshot: Snapshot) => boolean;
|
|
3498
3548
|
};
|
|
3549
|
+
/**
|
|
3550
|
+
* One sub-flow contributed to a slot, with the feature that contributed it.
|
|
3551
|
+
*
|
|
3552
|
+
* @example
|
|
3553
|
+
* ```ts
|
|
3554
|
+
* const contribution: Contribution = { feature: "reward", flow: rewardFlow, order: 10 };
|
|
3555
|
+
* ```
|
|
3556
|
+
*/
|
|
3557
|
+
type Contribution = ContributionSpec & {
|
|
3558
|
+
feature: string;
|
|
3559
|
+
};
|
|
3499
3560
|
/**
|
|
3500
3561
|
* features module state.
|
|
3501
3562
|
*/
|
|
@@ -3652,20 +3713,55 @@ declare function exit<const Name extends string>(outcome: Name): Exit<Name>;
|
|
|
3652
3713
|
declare function to<const TargetName extends string, Payload, Output>(target: TargetName, map: (payload: Payload) => Output): Mapped<TargetName, Payload, Output>;
|
|
3653
3714
|
/**
|
|
3654
3715
|
* Defines an extension point: a node whose body is "run the contributions of this slot in order".
|
|
3655
|
-
* Its
|
|
3716
|
+
* Its outcomes are `done` and the ones declared here; the flow that holds the slot gives each an
|
|
3717
|
+
* edge. A contribution that exits `done` hands over to the next contribution whose `when` holds,
|
|
3718
|
+
* and with none left the slot takes its `done` edge. A contribution that exits a declared outcome
|
|
3719
|
+
* leaves the slot at once with its payload: the later contributions do not run, and the slot takes
|
|
3720
|
+
* its own edge of that outcome, journalled like `done`. The next entry of the slot starts again at
|
|
3721
|
+
* its first contribution. Without `outcomes` the slot declares only `done`.
|
|
3656
3722
|
*
|
|
3657
3723
|
* @param name - Slot name features contribute to.
|
|
3724
|
+
* @param outcomes - The named outcomes besides `done`, with the type tag of each payload.
|
|
3658
3725
|
* @returns The slot node as plain data.
|
|
3726
|
+
* @throws {TypeError} When `outcomes` declares `done`, which is every slot's own outcome.
|
|
3659
3727
|
* @example
|
|
3660
3728
|
* ```ts
|
|
3661
|
-
* //
|
|
3662
|
-
*
|
|
3663
|
-
* //
|
|
3729
|
+
* // After an order a feature may send the player to the shop, on the tab it names.
|
|
3730
|
+
* slot("afterOrder", { shop: type<{ tab: string }>() });
|
|
3731
|
+
* // { kind: "slot", name: "afterOrder", input: { kind: "type" },
|
|
3732
|
+
* // outcomes: { done: { kind: "type" }, shop: { kind: "type" } } }
|
|
3664
3733
|
* ```
|
|
3665
3734
|
*/
|
|
3666
|
-
declare function slot(name:
|
|
3735
|
+
declare function slot<const Name extends string, const Tags extends OutcomeTags = Record<never, never>>(name: Name, outcomes?: Tags & {
|
|
3736
|
+
readonly done?: never;
|
|
3737
|
+
}): SlotNode<Tags, Name>;
|
|
3738
|
+
/**
|
|
3739
|
+
* Builds one typed entry of a feature's `contribute`: the flow a slot runs, under the slot's
|
|
3740
|
+
* name. The compiler checks every outcome of the flow: `done`, or an outcome the slot declares
|
|
3741
|
+
* whose payload fits; a slot that declares none accepts any flow. A raw `contribute` entry stays
|
|
3742
|
+
* valid and is checked by name at `run()` only.
|
|
3743
|
+
*
|
|
3744
|
+
* @param host - The slot node the flow runs in, as `slot()` returned it.
|
|
3745
|
+
* @param spec - The flow, its `order` among the slot's contributions and an optional `when`.
|
|
3746
|
+
* @param spec.flow - The contributed flow; an outcome the slot does not take is a compile error.
|
|
3747
|
+
* @param spec.order - Place among the contributions of the slot, lowest first.
|
|
3748
|
+
* @param spec.when - Skips the contribution while it returns false, read on the committed state.
|
|
3749
|
+
* @returns `{ [host.name]: spec }`, spread into `contribute`; no `when` key when none was given.
|
|
3750
|
+
* @example
|
|
3751
|
+
* ```ts
|
|
3752
|
+
* // The story feature fills the episode step of the main flow: spread the entry into contribute.
|
|
3753
|
+
* contribution(episodeStep, { flow: storyFlow, order: 10 });
|
|
3754
|
+
* // { episodeStep: { flow: storyFlow, order: 10 } }
|
|
3755
|
+
* contribute: { ...contribution(episodeStep, { flow: storyFlow, order: 10 }) }
|
|
3756
|
+
* ```
|
|
3757
|
+
*/
|
|
3758
|
+
declare function contribution<S extends SlotNode<OutcomeTags, string>, F extends AnyFlow>(host: S, spec: {
|
|
3759
|
+
flow: F & Fits<F, S>;
|
|
3760
|
+
order: number;
|
|
3761
|
+
when?: (snapshot: Snapshot) => boolean;
|
|
3762
|
+
}): Readonly<Record<S["name"], ContributionSpec>>;
|
|
3667
3763
|
declare namespace types_d_exports$4 {
|
|
3668
|
-
export { Allow, Answer, AnyFlow, AnyNode, AnyNodeContext, Api$3 as Api, Bookmark, BundlesOf, CheckedEdges, Config$4 as Config, Contribution, DefineNode, Deps$4 as Deps, Descriptor, Edges, Effect, EffectHandler, EffectOptions, EmitterIdOf, EnterCallback, Events$4 as Events, Exit, FeatureDescription, FeatureEmitter, FeatureFilter, FeaturePlugin, FeatureTree, FeaturesApi, FlowCtx, FlowDefinition, FlowEntry, FlowGraph, FlowKit, FlowSpec, FlowState, FxApi, FxHandler, GameState, GameTypes, GateApi, GraphError, GraphNode, GuideOptions, Hint, HudKeysOf, InboxApi, JournalEntry, KernelSlice$4 as KernelSlice, LifecycleChanged, Mapped, NodeContext, NodeDefinition, NodeFx, NodeInfo, NodeSpec, NodeTable, OutcomeTags, Position, RecoverContext, RegisteredFeature, Result, RouteStep, RunnerApi, SceneIdOf, SlotNode, Stage, State$4 as State, StringTableLike, Target, TextStylesOf, TypeTag, WorldEvent };
|
|
3764
|
+
export { Allow, Answer, AnyFlow, AnyNode, AnyNodeContext, Api$3 as Api, Bookmark, BundlesOf, CheckedEdges, Config$4 as Config, Contribution, ContributionSpec, DefineNode, Deps$4 as Deps, Descriptor, Edges, Effect, EffectHandler, EffectOptions, EmitterIdOf, EnterCallback, Events$4 as Events, Exit, FeatureDescription, FeatureEmitter, FeatureFilter, FeaturePlugin, FeatureTree, FeaturesApi, FlowCtx, FlowDefinition, FlowEntry, FlowGraph, FlowKit, FlowSpec, FlowState, FxApi, FxHandler, GameState, GameTypes, GateApi, GraphError, GraphNode, GuideOptions, Hint, HudKeysOf, InboxApi, JournalEntry, KernelSlice$4 as KernelSlice, LifecycleChanged, Mapped, NodeContext, NodeDefinition, NodeFx, NodeInfo, NodeSpec, NodeTable, OutcomeTags, Position, RecoverContext, RegisteredFeature, Result, RouteStep, RunnerApi, SceneIdOf, SlotNode, Stage, State$4 as State, StringTableLike, Target, TextStylesOf, TypeTag, WorldEvent };
|
|
3669
3765
|
}
|
|
3670
3766
|
/**
|
|
3671
3767
|
* flow plugin events.
|
|
@@ -9320,7 +9416,7 @@ type PictureRequest = {
|
|
|
9320
9416
|
reject: (error: Error) => void;
|
|
9321
9417
|
};
|
|
9322
9418
|
declare namespace types_d_exports$2 {
|
|
9323
|
-
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGraphics, PixiMatrix, PixiMesh, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiSprite, PixiTexture, PixiTextureSource, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, SafeArea, ShaderEventDetail, ShaderWhat, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail };
|
|
9419
|
+
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGraphics, PixiMatrix, PixiMesh, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiSprite, PixiTexture, PixiTextureSource, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, SafeArea, ShaderEventDetail, ShaderWhat, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail };
|
|
9324
9420
|
}
|
|
9325
9421
|
/**
|
|
9326
9422
|
* The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
|
|
@@ -10874,6 +10970,158 @@ type DebugApi = {
|
|
|
10874
10970
|
*/
|
|
10875
10971
|
state(): DebugSwitches;
|
|
10876
10972
|
};
|
|
10973
|
+
/**
|
|
10974
|
+
* The veil of a scene being left, every field resolved: a full-canvas rect in one colour that fades from 0 to `alpha`
|
|
10975
|
+
* over `inMs` from the switch start, and back to 0 over `outMs` after the swap.
|
|
10976
|
+
*
|
|
10977
|
+
* @example
|
|
10978
|
+
* ```ts
|
|
10979
|
+
* // A game that writes nothing: black at 45 %, 150 ms in, 150 ms out.
|
|
10980
|
+
* const cover: LeaveCover = { color: 0x000000, alpha: 0.45, inMs: 150, outMs: 150 };
|
|
10981
|
+
* ```
|
|
10982
|
+
*/
|
|
10983
|
+
type LeaveCover = {
|
|
10984
|
+
/** The colour of the veil, `0xRRGGBB`. */color: number; /** The alpha the veil fades in to, 0 to 1. */
|
|
10985
|
+
alpha: number; /** Clock milliseconds from 0 to `alpha`; 0 shows it at once. */
|
|
10986
|
+
inMs: number; /** Clock milliseconds from where it stands at the swap back to 0; 0 takes it away at once. */
|
|
10987
|
+
outMs: number;
|
|
10988
|
+
};
|
|
10989
|
+
/**
|
|
10990
|
+
* The loader of a scene being left, drawn above the veil when the switch is not done `afterMs` after its start, until
|
|
10991
|
+
* the swap: a game texture turning at the centre (`texture`), a layer of the scene drawn above the veil (`due`, which
|
|
10992
|
+
* makes what the loader draws only once it is due and answers its layer: `scenes` mounts a loader projection there),
|
|
10993
|
+
* or, with neither, a white ring the engine draws.
|
|
10994
|
+
*
|
|
10995
|
+
* @example
|
|
10996
|
+
* ```ts
|
|
10997
|
+
* const ring: LeaveLoader = { afterMs: 400 };
|
|
10998
|
+
* const spinner: LeaveLoader = { afterMs: 400, texture: "ui.loader.ring" };
|
|
10999
|
+
* // The layer "loading" above the veil, its views made only if the switch takes 250 ms.
|
|
11000
|
+
* const screen: LeaveLoader = { afterMs: 250, due: () => "loading" };
|
|
11001
|
+
* ```
|
|
11002
|
+
*/
|
|
11003
|
+
type LeaveLoader = {
|
|
11004
|
+
/** Clock milliseconds after the switch start the loader waits for. */afterMs: number; /** An asset key: the texture turns at the centre of the frame. A key no provider answers draws the ring. */
|
|
11005
|
+
texture?: string;
|
|
11006
|
+
/**
|
|
11007
|
+
* Called once, in the first frame the loader is due and before it is drawn, never for a switch done sooner: it
|
|
11008
|
+
* makes what the loader draws and answers the layer of the scene that holds it, whose container is drawn above the
|
|
11009
|
+
* veil from then until the swap. `undefined`, or a throw, draws the ring; a layer the scene does not declare draws
|
|
11010
|
+
* nothing.
|
|
11011
|
+
*
|
|
11012
|
+
* @returns The layer, or `undefined` for the ring.
|
|
11013
|
+
*/
|
|
11014
|
+
due?: () => string | undefined;
|
|
11015
|
+
};
|
|
11016
|
+
/**
|
|
11017
|
+
* What a scene switch shows over the scene being left: the veil, the loader, or both. A part left out is not drawn.
|
|
11018
|
+
*
|
|
11019
|
+
* @example
|
|
11020
|
+
* ```ts
|
|
11021
|
+
* // The default of `scenes`: the veil from the start, the engine's ring once the switch took 400 ms.
|
|
11022
|
+
* const look: LeaveLook = { cover: { color: 0x000000, alpha: 0.45, inMs: 150, outMs: 150 }, loader: { afterMs: 400 } };
|
|
11023
|
+
* ```
|
|
11024
|
+
*/
|
|
11025
|
+
type LeaveLook = {
|
|
11026
|
+
/** The veil; absent for none. */cover?: LeaveCover; /** The loader; absent for none. */
|
|
11027
|
+
loader?: LeaveLoader;
|
|
11028
|
+
};
|
|
11029
|
+
/**
|
|
11030
|
+
* The picture of a scene being left, `app.renderer.sync.leave` (spec 33, slice A2): a veil over the whole canvas and a
|
|
11031
|
+
* loader at its centre, drawn in a container of the engine above the root and every layer. `scenes` drives it: it
|
|
11032
|
+
* shows it at the start of a live switch, lands it at the swap and drops it on an abort. It takes no hit: the hit test
|
|
11033
|
+
* walks the layers of the scene only.
|
|
11034
|
+
*
|
|
11035
|
+
* @example
|
|
11036
|
+
* ```ts
|
|
11037
|
+
* // `scenes`, at the start of a switch from the ward, whose bundles are still loading.
|
|
11038
|
+
* const renderer = ctx.require(rendererPlugin);
|
|
11039
|
+
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs: 150, outMs: 150 }, loader: { afterMs: 400 } });
|
|
11040
|
+
* renderer.sync.leave.land(); // the board stands: the veil fades out over 150 ms, the ring is gone
|
|
11041
|
+
* ```
|
|
11042
|
+
*/
|
|
11043
|
+
type LeaveApi = {
|
|
11044
|
+
/**
|
|
11045
|
+
* Shows a look from now: the veil fades in from where it stands (0, or the level of a veil still fading out after
|
|
11046
|
+
* the last swap), the loader waits for its `afterMs`. A look shown while another runs replaces it. Asks for a frame.
|
|
11047
|
+
* Inert, nothing is drawn and nothing is kept.
|
|
11048
|
+
*
|
|
11049
|
+
* @param look - The veil and the loader, resolved.
|
|
11050
|
+
* @example
|
|
11051
|
+
* ```ts
|
|
11052
|
+
* // `scenes` leaves a scene whose `leave` names a turning texture: the veil from the next frame, the texture at 400 ms.
|
|
11053
|
+
* ctx.require(rendererPlugin).sync.leave.show({
|
|
11054
|
+
* cover: { color: 0x0b1020, alpha: 0.6, inMs: 150, outMs: 150 },
|
|
11055
|
+
* loader: { afterMs: 400, texture: "ui.loader.ring" }
|
|
11056
|
+
* });
|
|
11057
|
+
* ```
|
|
11058
|
+
*/
|
|
11059
|
+
show(look: LeaveLook): void;
|
|
11060
|
+
/**
|
|
11061
|
+
* The switch swapped the next scene in: the loader goes at once, the veil fades out over its `outMs` from where it
|
|
11062
|
+
* stands and is taken off the stage. Nothing runs: nothing happens.
|
|
11063
|
+
*
|
|
11064
|
+
* @example
|
|
11065
|
+
* ```ts
|
|
11066
|
+
* // `scenes`, right after the swap to the board: the board is drawn under the veil, which is gone 150 ms later.
|
|
11067
|
+
* ctx.require(rendererPlugin).sync.leave.land();
|
|
11068
|
+
* ```
|
|
11069
|
+
*/
|
|
11070
|
+
land(): void;
|
|
11071
|
+
/**
|
|
11072
|
+
* The switch ended without a swap (an abort, a throw): the veil and the loader go at once, in the next frame.
|
|
11073
|
+
* Nothing runs: nothing happens.
|
|
11074
|
+
*
|
|
11075
|
+
* @example
|
|
11076
|
+
* ```ts
|
|
11077
|
+
* // `scenes`, when a restore aborts the switch to the board: the ward stands as it was, undimmed.
|
|
11078
|
+
* ctx.require(rendererPlugin).sync.leave.drop();
|
|
11079
|
+
* ```
|
|
11080
|
+
*/
|
|
11081
|
+
drop(): void;
|
|
11082
|
+
};
|
|
11083
|
+
/**
|
|
11084
|
+
* The engine's objects of the picture of a scene being left, made once per application at the first step that needs
|
|
11085
|
+
* them and kept: `top` hangs on the stage above the root while a look runs; `veil` (the white texture, tinted) covers
|
|
11086
|
+
* the canvas; `frame` carries the root's transform, so `ring`, `spinner` and `held` (where a lifted layer hangs) are in
|
|
11087
|
+
* reference units. Not public.
|
|
11088
|
+
*/
|
|
11089
|
+
type LeaveObjects = {
|
|
11090
|
+
top: PixiContainer;
|
|
11091
|
+
veil: PixiSprite;
|
|
11092
|
+
frame: PixiContainer;
|
|
11093
|
+
ring: PixiGraphics;
|
|
11094
|
+
spinner: PixiSprite;
|
|
11095
|
+
held: PixiContainer;
|
|
11096
|
+
};
|
|
11097
|
+
/** What the loader of a running look draws once it is due. Not public. */
|
|
11098
|
+
type LoaderKind = "none" | "ring" | "texture" | "layer";
|
|
11099
|
+
/**
|
|
11100
|
+
* A running look: the moments it started and was last stepped at on the clock, the veil's level (0 to 1, the share of
|
|
11101
|
+
* its `alpha`), whether the swap came, what its loader draws and whether it shows, and the layer container it lifted
|
|
11102
|
+
* above the veil. Not public.
|
|
11103
|
+
*/
|
|
11104
|
+
type LeaveRun = {
|
|
11105
|
+
look: LeaveLook;
|
|
11106
|
+
startedAt: number;
|
|
11107
|
+
steppedAt: number;
|
|
11108
|
+
level: number;
|
|
11109
|
+
landed: boolean;
|
|
11110
|
+
loader: LoaderKind; /** The texture of a `"texture"` loader, resolved at `show`. */
|
|
11111
|
+
texture?: PixiTexture; /** A `"layer"` loader's `due` was called: once, the first frame it was due. */
|
|
11112
|
+
asked: boolean; /** The layer a `"layer"` loader's `due` answered; absent before. */
|
|
11113
|
+
layer?: string; /** The layer container a `"layer"` loader drew above the veil; absent while none hangs there. */
|
|
11114
|
+
lifted?: PixiContainer; /** The loader is shown: past its `afterMs`, before the swap. */
|
|
11115
|
+
shown: boolean;
|
|
11116
|
+
};
|
|
11117
|
+
/**
|
|
11118
|
+
* The picture of a scene being left (spec 33, slice A2): the running look, absent while none runs, and the engine's
|
|
11119
|
+
* objects, absent until the first look needs them and after the application that held them was lost. Not public.
|
|
11120
|
+
*/
|
|
11121
|
+
type LeaveState = {
|
|
11122
|
+
run?: LeaveRun;
|
|
11123
|
+
objects?: LeaveObjects;
|
|
11124
|
+
};
|
|
10877
11125
|
/**
|
|
10878
11126
|
* sync module API, `app.renderer.sync`. The one owner of every display object: it builds them
|
|
10879
11127
|
* from components, sorts them inside the named layers of the scene and answers hit tests.
|
|
@@ -11008,6 +11256,18 @@ type SyncApi = {
|
|
|
11008
11256
|
* ```
|
|
11009
11257
|
*/
|
|
11010
11258
|
filters: FiltersApi;
|
|
11259
|
+
/**
|
|
11260
|
+
* The picture of a scene being left: the veil and the loader `scenes` shows during a live switch.
|
|
11261
|
+
*
|
|
11262
|
+
* @example
|
|
11263
|
+
* ```ts
|
|
11264
|
+
* // `scenes`, at the start of a switch from the ward, and at the swap to the board.
|
|
11265
|
+
* const renderer = ctx.require(rendererPlugin);
|
|
11266
|
+
* renderer.sync.leave.show({ cover: { color: 0x000000, alpha: 0.45, inMs: 150, outMs: 150 }, loader: { afterMs: 400 } });
|
|
11267
|
+
* renderer.sync.leave.land(); // the veil fades out over the board in 150 ms
|
|
11268
|
+
* ```
|
|
11269
|
+
*/
|
|
11270
|
+
leave: LeaveApi;
|
|
11011
11271
|
/**
|
|
11012
11272
|
* The render passes of the frame, the number `stats().renderPasses` reports: 1 for the frame,
|
|
11013
11273
|
* plus, for every view in the tree with an enabled filter, 1 for its content and the passes of
|
|
@@ -11114,6 +11374,12 @@ type SyncInternal = {
|
|
|
11114
11374
|
*/
|
|
11115
11375
|
layerOf(entity: Entity): string | undefined; /** The overlays of this frame: modes, ranges, reasons, dims, HUD parts, and the pictures to take (spec 22). */
|
|
11116
11376
|
stepOverlays(): void;
|
|
11377
|
+
/**
|
|
11378
|
+
* The picture of a scene being left, for this frame (spec 33, slice A2): the veil's level from the clock, the loader
|
|
11379
|
+
* once due, both placed over the canvas as it stands; a frame is asked for while either moves. Run by the draw
|
|
11380
|
+
* callback before the decision. One field read and no allocation while no look runs.
|
|
11381
|
+
*/
|
|
11382
|
+
stepLeave(): void;
|
|
11117
11383
|
/**
|
|
11118
11384
|
* Hands Pixi again the filters of every view whose filters were switched on or off since they were written: Pixi
|
|
11119
11385
|
* holds only the enabled ones (E3). Run by the draw callback before anything reads the tree, so a switch is drawn in
|
|
@@ -11561,7 +11827,8 @@ type SyncState = {
|
|
|
11561
11827
|
passes: PassCount; /** The name of the scene's HUD layer (`above: "overlays"`), kept with the layers; `undefined` without one. */
|
|
11562
11828
|
hudLayer: string | undefined; /** The building entities waiting for their view (spec 31). */
|
|
11563
11829
|
aside: AsideQueue; /** The held tops of the scene build, attached in the pass after its commit (spec 31). */
|
|
11564
|
-
heldViews: HeldViews;
|
|
11830
|
+
heldViews: HeldViews; /** The picture of a scene being left: the running look and the engine's objects (spec 33, slice A2). */
|
|
11831
|
+
leave: LeaveState;
|
|
11565
11832
|
cleanups: Array<() => void>;
|
|
11566
11833
|
};
|
|
11567
11834
|
/**
|
|
@@ -11596,7 +11863,7 @@ type PassCount = {
|
|
|
11596
11863
|
enabled: boolean[];
|
|
11597
11864
|
};
|
|
11598
11865
|
declare namespace types_d_exports$1 {
|
|
11599
|
-
export { AnySceneProjection, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, KernelSlice$1 as KernelSlice, LayerMap, RunContext, SceneBuild, SceneDefinition, SceneLayer, SceneOwner, SceneProjection, SceneSpec, SceneState, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
11866
|
+
export { AnySceneProjection, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, FullCover, FullLeave, FullLoader, KernelSlice$1 as KernelSlice, LayerMap, Leaving, RunContext, SceneBuild, SceneCover, SceneDefinition, SceneLayer, SceneLeave, SceneLoader, SceneOwner, SceneProjection, SceneSpec, SceneState, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
11600
11867
|
}
|
|
11601
11868
|
/**
|
|
11602
11869
|
* How a layer orders what is drawn in it. The scene's name for the rule `world` stores.
|
|
@@ -11696,6 +11963,65 @@ type CheckedProjection<Layer extends string, Spec> = Spec extends {
|
|
|
11696
11963
|
* ```
|
|
11697
11964
|
*/
|
|
11698
11965
|
type CheckedProjections<Layer extends string, List> = { readonly [Index in keyof List]: CheckedProjection<Layer, List[Index]> };
|
|
11966
|
+
/**
|
|
11967
|
+
* The veil a live switch lays over the scene being left, from the switch start: a full-screen rect the engine draws
|
|
11968
|
+
* above every layer, fading from 0 to `alpha` over `inMs`; after the swap the next scene is under it and it fades out
|
|
11969
|
+
* over `outMs`. It takes no tap. A field left out keeps the one of the level below: the scene's over the config's over
|
|
11970
|
+
* the engine's.
|
|
11971
|
+
*
|
|
11972
|
+
* @example
|
|
11973
|
+
* ```ts
|
|
11974
|
+
* // A navy veil at 60 %, the engine's 150 ms in and out.
|
|
11975
|
+
* const cover: SceneCover = { color: 0x0b1020, alpha: 0.6 };
|
|
11976
|
+
* ```
|
|
11977
|
+
*/
|
|
11978
|
+
type SceneCover = {
|
|
11979
|
+
/** Colour of the veil, `0xRRGGBB`. Default `0x000000`. */color?: number; /** The alpha it fades in to, 0 to 1. Default 0.45. */
|
|
11980
|
+
alpha?: number; /** Milliseconds from 0 to `alpha`, from the switch start. Default 150. */
|
|
11981
|
+
inMs?: number; /** Milliseconds back to 0 after the swap. Default 150. */
|
|
11982
|
+
outMs?: number;
|
|
11983
|
+
};
|
|
11984
|
+
/**
|
|
11985
|
+
* What a live switch shows above the veil when it is not done `afterMs` after its start, until the swap: a game
|
|
11986
|
+
* texture turning at the centre (`texture`), a projection of the game drawn above the veil (`projection`), or, with
|
|
11987
|
+
* neither, a white ring the engine draws. `texture` and `projection` are one choice: a level that names either replaces
|
|
11988
|
+
* both of the level below, and with both named `projection` is drawn. A projection loader draws in a layer of its own
|
|
11989
|
+
* that the scene being left declares, mounted only once the loader is due: the whole layer is drawn above the veil
|
|
11990
|
+
* while the loader shows.
|
|
11991
|
+
*
|
|
11992
|
+
* @example
|
|
11993
|
+
* ```ts
|
|
11994
|
+
* // The game's ring texture, shown once the switch took 400 ms.
|
|
11995
|
+
* const loader: SceneLoader<"ui.loader.ring"> = { texture: "ui.loader.ring" };
|
|
11996
|
+
* // The game's own loading screen, the projection "loading" in the layer "loading", after 250 ms.
|
|
11997
|
+
* const screen: SceneLoader = { afterMs: 250, projection: "loading" };
|
|
11998
|
+
* ```
|
|
11999
|
+
*/
|
|
12000
|
+
type SceneLoader<Asset extends string = string> = {
|
|
12001
|
+
/** Milliseconds after the switch start the loader waits for. Default 400. */afterMs?: number; /** An asset key of the game: the texture turns at the centre of the frame. */
|
|
12002
|
+
texture?: Asset; /** The name of a registered projection: mounted once the loader is due, its layer drawn above the veil. */
|
|
12003
|
+
projection?: string;
|
|
12004
|
+
};
|
|
12005
|
+
/**
|
|
12006
|
+
* What a live switch shows over the scene being left: the veil and the loader. The scene being left decides: its
|
|
12007
|
+
* `leave` is merged field by field over `config.leave`, which is merged over the engine's default (`{ cover: { color:
|
|
12008
|
+
* 0x000000, alpha: 0.45, inMs: 150, outMs: 150 }, loader: { afterMs: 400 } }`). `false` turns a part or the whole off;
|
|
12009
|
+
* a part written over `false` starts from the engine's default. Fast mode, a headless app and the first scene of a run
|
|
12010
|
+
* show nothing.
|
|
12011
|
+
*
|
|
12012
|
+
* @example
|
|
12013
|
+
* ```ts
|
|
12014
|
+
* // The board leaves under a navy veil with the game's ring texture; the ward leaves with nothing at all.
|
|
12015
|
+
* const board: SceneLeave<"ui.loader.ring"> = { cover: { color: 0x0b1020, alpha: 0.6 }, loader: { texture: "ui.loader.ring" } };
|
|
12016
|
+
* const ward: SceneLeave = false;
|
|
12017
|
+
* // The veil without a loader.
|
|
12018
|
+
* const quiet: SceneLeave = { loader: false };
|
|
12019
|
+
* ```
|
|
12020
|
+
*/
|
|
12021
|
+
type SceneLeave<Asset extends string = string> = {
|
|
12022
|
+
cover?: SceneCover | false;
|
|
12023
|
+
loader?: SceneLoader<Asset> | false;
|
|
12024
|
+
} | false;
|
|
11699
12025
|
/**
|
|
11700
12026
|
* What the author passes to `defineScene`. The layer names come from the keys of `layers` plus
|
|
11701
12027
|
* the appended `ui`; `NoInfer` keeps `projections` out of that inference, so a wrong name is
|
|
@@ -11727,7 +12053,8 @@ type SceneSpec<Layers extends LayerMap, Projections extends readonly AnyScenePro
|
|
|
11727
12053
|
bundles?(state: SceneState<Player, Session>): readonly Bundle[];
|
|
11728
12054
|
layers: Layers;
|
|
11729
12055
|
projections: Projections & NoInfer<CheckedProjections<SceneLayer<Layers>, Projections>>;
|
|
11730
|
-
music?: Asset;
|
|
12056
|
+
music?: Asset; /** What a live switch shows over this scene when it is left: merged field by field over `config.leave`. */
|
|
12057
|
+
leave?: SceneLeave<Asset>;
|
|
11731
12058
|
};
|
|
11732
12059
|
/**
|
|
11733
12060
|
* The signature of `defineScene` bound to the asset and bundle keys and to the `Player` and
|
|
@@ -11762,7 +12089,8 @@ type SceneDefinition = {
|
|
|
11762
12089
|
* @param state - The committed `player` and `session`, frozen.
|
|
11763
12090
|
* @returns The bundle names the scene needs on top of `bundle`.
|
|
11764
12091
|
*/
|
|
11765
|
-
bundles?(state: SceneState): readonly string[];
|
|
12092
|
+
bundles?(state: SceneState): readonly string[]; /** What `defineScene` was given as `leave`; absent when the scene takes the config's. */
|
|
12093
|
+
readonly leave?: SceneLeave;
|
|
11766
12094
|
};
|
|
11767
12095
|
/**
|
|
11768
12096
|
* The committed state a scene's `bundles` reads: the frozen `player` and `session` of `model.store.snapshot()`, never a
|
|
@@ -11791,7 +12119,8 @@ type SceneOwner = Owner & {
|
|
|
11791
12119
|
name: "scenes";
|
|
11792
12120
|
};
|
|
11793
12121
|
/**
|
|
11794
|
-
* scenes plugin config. A scene is data in a feature; the
|
|
12122
|
+
* scenes plugin config. A scene is data in a feature; the keys are the budget of a live switch and what it shows over
|
|
12123
|
+
* the scene being left.
|
|
11795
12124
|
*
|
|
11796
12125
|
* @example
|
|
11797
12126
|
* ```ts
|
|
@@ -11800,6 +12129,9 @@ type SceneOwner = Owner & {
|
|
|
11800
12129
|
*
|
|
11801
12130
|
* // A game on a slow phone gives the next scene a fixed 3 ms of each frame: the switch takes more frames.
|
|
11802
12131
|
* const fixed: Config = { buildMs: 3 };
|
|
12132
|
+
*
|
|
12133
|
+
* // Every switch shows the veil and no loader.
|
|
12134
|
+
* const quiet: Config = { buildMs: "auto", leave: { loader: false } };
|
|
11803
12135
|
* ```
|
|
11804
12136
|
*/
|
|
11805
12137
|
type Config$1 = {
|
|
@@ -11809,6 +12141,23 @@ type Config$1 = {
|
|
|
11809
12141
|
* frame interval the loop runs at, `(1000 / time.rate().fps) * 2 / 3`, read once at the build start.
|
|
11810
12142
|
*/
|
|
11811
12143
|
buildMs: number | "auto";
|
|
12144
|
+
/**
|
|
12145
|
+
* What a live switch shows over the scene being left, for every scene; a scene's own `leave` is merged over it field
|
|
12146
|
+
* by field. A field left out keeps the engine's default, `{ cover: { color: 0x000000, alpha: 0.45, inMs: 150,
|
|
12147
|
+
* outMs: 150 }, loader: { afterMs: 400 } }`; `false` turns a part or the whole off.
|
|
12148
|
+
*
|
|
12149
|
+
* @example
|
|
12150
|
+
* ```ts
|
|
12151
|
+
* // The veil a little darker for every scene, and the game's ring texture after 300 ms instead of the white ring.
|
|
12152
|
+
* createApp({
|
|
12153
|
+
* plugins: [...screen, boardFeature],
|
|
12154
|
+
* pluginConfigs: { scenes: { leave: { cover: { alpha: 0.6 }, loader: { afterMs: 300, texture: "ui.loader.ring" } } } }
|
|
12155
|
+
* });
|
|
12156
|
+
* // No veil and no loader on any switch.
|
|
12157
|
+
* createApp({ plugins: [...screen, boardFeature], pluginConfigs: { scenes: { leave: false } } });
|
|
12158
|
+
* ```
|
|
12159
|
+
*/
|
|
12160
|
+
leave?: SceneLeave;
|
|
11812
12161
|
};
|
|
11813
12162
|
/**
|
|
11814
12163
|
* The running build of the next scene (spec 31): what the commit needs, and how to stop
|
|
@@ -11856,6 +12205,39 @@ type State$1 = {
|
|
|
11856
12205
|
* Absent otherwise: deleted, never written as `undefined`.
|
|
11857
12206
|
*/
|
|
11858
12207
|
build?: SceneBuild;
|
|
12208
|
+
/**
|
|
12209
|
+
* The veil and the loader of the running switch, from its start to its swap or its end without one. Absent
|
|
12210
|
+
* otherwise: deleted, never written as `undefined`.
|
|
12211
|
+
*/
|
|
12212
|
+
leaving?: Leaving;
|
|
12213
|
+
};
|
|
12214
|
+
/**
|
|
12215
|
+
* The veil and the loader a switch showed over the scene being left (spec 33, slice A2): whether they were taken down
|
|
12216
|
+
* already, the loader projection it mounted once its loader was due, and how to stop listening to the abort of its node.
|
|
12217
|
+
*/
|
|
12218
|
+
type Leaving = {
|
|
12219
|
+
/** Landed or dropped: a second end does nothing. */done: boolean; /** The loader projection the switch mounted, unmounted at the end; absent while it mounted none. */
|
|
12220
|
+
projection?: string; /** Removes the abort listener of the switch's node. */
|
|
12221
|
+
off: () => void;
|
|
12222
|
+
};
|
|
12223
|
+
/**
|
|
12224
|
+
* A veil with every field: what a level of `leave` resolves to.
|
|
12225
|
+
*/
|
|
12226
|
+
type FullCover = Required<SceneCover>;
|
|
12227
|
+
/**
|
|
12228
|
+
* A loader with its delay and at most one look: what a level of `leave` resolves to.
|
|
12229
|
+
*/
|
|
12230
|
+
type FullLoader = {
|
|
12231
|
+
afterMs: number;
|
|
12232
|
+
texture?: string;
|
|
12233
|
+
projection?: string;
|
|
12234
|
+
};
|
|
12235
|
+
/**
|
|
12236
|
+
* What a switch shows over the scene being left, every level merged: each part resolved or off.
|
|
12237
|
+
*/
|
|
12238
|
+
type FullLeave = {
|
|
12239
|
+
cover: FullCover | false;
|
|
12240
|
+
loader: FullLoader | false;
|
|
11859
12241
|
};
|
|
11860
12242
|
/**
|
|
11861
12243
|
* scenes plugin events.
|
|
@@ -12967,4 +13349,4 @@ type BundleCompanion = {
|
|
|
12967
13349
|
unload(bundle: string): void;
|
|
12968
13350
|
};
|
|
12969
13351
|
//#endregion
|
|
12970
|
-
export { PixiModule as $,
|
|
13352
|
+
export { PixiModule as $, FeatureDescription as $n, ThermalReading as $r, ShaderWhat as $t, SyncApi as A, NumericFields as An, State$6 as Ar, PerfChange as At, ShapeValue as B, EmitterIdOf as Bn, RngApi as Br, PerfLongFrameLine as Bt, SceneSpec as C, TagType as Cn, State$5 as Cr, PERF_CAUSES as Ct, DebugSwitches as D, Motion as Dn, Events$5 as Dr, PassKind as Dt, types_d_exports$1 as E, Ease as En, Config$6 as Er, PROBLEM_RULES as Et, NineSliceValue as F, TrackSegment as Fn, SaveDoc as Fr, PerfEventLine as Ft, Transform as G, TextStylesOf as Gn, PauseReason as Gr, PerfStartupLine as Gt, SpriteBlend as H, HudKeysOf as Hn, Api$6 as Hr, PerfMeasured as Ht, Overlay as I, ViewHandle as In, SaveUnreadableError as Ir, PerfEventName as It, AdaptiveScale as J, defineFlow as Jn, Api$7 as Jr, PoolTrimDetail as Jt, TransformValue as K, types_d_exports$4 as Kn, State$7 as Kr, PerfTelemetryLine as Kt, OverlayValue as L, Api$3 as Ln, Snapshot as Lr, PerfGapLine as Lt, HudPart as M, ProjectionSpec as Mn, Patch as Mr, PerfCollectorLine as Mt, HudPartValue as N, ReducedMotion as Nn, PlayerStateProvider as Nr, PerfCounts as Nt, FilterSlot as O, MotionCause as On, Json as Or, PassRecord as Ot, NineSlice$1 as P, TrackOptions as Pn, ProviderCall as Pr, PerfDisplay as Pt, PixiFilter as Q, type as Qn, State$8 as Qr, ShaderEventDetail as Qt, Parent as R, BundlesOf as Rn, SnapshotOf as Rr, PerfHeaderLine as Rt, SceneDefinition as S, SystemFor as Sn, FakeClock as Sr, OverlayWhat as St, State$1 as T, DescriptionNode as Tn, Api$5 as Tr, PERF_LOG_VERSION as Tt, SpriteOptions as U, Position as Un, Config$7 as Ur, PerfSampleLine as Ut, Sprite as V, GameTypes as Vn, RngState as Vr, PerfMarkLine as Vt, SpriteValue as W, State$4 as Wn, Events$6 as Wr, PerfSpikeLine as Wt, Config$2 as X, slot as Xn, FrameRate as Xr, ProblemRule as Xt, Api$1 as Y, exit as Yn, Config$8 as Yr, ProblemEventDetail as Yt, MonitorConfig as Z, to as Zn, RateChange as Zr, SHADER_WHATS as Zt, AnySceneProjection as _, Mut as _n, NodeFx as _r, FrameRing as _t, Config as a, State$3 as an, FlowGraph as ar, types_d_exports$2 as at, Events$1 as b, ResourceType as bn, ClockSource as br, MonitorSections as bt, LoadBundles as c, AnyComponentType as cn, NodeTable as cr, RenderStats as ct, Manifest as d, ComponentSchema as dn, TypeTag as dr, ViewportSize as dt, Time as ei, WarmDetail as en, FeaturePlugin as er, PixiSprite as et, ReadyBundles as f, ComponentType as fn, Descriptor as fr, FilterCache as ft, types_d_exports as g, FrameDiff as gn, Hint as gr, FrameRecord as gt, Usage as h, EntitySnapshot as hn, GuideOptions as hr, FrameReadout as ht, BundleSpec as i, Require as ii, Explained as in, DefineNode as ir, Under as it, Display as j, ProjectionMotion as jn, types_d_exports$6 as jr, PerfChangeEntry as jt, FilterSlotInputs as k, MotionHandle as kn, Root as kr, PerfCause as kt, LoadReason as l, AnyComponentValue as ln, RouteStep as lr, Orientation as lt, Tier as m, Entity as mn, EffectOptions as mr, FrameReadResult as mt, AssetsIo as n, Config$9 as ni, Api$2 as nn, AnyFlow as nr, PoolTrim as nt, DefineBundles as o, types_d_exports$3 as on, FlowState as or, Captured as ot, State as p, ComponentValue as pn, Effect as pr, FrameColumns as pt, sprite as q, contribution as qn, types_d_exports$7 as qr, PerfThermalLine as qt, BundleMap as r, Events$8 as ri, Config$3 as rn, Bookmark as rr, State$2 as rt, Events as s, AnyComponent as sn, JournalEntry as sr, MonitorCounts as st, Api as t, types_d_exports$8 as ti, DEMAND_REASONS as tn, FeatureTree as tr, PixiTexture as tt, LoadResult as u, ComponentHandle as un, SceneIdOf as ur, Point as ut, Config$1 as v, Narrowed as vn, Answer as vr, LongFrameEntry as vt, ScenesApi as w, ChangeHook as wn, types_d_exports$5 as wr, PERF_GAP_BUCKETS as wt, LayerMap as x, SystemDefinition as xn, Config$5 as xr, OverlayEventDetail as xt, DefineScene as y, QueryTerm as yn, Api$4 as yr, MONITOR_SECTIONS as yt, Shape as z, Config$4 as zn, StoreApi as zr, PerfLogLine as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Lr as Snapshot, Or as Json } from "./types-DrkR03nL.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-1e3gEF1Y.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { N as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { a as InputOf, r as ControlApp } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Hr as Api$3, Tr as Api$2, Y as Api, nn as Api$1, yr as Api$4 } from "./types-DrkR03nL.mjs";
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-B-o8Ul1v.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-CFEtGENK.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-1e3gEF1Y.mjs";
|
|
5
|
+
import { a as InputOf, r as ControlApp } from "./types-gQATSj41.mjs";
|
|
6
|
+
import { t as commands } from "./commands-DLk06fiL.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/visual/types.d.ts
|
|
9
9
|
/** The base commands of the `/control` door, keyed by their short names. */
|