@bardway/trpg-pixi 0.0.0-stage → 0.1.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.
Files changed (111) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +10 -0
  3. package/NOTICE.md +1 -0
  4. package/README.md +25 -2
  5. package/dist/AnimationMilestones.d.ts +17 -0
  6. package/dist/BattleActionMotionMath.d.ts +24 -0
  7. package/dist/BattleActionPresentationRecipes.d.ts +11 -0
  8. package/dist/BattleFxLibrary.d.ts +16 -0
  9. package/dist/BattlePresentationEngine.d.ts +26 -0
  10. package/dist/BattlePresentationPoseRegistry.d.ts +25 -0
  11. package/dist/BattlePresentationRecipe.d.ts +48 -0
  12. package/dist/BattleSequenceScheduler.d.ts +11 -0
  13. package/dist/DisplayEventQueue.d.ts +24 -0
  14. package/dist/PixiAnimationActivity.d.ts +7 -0
  15. package/dist/PixiAnimationDirector.d.ts +21 -0
  16. package/dist/PixiApplicationFactory.d.ts +17 -0
  17. package/dist/PixiAssetManager.d.ts +70 -0
  18. package/dist/PixiBattleActionRecipes.d.ts +75 -0
  19. package/dist/PixiBattleCinematicSurface.d.ts +23 -0
  20. package/dist/PixiBattleEntryTransition.d.ts +87 -0
  21. package/dist/PixiBattleFieldSurface.d.ts +125 -0
  22. package/dist/PixiBattleFxResources.d.ts +154 -0
  23. package/dist/PixiBattleGrid.d.ts +13 -0
  24. package/dist/PixiBattleHudPorts.d.ts +192 -0
  25. package/dist/PixiBattleHudSurface.d.ts +159 -0
  26. package/dist/PixiBattleLightningResources.d.ts +57 -0
  27. package/dist/PixiBattleMapDissolve.d.ts +38 -0
  28. package/dist/PixiBattleSceneTransition.d.ts +30 -0
  29. package/dist/PixiBattleTokenLifecycleCoordinator.d.ts +44 -0
  30. package/dist/PixiBattleVisualLayout.d.ts +284 -0
  31. package/dist/PixiBattleWhipGeometry.d.ts +18 -0
  32. package/dist/PixiBattleWhipMotion.d.ts +63 -0
  33. package/dist/PixiBattleWhipResources.d.ts +53 -0
  34. package/dist/PixiCameraFocusController.d.ts +40 -0
  35. package/dist/PixiCombatMotion.d.ts +223 -0
  36. package/dist/PixiCurrentActorCardGlow.d.ts +37 -0
  37. package/dist/PixiCurrentActorHalo.d.ts +55 -0
  38. package/dist/PixiDirectionalMotionBlur.d.ts +12 -0
  39. package/dist/PixiDisplayRenderer.d.ts +85 -0
  40. package/dist/PixiEffectPlugin.d.ts +25 -0
  41. package/dist/PixiEndingSurface.d.ts +104 -0
  42. package/dist/PixiInvestigatorDossierInsanityFilter.d.ts +14 -0
  43. package/dist/PixiLocalGlowMesh.d.ts +38 -0
  44. package/dist/PixiMapEdgeShadow.d.ts +36 -0
  45. package/dist/PixiMapMediaSurface.d.ts +71 -0
  46. package/dist/PixiMapWorldUtils.d.ts +24 -0
  47. package/dist/PixiMediaBreathRuntime.d.ts +69 -0
  48. package/dist/PixiMotion.d.ts +42 -0
  49. package/dist/PixiObjectiveBreathingGlow.d.ts +39 -0
  50. package/dist/PixiPartyHudSurface.d.ts +58 -0
  51. package/dist/PixiPersistentEffectTransition.d.ts +23 -0
  52. package/dist/PixiPortraitResourceCard.d.ts +147 -0
  53. package/dist/PixiPreludeStoryTransition.d.ts +35 -0
  54. package/dist/PixiPreludeSurface.d.ts +203 -0
  55. package/dist/PixiProgressCinematic.d.ts +65 -0
  56. package/dist/PixiResultEffectSurface.d.ts +101 -0
  57. package/dist/PixiRetainedMeterAnimator.d.ts +44 -0
  58. package/dist/PixiRuntimeContext.d.ts +21 -0
  59. package/dist/PixiSceneGraph.d.ts +42 -0
  60. package/dist/PixiSceneMotion.d.ts +41 -0
  61. package/dist/PixiSceneMotionPorts.d.ts +83 -0
  62. package/dist/PixiScenePresentationDirector.d.ts +118 -0
  63. package/dist/PixiSessionLayout.d.ts +61 -0
  64. package/dist/PixiSessionSkin.d.ts +30 -0
  65. package/dist/PixiShaderRuntime.d.ts +191 -0
  66. package/dist/PixiStageFontLoader.d.ts +2 -0
  67. package/dist/PixiStageMetrics.d.ts +25 -0
  68. package/dist/PixiStageTheme.d.ts +26 -0
  69. package/dist/PixiStoryArchiveMotion.d.ts +19 -0
  70. package/dist/PixiStoryCardCut.d.ts +58 -0
  71. package/dist/PixiStorySurface.d.ts +285 -0
  72. package/dist/PixiStoryWorkspaceSurface.d.ts +64 -0
  73. package/dist/PixiSummaryBoardSurface.d.ts +112 -0
  74. package/dist/PixiSystemHudSurface.d.ts +73 -0
  75. package/dist/PixiTeamCheckCinematic.d.ts +34 -0
  76. package/dist/PixiTextTransitionEffect.d.ts +54 -0
  77. package/dist/PixiTokenPersistentStatus.d.ts +101 -0
  78. package/dist/PixiTokenWorld.d.ts +170 -0
  79. package/dist/PixiTypography.d.ts +96 -0
  80. package/dist/PixiVideoRuntime.d.ts +61 -0
  81. package/dist/PixiViewportController.d.ts +25 -0
  82. package/dist/ResultEffectTuning.d.ts +57 -0
  83. package/dist/RetainedStageSurface.d.ts +50 -0
  84. package/dist/SessionFieldEffectRuntime.d.ts +45 -0
  85. package/dist/SessionSceneHistory.d.ts +10 -0
  86. package/dist/SessionSceneRegistry.d.ts +31 -0
  87. package/dist/StoryEventCoordinator.d.ts +61 -0
  88. package/dist/effects/PixiEffectLayerRegistry.d.ts +54 -0
  89. package/dist/effects/PixiEffectScope.d.ts +20 -0
  90. package/dist/effects/PixiStableRandom.d.ts +2 -0
  91. package/dist/index.d.ts +92 -0
  92. package/dist/index.js +24184 -0
  93. package/dist/index.js.map +7 -0
  94. package/dist/recipes/EffectPrimitiveRuntimeRegistry.d.ts +28 -0
  95. package/dist/recipes/EffectRecipeExecutor.d.ts +73 -0
  96. package/dist/recipes/primitives.d.ts +39 -0
  97. package/dist/recipes/registry.d.ts +57 -0
  98. package/dist/recipes/schema.d.ts +93 -0
  99. package/dist/recipes.d.ts +5 -0
  100. package/dist/recipes.js +1384 -0
  101. package/dist/recipes.js.map +7 -0
  102. package/dist/story/PixiStoryPresentationEngine.d.ts +90 -0
  103. package/dist/story/StoryContentSurface.d.ts +34 -0
  104. package/dist/story/StoryImageFilter.d.ts +15 -0
  105. package/dist/story/StoryTimelineClock.d.ts +22 -0
  106. package/dist/story/StoryVisualMath.d.ts +6 -0
  107. package/dist/tuning/SessionTuningResolver.d.ts +1 -0
  108. package/dist/tuning/SessionTuningTypes.d.ts +1 -0
  109. package/dist/ui/PixiStagePrimitives.d.ts +36 -0
  110. package/dist/uniforms.d.ts +1 -0
  111. package/package.json +44 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lex
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,10 @@
1
+ MingriAgency TRPG Engine
2
+ Copyright (c) 2026 Lex
3
+
4
+ Portions extracted and adapted from MingriAgencyCOC,
5
+ Copyright (c) 2025 Lex, licensed under the MIT License.
6
+ Source: https://github.com/bardway/mingriAgency_COC
7
+ The complete source attribution and extraction mapping are maintained in
8
+ docs/architecture and docs/guidance in the Engine repository.
9
+
10
+ Third-party dependencies retain their own licenses and copyright notices.
package/NOTICE.md ADDED
@@ -0,0 +1 @@
1
+ Source: mingriAgency_COC current local checkout, web/src/features/session-display. Source remains read-only. Product rules, resources, deployments and account data are excluded. Distributed under the repository MIT license. Third-party dependencies retain their own licenses.
package/README.md CHANGED
@@ -1,3 +1,26 @@
1
- # Temporary Holding Version
1
+ # @bardway/trpg-pixi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ PixiJS 舞台、场景、动画、媒体和战斗 HUD 渲染。
4
+
5
+ 初始版本 `0.1.0`,提供 ESM JavaScript 和 TypeScript 声明。
6
+
7
+ ## 安装
8
+
9
+ ```sh
10
+ npm install --save-exact @bardway/trpg-pixi@0.1.0
11
+ ```
12
+
13
+ 需要 `pixi.js@8.19.0` 和浏览器渲染环境。宿主提供主题、布局、素材与已裁定的公开状态,并按生命周期释放 renderer。
14
+
15
+ ## 公开入口
16
+
17
+ - `@bardway/trpg-pixi`
18
+ - `@bardway/trpg-pixi/recipes`
19
+
20
+ ## 平台依赖
21
+
22
+ - `pixi.js@8.19.0`
23
+
24
+ 完整配置、示例和平台限制见[使用说明](https://github.com/bardway/mingriAgency_TRPGEngine/blob/main/docs/guidance/package-usage.md)。
25
+
26
+ MIT。保留随包分发的 LICENSE、NOTICE 和第三方许可。
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Renderer-independent action milestones. Renderers may draw different
3
+ * primitives, but they must advance observable battle feedback in this order.
4
+ */
5
+ export declare const ANIMATION_MILESTONES: readonly ["start", "impact", "feedback", "resource", "return", "done"];
6
+ export type AnimationMilestone = (typeof ANIMATION_MILESTONES)[number];
7
+ export interface AnimationMilestoneEvent {
8
+ actionId: string;
9
+ milestone: AnimationMilestone;
10
+ }
11
+ export type AnimationMilestoneListener = (event: AnimationMilestoneEvent) => void;
12
+ /**
13
+ * The abort check lives at the emission boundary. This prevents a killed
14
+ * renderer timeline from reporting stale feedback after a snapshot reset or
15
+ * session switch.
16
+ */
17
+ export declare const emitAnimationMilestone: (listener: AnimationMilestoneListener | undefined, actionId: string, milestone: AnimationMilestone, signal: AbortSignal) => boolean;
@@ -0,0 +1,24 @@
1
+ export interface BattleFxPoint {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ /** Avalanche the event key so adjacent hit IDs do not produce adjacent angles. */
6
+ export declare const battleFxRandom: (key: string) => number;
7
+ export declare const resolveBladeSlashAngle: (id: string, hitIndex: number, offsetDegrees: number) => number;
8
+ export declare const resolveMeleeApproachPoint: (from: BattleFxPoint, target: BattleFxPoint, standOff: number) => BattleFxPoint;
9
+ export interface BattlePassByPath {
10
+ end: BattleFxPoint;
11
+ crossingProgress: number;
12
+ dodgeProgress: number;
13
+ fadeProgress: number;
14
+ tailLength: number;
15
+ }
16
+ /** Tangent to the visible token circle; fading starts only after the entire tail clears it. */
17
+ export declare const resolveBattlePassByPath: (from: BattleFxPoint, target: BattleFxPoint, options: {
18
+ radius: number;
19
+ clearance: number;
20
+ behind: number;
21
+ tailLength: number;
22
+ side: -1 | 1;
23
+ dodge: boolean;
24
+ }) => BattlePassByPath;
@@ -0,0 +1,11 @@
1
+ import type { BattlePresentationPlan } from './BattlePresentationRecipe.js';
2
+ import { BattlePresentationRecipeRegistry } from './BattlePresentationRecipe.js';
3
+ export type BattleActionPresentationRecipeId = 'shoot' | 'throw' | 'electric' | 'melee' | 'swing' | 'whip' | 'blade' | 'charge' | 'explosion' | 'recovery' | 'resource' | 'status' | 'fallback';
4
+ export interface BattleActionPresentationRecipeInput {
5
+ actionType: string;
6
+ createPlan(recipeId: BattleActionPresentationRecipeId): BattlePresentationPlan;
7
+ }
8
+ export declare const createBattleActionPresentationRecipeRegistry: (bindings: readonly {
9
+ id: BattleActionPresentationRecipeId;
10
+ actionTypes: readonly string[];
11
+ }[]) => BattlePresentationRecipeRegistry<BattleActionPresentationRecipeInput>;
@@ -0,0 +1,16 @@
1
+ import type { Graphics } from 'pixi.js';
2
+ export interface BattleFxColors {
3
+ recover: string;
4
+ electric: string;
5
+ damage: string;
6
+ cinematic: string;
7
+ }
8
+ export declare const BATTLE_FX_PRIMITIVES: readonly ["cameraFocus", "cameraShake", "tracer", "muzzleFlash", "electricArc", "lungeMotion", "motionTrail", "dodgeOffset", "knockback", "impactFlash", "bloodBurst", "explosionBurst", "resourceFloat", "healAura", "tokenShake", "tokenShatter", "statusStamp", "insanityGlitch", "speedLines", "focusVignette"];
9
+ export type BattleFxPrimitive = (typeof BATTLE_FX_PRIMITIVES)[number];
10
+ /** Graphics graybox renderer. Formal textures can replace this renderer without changing planners. */
11
+ export declare class BattleFxLibrary {
12
+ private readonly GraphicsConstructor;
13
+ private readonly colors;
14
+ constructor(GraphicsConstructor: typeof Graphics, colors: BattleFxColors);
15
+ create(kind: BattleFxPrimitive): Graphics;
16
+ }
@@ -0,0 +1,26 @@
1
+ import type { Graphics } from 'pixi.js';
2
+ import { BattleFxLibrary, type BattleFxColors } from './BattleFxLibrary.js';
3
+ import { BattlePresentationPoseRegistry } from './BattlePresentationPoseRegistry.js';
4
+ import { BattleSequenceScheduler, type BattleSequenceTask } from './BattleSequenceScheduler.js';
5
+ import { type BattlePresentationPlan, type BattlePresentationTask } from './BattlePresentationRecipe.js';
6
+ export declare class BattlePresentationEngine {
7
+ readonly poses: BattlePresentationPoseRegistry;
8
+ readonly scheduler: BattleSequenceScheduler;
9
+ readonly fx: BattleFxLibrary;
10
+ private abortController;
11
+ private readonly sidecars;
12
+ private readonly cameraBarriers;
13
+ private readonly activeClaimedTasks;
14
+ constructor(GraphicsConstructor: typeof Graphics, colors: BattleFxColors);
15
+ run(tasks: BattleSequenceTask[], onMilestone: Parameters<BattleSequenceScheduler['run']>[2], externalSignal?: AbortSignal): Promise<void>;
16
+ runPlan(plan: BattlePresentationPlan, onMilestone: (milestone: Exclude<import('./BattleSequenceScheduler.js').BattleSequenceMilestone, 'done'>) => void, externalSignal?: AbortSignal): Promise<void>;
17
+ startSidecar(task: BattlePresentationTask, externalSignal?: AbortSignal): Promise<void>;
18
+ waitForCameraBarriers(): Promise<void>;
19
+ reset(): void;
20
+ destroy(): void;
21
+ get activeSidecarCount(): number;
22
+ private toSequenceTask;
23
+ private runClaimedTask;
24
+ private tasksConflict;
25
+ private createLinkedSignal;
26
+ }
@@ -0,0 +1,25 @@
1
+ export interface BattlePresentationPose {
2
+ x: number;
3
+ y: number;
4
+ rotation: number;
5
+ scale: number;
6
+ alpha: number;
7
+ }
8
+ export declare class BattlePresentationPoseRegistry {
9
+ private readonly entries;
10
+ syncAuthoritative(tokenId: string, point: {
11
+ x: number;
12
+ y: number;
13
+ }): void;
14
+ beginPresentation(tokenId: string): void;
15
+ setPose(tokenId: string, pose: Partial<BattlePresentationPose>): void;
16
+ reconcile(tokenId: string): void;
17
+ resolve(tokenId: string): BattlePresentationPose & {
18
+ authoritativeX: number;
19
+ authoritativeY: number;
20
+ };
21
+ isLocked(tokenId: string): boolean;
22
+ reset(): void;
23
+ deleteMissing(tokenIds: ReadonlySet<string>): void;
24
+ private require;
25
+ }
@@ -0,0 +1,48 @@
1
+ import type { BattleSequenceMilestone } from './BattleSequenceScheduler.js';
2
+ export type BattlePresentationPhase = 'approach' | 'impact' | 'feedback' | 'resource' | 'return';
3
+ export type BattlePresentationTaskMode = 'blocking' | 'sidecar' | 'camera-barrier';
4
+ export type BattlePresentationClaim = {
5
+ type: 'token-position';
6
+ tokenId: string;
7
+ } | {
8
+ type: 'token-visual';
9
+ tokenId: string;
10
+ } | {
11
+ type: 'map';
12
+ id?: string;
13
+ } | {
14
+ type: 'roster';
15
+ tokenId?: string;
16
+ } | {
17
+ type: 'camera';
18
+ id?: string;
19
+ } | {
20
+ type: 'screen';
21
+ id?: string;
22
+ };
23
+ export interface BattlePresentationTask {
24
+ id: string;
25
+ phase: BattlePresentationPhase;
26
+ mode: BattlePresentationTaskMode;
27
+ reads?: readonly BattlePresentationClaim[];
28
+ writes?: readonly BattlePresentationClaim[];
29
+ run(signal: AbortSignal): Promise<void>;
30
+ }
31
+ export interface BattlePresentationPlan {
32
+ id: string;
33
+ tasks: readonly BattlePresentationTask[];
34
+ }
35
+ export interface BattlePresentationRecipe<TInput, TServices = undefined> {
36
+ id: string;
37
+ matches(input: TInput): boolean;
38
+ build(input: TInput, services: TServices): BattlePresentationPlan;
39
+ }
40
+ export declare const BATTLE_PRESENTATION_PHASES: readonly BattlePresentationPhase[];
41
+ export declare const battlePresentationPhaseMilestone: (phase: BattlePresentationPhase) => Exclude<BattleSequenceMilestone, "done">;
42
+ export declare const serializeBattlePresentationClaim: (claim: BattlePresentationClaim) => string;
43
+ export declare class BattlePresentationRecipeRegistry<TInput, TServices = undefined> {
44
+ private readonly recipes;
45
+ register(recipe: BattlePresentationRecipe<TInput, TServices>): void;
46
+ resolve(input: TInput): BattlePresentationRecipe<TInput, TServices> | null;
47
+ get registeredIds(): readonly string[];
48
+ }
@@ -0,0 +1,11 @@
1
+ export type BattleSequenceMilestone = 'start' | 'impact' | 'feedback' | 'resource' | 'return' | 'done';
2
+ export interface BattleSequenceTask {
3
+ id: string;
4
+ reads?: string[];
5
+ writes?: string[];
6
+ run(signal: AbortSignal, emit: (milestone: BattleSequenceMilestone) => void): Promise<void>;
7
+ }
8
+ export declare const planBattleSequenceBatches: (tasks: BattleSequenceTask[]) => BattleSequenceTask[][];
9
+ export declare class BattleSequenceScheduler {
10
+ run(tasks: BattleSequenceTask[], signal: AbortSignal, onMilestone: (taskId: string, milestone: BattleSequenceMilestone) => void): Promise<void>;
11
+ }
@@ -0,0 +1,24 @@
1
+ import type { RuntimeLogger } from '@bardway/trpg-media';
2
+ export interface DisplayQueueItem {
3
+ id: string;
4
+ kind: string;
5
+ blocking: boolean;
6
+ run: (signal: AbortSignal) => Promise<void>;
7
+ }
8
+ export type DisplayQueueRunResult = 'completed' | 'aborted';
9
+ export interface DisplayEventQueue {
10
+ enqueue(item: DisplayQueueItem): Promise<DisplayQueueRunResult>;
11
+ clear(reason: string): void;
12
+ pause(): void;
13
+ resume(): void;
14
+ destroy(): void;
15
+ getState(): DisplayEventQueueState;
16
+ }
17
+ export interface DisplayEventQueueState {
18
+ pending: number;
19
+ activeBlocking: number;
20
+ activeNonBlocking: number;
21
+ paused: boolean;
22
+ destroyed: boolean;
23
+ }
24
+ export declare const createDisplayEventQueue: (logger: RuntimeLogger) => DisplayEventQueue;
@@ -0,0 +1,7 @@
1
+ import type { Ticker } from 'pixi.js';
2
+ export interface PixiAnimationActivity {
3
+ acquire(reason: string): () => void;
4
+ clear(): void;
5
+ setPaused(paused: boolean): void;
6
+ }
7
+ export declare const createPixiAnimationActivity: (ticker: Ticker) => PixiAnimationActivity;
@@ -0,0 +1,21 @@
1
+ import { gsap } from 'gsap';
2
+ import type { StoryTimelineClock } from './story/StoryTimelineClock.js';
3
+ import type { PixiAnimationActivity } from './PixiAnimationActivity.js';
4
+ export type PixiTweenTarget = Parameters<typeof gsap.to>[0];
5
+ export type PixiTweenVars = Parameters<typeof gsap.to>[1];
6
+ export type PixiManagedTweenVars = PixiTweenVars & {
7
+ /** Keep a short, explicit duration when reduced-motion mode would otherwise make it instant. */
8
+ reducedMotionDuration?: number;
9
+ };
10
+ export interface PixiAnimationDirector {
11
+ tween(target: PixiTweenTarget, vars: PixiManagedTweenVars, signal: AbortSignal): Promise<void>;
12
+ sequence(tasks: Array<() => Promise<void>>, signal: AbortSignal): Promise<void>;
13
+ loop(target: PixiTweenTarget, vars: PixiTweenVars): () => void;
14
+ setReducedMotion(reducedMotion: boolean): void;
15
+ setPlaybackRate(rate: number): void;
16
+ pause(): void;
17
+ resume(): void;
18
+ clear(): void;
19
+ destroy(): void;
20
+ }
21
+ export declare const createPixiAnimationDirector: (clock: StoryTimelineClock, activity?: PixiAnimationActivity) => PixiAnimationDirector;
@@ -0,0 +1,17 @@
1
+ import type { Application } from 'pixi.js';
2
+ export { PIXI_LOGICAL_STAGE } from './PixiStageMetrics.js';
3
+ export declare const STAGE_RENDER_QUALITIES: {
4
+ readonly performance: 1;
5
+ readonly balanced: 1.25;
6
+ readonly quality: 1.5;
7
+ readonly ultra: 2;
8
+ };
9
+ export type StageRenderQuality = keyof typeof STAGE_RENDER_QUALITIES;
10
+ export declare const resolveStageRenderQuality: (value: unknown) => StageRenderQuality;
11
+ /** Resolves the device pixel ratio without exceeding the selected render-quality ceiling. */
12
+ export declare const resolveDisplayResolution: (quality: unknown, devicePixelRatio?: unknown) => number;
13
+ export type PixiApplicationConstructor = new () => Application;
14
+ export declare const createPixiApplication: (ApplicationConstructor: PixiApplicationConstructor, quality?: unknown, stage?: {
15
+ width: number;
16
+ height: number;
17
+ }) => Promise<Application>;
@@ -0,0 +1,70 @@
1
+ import type { Texture } from 'pixi.js';
2
+ interface PixiAssetLoadOptions {
3
+ readonly strategy: 'retry';
4
+ readonly retryCount: number;
5
+ readonly retryDelay: number;
6
+ }
7
+ interface PixiAssetsApi {
8
+ load: (asset: PixiAssetDescriptor, options?: PixiAssetLoadOptions) => Promise<Texture>;
9
+ unload: (aliases: string[]) => Promise<void> | void;
10
+ }
11
+ interface PixiAssetDescriptor {
12
+ alias: string;
13
+ src: string;
14
+ parser?: 'video';
15
+ data?: {
16
+ autoPlay: false;
17
+ loop: true;
18
+ muted: true;
19
+ playsinline: true;
20
+ preload: true;
21
+ updateFPS: 0;
22
+ crossorigin: true;
23
+ mime: 'video/webm';
24
+ };
25
+ }
26
+ interface PixiVideoAssetDependencies {
27
+ readonly fetchVideo?: typeof fetch;
28
+ readonly createObjectURL?: typeof URL.createObjectURL;
29
+ readonly revokeObjectURL?: typeof URL.revokeObjectURL;
30
+ readonly retryDelayMs?: number;
31
+ readonly resolveUrl?: (url: string) => string;
32
+ }
33
+ export type PixiAssetScope = 'stage-critical' | 'stage-ui' | 'battle-common' | `scene:${string}` | `battle-map:${string}` | `effect:${string}` | `cinematic:${string}` | `hud-clue:${string}` | `runtime:${string}`;
34
+ /**
35
+ * Renderer-local asset ownership on top of Pixi Assets' global cache.
36
+ * A scope may request the same alias many times; it is loaded once and released
37
+ * only after its final scope is released.
38
+ */
39
+ export declare class PixiAssetManager {
40
+ private readonly assets;
41
+ private readonly videoDependencies;
42
+ private readonly records;
43
+ private readonly aliasesByScope;
44
+ private readonly sharedOwnership;
45
+ private readonly pendingSourceUnloads;
46
+ private readonly ownUnloads;
47
+ private readonly waitingScopeLoads;
48
+ private readonly videoBytes;
49
+ private videoDownloads;
50
+ private videoGeneration;
51
+ private disposed;
52
+ constructor(assets: PixiAssetsApi, videoDependencies?: PixiVideoAssetDependencies);
53
+ loadTexture(alias: string, src: string, scope?: PixiAssetScope | string, signal?: AbortSignal): Promise<Texture>;
54
+ loadVideoTexture(alias: string, src: string, scope: PixiAssetScope | string, signal?: AbortSignal): Promise<Texture>;
55
+ preloadVideoBytes(src: string, signal?: AbortSignal): Promise<void>;
56
+ releaseVideoTexture(alias: string): Promise<void>;
57
+ clearVideoCache(): void;
58
+ private loadVideoBlob;
59
+ private loadAsset;
60
+ releaseScope(scope: PixiAssetScope | string): Promise<void>;
61
+ releaseAll(): Promise<void>;
62
+ private waitForSourceUnload;
63
+ private createRecord;
64
+ private retain;
65
+ private releaseOwnership;
66
+ private releaseAlias;
67
+ private unloadOrphanedRecords;
68
+ private revokeVideoSource;
69
+ }
70
+ export {};
@@ -0,0 +1,75 @@
1
+ export declare const PIXI_BATTLE_ACTION_TIMING: {
2
+ readonly shootMs: 100;
3
+ readonly electricEnterMs: 40;
4
+ readonly electricHoldMs: 80;
5
+ readonly electricExitMs: 120;
6
+ readonly electricScreenFlashMs: 120;
7
+ readonly muzzleFlashMs: 100;
8
+ readonly meleeLineMs: 300;
9
+ readonly meleeScale: 1.08;
10
+ readonly meleeReturnMs: 250;
11
+ readonly dodgeShiftPx: 26;
12
+ readonly dodgeDelayMs: 160;
13
+ readonly targetShakeMs: 100;
14
+ readonly explosionProjectileMs: 500;
15
+ readonly explosionFireRingMs: 180;
16
+ readonly chargeImpactHoldMs: 20;
17
+ readonly explosionShakeMs: 200;
18
+ readonly damageFloatMs: 1600;
19
+ readonly healFloatMs: 2000;
20
+ readonly resourceStaggerMs: 200;
21
+ readonly rosterFeedbackMs: 500;
22
+ readonly rosterSameResourceStaggerMs: 60;
23
+ readonly statusMs: 1100;
24
+ };
25
+ export declare const resolveDodgeOffset: (attacker: {
26
+ x: number;
27
+ y: number;
28
+ }, target: {
29
+ x: number;
30
+ y: number;
31
+ }, direction: -1 | 1) => {
32
+ x: number;
33
+ y: number;
34
+ };
35
+ export declare const resolveAwayDodgeOffset: (attacker: {
36
+ x: number;
37
+ y: number;
38
+ }, target: {
39
+ x: number;
40
+ y: number;
41
+ }, seed: number, distance: number) => {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ export declare const resolveParticipantBoundsCenter: (points: readonly {
46
+ x: number;
47
+ y: number;
48
+ }[]) => {
49
+ x: number;
50
+ y: number;
51
+ } | null;
52
+ export declare const resolveExplosionCoverage: (points: readonly {
53
+ x: number;
54
+ y: number;
55
+ }[], tokenRadius: number) => {
56
+ center: {
57
+ x: number;
58
+ y: number;
59
+ };
60
+ radius: number;
61
+ } | null;
62
+ export declare const resolveExplosionArcPoint: (from: {
63
+ x: number;
64
+ y: number;
65
+ }, to: {
66
+ x: number;
67
+ y: number;
68
+ }, progress: number) => {
69
+ x: number;
70
+ y: number;
71
+ rotation: number;
72
+ height: number;
73
+ };
74
+ export declare const resolveResourceFloatDuration: (text: string) => number;
75
+ export declare const resolveTransientStatus: <T extends string>(priority: readonly T[], active: ReadonlySet<T>) => T | null;
@@ -0,0 +1,23 @@
1
+ import { type ComboSlashRegion } from './PixiSessionLayout.js';
2
+ export interface BattlePictureLayout {
3
+ width: number;
4
+ height: number;
5
+ centerX: number;
6
+ centerY: number;
7
+ entryX: number;
8
+ driftX: number;
9
+ exitX: number;
10
+ }
11
+ /** Shared screen-space geometry and cadence for retained battle cinematics. */
12
+ export declare class PixiBattleCinematicSurface {
13
+ static resolveBattlePictureLayout(source: {
14
+ width: number;
15
+ height: number;
16
+ }, direction: -1 | 1, bounds?: {
17
+ maxWidth: number;
18
+ maxHeight: number;
19
+ allowUpscale?: boolean;
20
+ }): BattlePictureLayout;
21
+ static resolveComboRegions(participantCount: number): ComboSlashRegion[];
22
+ static resolveComboHoldMs(totalMs: number): number;
23
+ }
@@ -0,0 +1,87 @@
1
+ import type { BlurFilter, Container, Graphics, Particle, ParticleContainer, Rectangle, Texture } from 'pixi.js';
2
+ import type { BattleViewportGridLayout } from './PixiSessionLayout.js';
3
+ interface Constructors {
4
+ BlurFilter: typeof BlurFilter;
5
+ Container: typeof Container;
6
+ Graphics: typeof Graphics;
7
+ Particle: typeof Particle;
8
+ ParticleContainer: typeof ParticleContainer;
9
+ Rectangle: typeof Rectangle;
10
+ Texture: typeof Texture;
11
+ }
12
+ export interface BattleEntryGridStyle {
13
+ readonly lineWidth: number;
14
+ readonly lineAlpha: number;
15
+ readonly lineColor: string;
16
+ readonly cellFillAlpha: number;
17
+ readonly cellEdgeAlpha: number;
18
+ readonly cellEdgeWidth: number;
19
+ readonly cellEdgeGlowAlpha: number;
20
+ readonly cellEdgeGlowWidth: number;
21
+ readonly cellEdgeGlowBlurStrength: number;
22
+ }
23
+ export interface BattleEntryCell {
24
+ readonly col: number;
25
+ readonly row: number;
26
+ readonly x: number;
27
+ readonly y: number;
28
+ readonly width: number;
29
+ readonly height: number;
30
+ readonly order: number;
31
+ }
32
+ export declare const createBattleEntryCells: (layout: BattleViewportGridLayout, seed: string) => BattleEntryCell[];
33
+ export declare const createStableBattleEntryOrder: (ids: readonly string[], seed: string) => string[];
34
+ export declare const resolveBattleEntryHandoffAlpha: (progress: number, targetAlpha: number) => {
35
+ veilAlpha: number;
36
+ cellAlpha: number;
37
+ };
38
+ export declare const resolveBattleEntryCellPulse: (progress: number, peakProgress: number) => {
39
+ fill: number;
40
+ edge: number;
41
+ };
42
+ /** Assigns ordered cells to accelerating reveal waves sized 1, 2, 3, 4, ... */
43
+ export declare const createBattleEntryRevealBatchIndices: (cellCount: number) => number[];
44
+ export interface BattleRosterProgressEntry {
45
+ readonly root: {
46
+ alpha: number;
47
+ readonly position: {
48
+ set: (x: number, y: number) => void;
49
+ };
50
+ };
51
+ readonly targetX: number;
52
+ readonly targetY: number;
53
+ }
54
+ export declare const applyBattleRosterEntryProgress: (entries: readonly BattleRosterProgressEntry[], progress: number, offsetX: number, entryDuration: number, maxStagger: number) => void;
55
+ /** Owns all temporary visual nodes used by a single battle-entry transition. */
56
+ export declare class PixiBattleEntryTransition {
57
+ readonly node: Container;
58
+ readonly whiteVeil: Graphics;
59
+ readonly verticalLines: Graphics;
60
+ readonly horizontalLines: Graphics;
61
+ readonly cells: readonly BattleEntryCell[];
62
+ readonly particles: readonly Particle[];
63
+ readonly edgeParticles: readonly Particle[];
64
+ readonly edgeGlowParticles: readonly Particle[];
65
+ readonly revealBatchIndices: readonly number[];
66
+ private readonly particleContainer;
67
+ private readonly edgeParticleContainer;
68
+ private readonly edgeGlowParticleContainer;
69
+ private readonly edgeGlowLayer;
70
+ private readonly edgeGlowBlur;
71
+ private readonly gridStyle;
72
+ private destroyed;
73
+ constructor(constructors: Constructors, layout: BattleViewportGridLayout | null, seed: string, gridStyle: BattleEntryGridStyle, colors: {
74
+ mask: string;
75
+ }, stage?: {
76
+ width: number;
77
+ height: number;
78
+ });
79
+ get temporaryObjectCount(): number;
80
+ setHandoffProgress(progress: number): void;
81
+ setRevealProgress(progress: number, totalDuration: number, fadeDuration: number, gridFadeStartProgress: number, glowPeakProgress: number, glowIntensityScale?: number): void;
82
+ hideGridLines(): void;
83
+ destroy(): void;
84
+ private createCellEdgeParticles;
85
+ private createParticleContainer;
86
+ }
87
+ export {};