@energy8platform/game-engine 0.20.0 → 0.22.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 +121 -0
- package/dist/animation.cjs.js +18 -3
- package/dist/animation.cjs.js.map +1 -1
- package/dist/animation.esm.js +18 -3
- package/dist/animation.esm.js.map +1 -1
- package/dist/core.cjs.js +18 -3
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +18 -3
- package/dist/core.esm.js.map +1 -1
- package/dist/host.cjs.js +18 -3
- package/dist/host.cjs.js.map +1 -1
- package/dist/host.d.ts +3 -5
- package/dist/host.esm.js +18 -3
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +18 -2535
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1020
- package/dist/index.esm.js +20 -2525
- package/dist/index.esm.js.map +1 -1
- package/dist/slot.cjs.js +1872 -61
- package/dist/slot.cjs.js.map +1 -1
- package/dist/slot.d.ts +555 -28
- package/dist/slot.esm.js +1857 -62
- package/dist/slot.esm.js.map +1 -1
- package/dist/vite.cjs.js +0 -5
- package/dist/vite.cjs.js.map +1 -1
- package/dist/vite.esm.js +0 -5
- package/dist/vite.esm.js.map +1 -1
- package/package.json +2 -35
- package/src/animation/Tween.ts +14 -3
- package/src/host/index.ts +0 -1
- package/src/host/types.ts +0 -3
- package/src/index.ts +0 -28
- package/src/slot/anim/easing-map.ts +16 -2
- package/src/slot/cascade/TumbleController.ts +230 -0
- package/src/slot/config/ReelSystemConfig.ts +559 -0
- package/src/slot/config/presets.ts +222 -0
- package/src/slot/features/extra.ts +189 -0
- package/src/slot/features/index.ts +44 -0
- package/src/slot/features/symbols.ts +183 -0
- package/src/slot/features/types.ts +136 -0
- package/src/slot/features/wilds.ts +151 -0
- package/src/slot/grid/ReelGrid.ts +93 -24
- package/src/slot/grid/SymbolCell.ts +45 -11
- package/src/slot/index.ts +61 -2
- package/src/slot/motion/AnticipationController.ts +96 -0
- package/src/slot/motion/SpinEngine.ts +384 -0
- package/src/slot/system/ReelSystem.ts +295 -0
- package/src/vite/index.ts +0 -5
- package/dist/react-jsx.cjs.js +0 -3
- package/dist/react-jsx.cjs.js.map +0 -1
- package/dist/react-jsx.d.ts +0 -602
- package/dist/react-jsx.esm.js +0 -2
- package/dist/react-jsx.esm.js.map +0 -1
- package/dist/react.cjs.js +0 -3787
- package/dist/react.cjs.js.map +0 -1
- package/dist/react.d.ts +0 -1467
- package/dist/react.esm.js +0 -3771
- package/dist/react.esm.js.map +0 -1
- package/dist/ui.cjs.js +0 -2999
- package/dist/ui.cjs.js.map +0 -1
- package/dist/ui.d.ts +0 -1116
- package/dist/ui.esm.js +0 -2983
- package/dist/ui.esm.js.map +0 -1
- package/src/react/EngineContext.ts +0 -26
- package/src/react/ReactScene.ts +0 -88
- package/src/react/applyProps.ts +0 -271
- package/src/react/catalogue.ts +0 -17
- package/src/react/createPixiRoot.ts +0 -31
- package/src/react/extendAll.ts +0 -74
- package/src/react/hooks.ts +0 -46
- package/src/react/index.ts +0 -29
- package/src/react/jsx-runtime.ts +0 -346
- package/src/react/reconciler.ts +0 -338
- package/src/slot/freeSpins/FreeSpinsSession.ts +0 -40
- package/src/state/StateMachine.ts +0 -231
- package/src/state/index.ts +0 -1
- package/src/ui/BalanceDisplay.ts +0 -159
- package/src/ui/Button.ts +0 -304
- package/src/ui/FlexContainer.ts +0 -775
- package/src/ui/Label.ts +0 -124
- package/src/ui/LabelValue.ts +0 -122
- package/src/ui/Layout.ts +0 -291
- package/src/ui/Modal.ts +0 -170
- package/src/ui/Panel.ts +0 -204
- package/src/ui/ProgressBar.ts +0 -170
- package/src/ui/ScrollContainer.ts +0 -478
- package/src/ui/Slider.ts +0 -241
- package/src/ui/Toast.ts +0 -150
- package/src/ui/Toggle.ts +0 -201
- package/src/ui/WinDisplay.ts +0 -145
- package/src/ui/index.ts +0 -33
- package/src/ui/view.ts +0 -28
package/src/react/extendAll.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Container,
|
|
3
|
-
Sprite,
|
|
4
|
-
Graphics,
|
|
5
|
-
Text,
|
|
6
|
-
AnimatedSprite,
|
|
7
|
-
NineSliceSprite,
|
|
8
|
-
TilingSprite,
|
|
9
|
-
Mesh,
|
|
10
|
-
MeshPlane,
|
|
11
|
-
MeshRope,
|
|
12
|
-
MeshSimple,
|
|
13
|
-
BitmapText,
|
|
14
|
-
HTMLText,
|
|
15
|
-
} from 'pixi.js';
|
|
16
|
-
import { extend } from './catalogue';
|
|
17
|
-
import {
|
|
18
|
-
Button, Label, LabelValue, Panel, FlexContainer, ProgressBar,
|
|
19
|
-
ScrollContainer, Modal, Toast, BalanceDisplay, WinDisplay, Layout,
|
|
20
|
-
Slider, Toggle,
|
|
21
|
-
} from '../ui';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Register all standard PixiJS display objects for JSX use.
|
|
25
|
-
* Call once at app startup before rendering any React scenes.
|
|
26
|
-
*/
|
|
27
|
-
export function extendPixiElements(): void {
|
|
28
|
-
extend({
|
|
29
|
-
Container,
|
|
30
|
-
Sprite,
|
|
31
|
-
Graphics,
|
|
32
|
-
Text,
|
|
33
|
-
AnimatedSprite,
|
|
34
|
-
NineSliceSprite,
|
|
35
|
-
TilingSprite,
|
|
36
|
-
Mesh,
|
|
37
|
-
MeshPlane,
|
|
38
|
-
MeshRope,
|
|
39
|
-
MeshSimple,
|
|
40
|
-
BitmapText,
|
|
41
|
-
HTMLText,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Register all engine UI components for JSX use.
|
|
47
|
-
* Call once at app startup before rendering React scenes that use UI components.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* extendPixiElements();
|
|
52
|
-
* extendUIElements();
|
|
53
|
-
*
|
|
54
|
-
* // Now you can use:
|
|
55
|
-
* // <button text="SPIN" onPress={handler} />
|
|
56
|
-
* // <flexContainer direction="row" gap={16}>...</flexContainer>
|
|
57
|
-
* // <label text="Hello" style-fontSize={24} />
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export function extendUIElements(): void {
|
|
61
|
-
extend({
|
|
62
|
-
Button, Label, LabelValue, Panel, FlexContainer, ProgressBar,
|
|
63
|
-
ScrollContainer, Modal, Toast, BalanceDisplay, WinDisplay, Layout,
|
|
64
|
-
Slider, Toggle,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Register additional custom components for JSX use.
|
|
70
|
-
* Pass an object mapping component names to their constructors.
|
|
71
|
-
*/
|
|
72
|
-
export function extendCustomElements(components: Record<string, any>): void {
|
|
73
|
-
extend(components);
|
|
74
|
-
}
|
package/src/react/hooks.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { useEngine } from './EngineContext';
|
|
3
|
-
import type { CasinoGameSDK, SessionData, GameConfigData } from '@energy8platform/game-sdk';
|
|
4
|
-
import type { AudioManager } from '../audio/AudioManager';
|
|
5
|
-
import type { InputManager } from '../input/InputManager';
|
|
6
|
-
|
|
7
|
-
export function useSDK(): CasinoGameSDK | null {
|
|
8
|
-
return useEngine().sdk;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function useAudio(): AudioManager {
|
|
12
|
-
return useEngine().audio;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function useInput(): InputManager {
|
|
16
|
-
return useEngine().input;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function useViewport(): { width: number; height: number; scale: number; isPortrait: boolean } {
|
|
20
|
-
const { screen, isPortrait } = useEngine();
|
|
21
|
-
return { ...screen, isPortrait };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function useBalance(): number {
|
|
25
|
-
const { sdk } = useEngine();
|
|
26
|
-
const [balance, setBalance] = useState(sdk?.balance ?? 0);
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (!sdk) return;
|
|
30
|
-
const handler = (data: { balance: number }) => setBalance(data.balance);
|
|
31
|
-
sdk.on('balanceUpdate', handler);
|
|
32
|
-
return () => {
|
|
33
|
-
sdk.off('balanceUpdate', handler);
|
|
34
|
-
};
|
|
35
|
-
}, [sdk]);
|
|
36
|
-
|
|
37
|
-
return balance;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function useSession(): SessionData | null {
|
|
41
|
-
return useEngine().app.session;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function useGameConfig<T = GameConfigData>(): T | null {
|
|
45
|
-
return useEngine().gameConfig as T | null;
|
|
46
|
-
}
|
package/src/react/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Auto-activate JSX.IntrinsicElements augmentation. Side-effect import only —
|
|
2
|
-
// brings the `declare module 'react'` block into the TS resolution graph so
|
|
3
|
-
// consumers get fully-typed <flexContainer>, <button>, <label>, etc. without
|
|
4
|
-
// writing their own shim.
|
|
5
|
-
import './jsx-runtime';
|
|
6
|
-
|
|
7
|
-
// Core
|
|
8
|
-
export { createPixiRoot } from './createPixiRoot';
|
|
9
|
-
export type { PixiRoot } from './createPixiRoot';
|
|
10
|
-
|
|
11
|
-
// Catalogue
|
|
12
|
-
export { extend } from './catalogue';
|
|
13
|
-
export { extendPixiElements, extendUIElements, extendCustomElements } from './extendAll';
|
|
14
|
-
|
|
15
|
-
// Scene
|
|
16
|
-
export { ReactScene } from './ReactScene';
|
|
17
|
-
|
|
18
|
-
// Context & Hooks
|
|
19
|
-
export { EngineContext, useEngine } from './EngineContext';
|
|
20
|
-
export type { EngineContextValue } from './EngineContext';
|
|
21
|
-
export {
|
|
22
|
-
useSDK,
|
|
23
|
-
useAudio,
|
|
24
|
-
useInput,
|
|
25
|
-
useViewport,
|
|
26
|
-
useBalance,
|
|
27
|
-
useSession,
|
|
28
|
-
useGameConfig,
|
|
29
|
-
} from './hooks';
|
package/src/react/jsx-runtime.ts
DELETED
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSX prop types for the PixiJS React reconciler.
|
|
3
|
-
*
|
|
4
|
-
* The engine auto-augments `react`'s module-scoped `JSX.IntrinsicElements`
|
|
5
|
-
* with every registered element (`<flexContainer>`, `<button>`, `<label>`,
|
|
6
|
-
* `<labelValue>`, etc). Because the augmentation is scoped to the `react`
|
|
7
|
-
* module (not the legacy global `JSX` namespace), it reliably wins over
|
|
8
|
-
* `@types/react`'s HTML defaults for colliding names like `<button>` / `<label>`.
|
|
9
|
-
*
|
|
10
|
-
* **Consumers don't need any shim.** Any import from `@energy8platform/game-engine/react`
|
|
11
|
-
* (e.g. `createPixiRoot`, `extendUIElements`, `ReactScene` — you're already
|
|
12
|
-
* importing these to boot the reconciler) pulls this module in and the JSX
|
|
13
|
-
* types activate automatically.
|
|
14
|
-
*
|
|
15
|
-
* If a project imports only from `/ui` or `/core` and never touches `/react`,
|
|
16
|
-
* add a one-line side-effect import to trigger the augmentation:
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* // app/src/pixi-jsx.d.ts
|
|
20
|
-
* import '@energy8platform/game-engine/react-jsx';
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* Dash-notation for nested config objects is supported:
|
|
24
|
-
* <button colors-default={0xff0000} colors-hover={0x00ff00} />
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import type { Texture, TextStyle } from 'pixi.js';
|
|
28
|
-
import type { ViewInput } from '../ui/view';
|
|
29
|
-
import type { ButtonConfig, ButtonState } from '../ui/Button';
|
|
30
|
-
import type { LabelConfig } from '../ui/Label';
|
|
31
|
-
import type { LabelValueConfig } from '../ui/LabelValue';
|
|
32
|
-
import type { PanelConfig } from '../ui/Panel';
|
|
33
|
-
import type { FlexContainerConfig, AlignSelf, AlignContent } from '../ui/FlexContainer';
|
|
34
|
-
import type { ProgressBarConfig } from '../ui/ProgressBar';
|
|
35
|
-
import type { ScrollContainerConfig } from '../ui/ScrollContainer';
|
|
36
|
-
import type { ModalConfig } from '../ui/Modal';
|
|
37
|
-
import type { ToastConfig } from '../ui/Toast';
|
|
38
|
-
import type { BalanceDisplayConfig } from '../ui/BalanceDisplay';
|
|
39
|
-
import type { WinDisplayConfig } from '../ui/WinDisplay';
|
|
40
|
-
import type { LayoutConfig } from '../ui/Layout';
|
|
41
|
-
import type { SliderConfig } from '../ui/Slider';
|
|
42
|
-
import type { ToggleConfig } from '../ui/Toggle';
|
|
43
|
-
|
|
44
|
-
// ─── Event props ─────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
export interface PixiEventProps {
|
|
47
|
-
onClick?: (e: any) => void;
|
|
48
|
-
onPointerDown?: (e: any) => void;
|
|
49
|
-
onPointerUp?: (e: any) => void;
|
|
50
|
-
onPointerMove?: (e: any) => void;
|
|
51
|
-
onPointerOver?: (e: any) => void;
|
|
52
|
-
onPointerOut?: (e: any) => void;
|
|
53
|
-
onPointerEnter?: (e: any) => void;
|
|
54
|
-
onPointerLeave?: (e: any) => void;
|
|
55
|
-
onPointerCancel?: (e: any) => void;
|
|
56
|
-
onPointerTap?: (e: any) => void;
|
|
57
|
-
onPointerUpOutside?: (e: any) => void;
|
|
58
|
-
onMouseDown?: (e: any) => void;
|
|
59
|
-
onMouseUp?: (e: any) => void;
|
|
60
|
-
onMouseMove?: (e: any) => void;
|
|
61
|
-
onMouseOver?: (e: any) => void;
|
|
62
|
-
onMouseOut?: (e: any) => void;
|
|
63
|
-
onWheel?: (e: any) => void;
|
|
64
|
-
onTap?: (e: any) => void;
|
|
65
|
-
onRightClick?: (e: any) => void;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ─── Base container props (shared by all elements) ───────
|
|
69
|
-
|
|
70
|
-
export interface BaseProps extends PixiEventProps {
|
|
71
|
-
key?: React.Key;
|
|
72
|
-
ref?: React.Ref<any>;
|
|
73
|
-
children?: React.ReactNode;
|
|
74
|
-
|
|
75
|
-
// Container props
|
|
76
|
-
x?: number;
|
|
77
|
-
y?: number;
|
|
78
|
-
width?: number;
|
|
79
|
-
height?: number;
|
|
80
|
-
alpha?: number;
|
|
81
|
-
visible?: boolean;
|
|
82
|
-
rotation?: number;
|
|
83
|
-
angle?: number;
|
|
84
|
-
zIndex?: number;
|
|
85
|
-
label?: string;
|
|
86
|
-
cursor?: string;
|
|
87
|
-
eventMode?: 'auto' | 'none' | 'passive' | 'static' | 'dynamic';
|
|
88
|
-
|
|
89
|
-
// Nested via dash-notation
|
|
90
|
-
'scale-x'?: number;
|
|
91
|
-
'scale-y'?: number;
|
|
92
|
-
'pivot-x'?: number;
|
|
93
|
-
'pivot-y'?: number;
|
|
94
|
-
'position-x'?: number;
|
|
95
|
-
'position-y'?: number;
|
|
96
|
-
'anchor-x'?: number;
|
|
97
|
-
'anchor-y'?: number;
|
|
98
|
-
|
|
99
|
-
// Allow scale as number (uniform)
|
|
100
|
-
scale?: number | { x: number; y: number };
|
|
101
|
-
|
|
102
|
-
// Flex item props (used when child of <flexContainer>)
|
|
103
|
-
flexGrow?: number;
|
|
104
|
-
flexShrink?: number;
|
|
105
|
-
layoutWidth?: number | string;
|
|
106
|
-
layoutHeight?: number | string;
|
|
107
|
-
alignSelf?: AlignSelf;
|
|
108
|
-
flexExclude?: boolean;
|
|
109
|
-
// Absolute positioning for flexExclude children.
|
|
110
|
-
// Values describe the visual bounding rectangle (top-left of the rendered
|
|
111
|
-
// frame), so elements with centered origin like Button/Label are positioned
|
|
112
|
-
// intuitively — (left: 100, top: 50) puts the visible corner at (100, 50).
|
|
113
|
-
top?: number;
|
|
114
|
-
right?: number;
|
|
115
|
-
bottom?: number;
|
|
116
|
-
left?: number;
|
|
117
|
-
/** X coordinate of the visual center within parent (px or `'50%'`). Overrides left/right. */
|
|
118
|
-
centerX?: number | string;
|
|
119
|
-
/** Y coordinate of the visual center within parent (px or `'50%'`). Overrides top/bottom. */
|
|
120
|
-
centerY?: number | string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// ─── PixiJS primitive elements ───────────────────────────
|
|
124
|
-
|
|
125
|
-
export interface SpriteProps extends BaseProps {
|
|
126
|
-
texture?: string | Texture;
|
|
127
|
-
anchor?: number | { x: number; y: number };
|
|
128
|
-
tint?: number;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export interface TextProps extends BaseProps {
|
|
132
|
-
text?: string;
|
|
133
|
-
style?: Partial<TextStyle>;
|
|
134
|
-
anchor?: number | { x: number; y: number };
|
|
135
|
-
// Dash-notation for style
|
|
136
|
-
'style-fontSize'?: number;
|
|
137
|
-
'style-fill'?: number | string;
|
|
138
|
-
'style-fontFamily'?: string;
|
|
139
|
-
'style-fontWeight'?: string;
|
|
140
|
-
'style-letterSpacing'?: number;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface GraphicsProps extends BaseProps {
|
|
144
|
-
/** Draw function: receives the Graphics instance, called on mount and updates */
|
|
145
|
-
draw?: (g: any) => void;
|
|
146
|
-
/**
|
|
147
|
-
* Layout size hint (pixels). For Graphics, `width`/`height` do NOT apply a scale
|
|
148
|
-
* transform (unlike Container.width). They're forwarded to the parent
|
|
149
|
-
* FlexContainer as `layoutWidth`/`layoutHeight` so layout measures the element
|
|
150
|
-
* at the requested size while the actual geometry stays in the `draw` callback.
|
|
151
|
-
*/
|
|
152
|
-
width?: number;
|
|
153
|
-
height?: number;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface AnimatedSpriteProps extends BaseProps {
|
|
157
|
-
textures?: Texture[];
|
|
158
|
-
animationSpeed?: number;
|
|
159
|
-
loop?: boolean;
|
|
160
|
-
playing?: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface NineSliceSpriteProps extends BaseProps {
|
|
164
|
-
texture?: string | Texture;
|
|
165
|
-
leftWidth?: number;
|
|
166
|
-
topHeight?: number;
|
|
167
|
-
rightWidth?: number;
|
|
168
|
-
bottomHeight?: number;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export interface TilingSpriteProps extends BaseProps {
|
|
172
|
-
texture?: string | Texture;
|
|
173
|
-
tilePosition?: { x: number; y: number };
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// ─── Engine UI component props ───────────────────────────
|
|
177
|
-
|
|
178
|
-
export interface ButtonComponentProps extends BaseProps, Omit<ButtonConfig, 'colors' | 'textStyle'> {
|
|
179
|
-
// Full object form
|
|
180
|
-
colors?: Partial<Record<ButtonState, number>>;
|
|
181
|
-
textStyle?: Record<string, unknown>;
|
|
182
|
-
// Custom views (ViewInput: string texture name, Texture, or Container)
|
|
183
|
-
defaultView?: ViewInput;
|
|
184
|
-
hoverView?: ViewInput;
|
|
185
|
-
pressedView?: ViewInput;
|
|
186
|
-
disabledView?: ViewInput;
|
|
187
|
-
// Dash-notation for nested objects
|
|
188
|
-
'colors-default'?: number;
|
|
189
|
-
'colors-hover'?: number;
|
|
190
|
-
'colors-pressed'?: number;
|
|
191
|
-
'colors-disabled'?: number;
|
|
192
|
-
'textStyle-fontSize'?: number;
|
|
193
|
-
'textStyle-fill'?: number | string;
|
|
194
|
-
'textStyle-fontFamily'?: string;
|
|
195
|
-
'textStyle-fontWeight'?: string;
|
|
196
|
-
'textStyle-fontStyle'?: string;
|
|
197
|
-
'textStyle-letterSpacing'?: number;
|
|
198
|
-
// Component callbacks
|
|
199
|
-
onPress?: () => void;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface LabelComponentProps extends BaseProps, Omit<LabelConfig, 'style'> {
|
|
203
|
-
style?: Partial<TextStyle>;
|
|
204
|
-
'style-fontSize'?: number;
|
|
205
|
-
'style-fill'?: number | string;
|
|
206
|
-
'style-fontFamily'?: string;
|
|
207
|
-
'style-fontWeight'?: string;
|
|
208
|
-
'style-letterSpacing'?: number;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export interface LabelValueComponentProps extends Omit<BaseProps, 'width' | 'height' | 'label'>,
|
|
212
|
-
Omit<LabelValueConfig, 'labelStyle' | 'valueStyle'> {
|
|
213
|
-
labelStyle?: Partial<TextStyle>;
|
|
214
|
-
valueStyle?: Partial<TextStyle>;
|
|
215
|
-
width?: number | string;
|
|
216
|
-
height?: number | string;
|
|
217
|
-
// Dash-notation for nested styles
|
|
218
|
-
'labelStyle-fontSize'?: number;
|
|
219
|
-
'labelStyle-fill'?: number | string;
|
|
220
|
-
'labelStyle-fontFamily'?: string;
|
|
221
|
-
'labelStyle-fontWeight'?: string;
|
|
222
|
-
'valueStyle-fontSize'?: number;
|
|
223
|
-
'valueStyle-fill'?: number | string;
|
|
224
|
-
'valueStyle-fontFamily'?: string;
|
|
225
|
-
'valueStyle-fontWeight'?: string;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export interface PanelComponentProps extends BaseProps, Omit<PanelConfig, 'layout'> {
|
|
229
|
-
layout?: Partial<FlexContainerConfig>;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface FlexContainerComponentProps extends Omit<BaseProps, 'width' | 'height'>, FlexContainerConfig {
|
|
233
|
-
padding?: number | [number, number, number, number];
|
|
234
|
-
paddingTop?: number;
|
|
235
|
-
paddingRight?: number;
|
|
236
|
-
paddingBottom?: number;
|
|
237
|
-
paddingLeft?: number;
|
|
238
|
-
alignContent?: AlignContent;
|
|
239
|
-
width?: number | string;
|
|
240
|
-
height?: number | string;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface ProgressBarComponentProps extends BaseProps, ProgressBarConfig {
|
|
244
|
-
progress?: number;
|
|
245
|
-
/** Custom track background (string texture name, Texture, or Container) */
|
|
246
|
-
trackView?: ViewInput;
|
|
247
|
-
/** Custom fill bar */
|
|
248
|
-
fillView?: ViewInput;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export interface ScrollContainerComponentProps extends BaseProps, Omit<ScrollContainerConfig, 'width' | 'height'> {
|
|
252
|
-
width: number;
|
|
253
|
-
height: number;
|
|
254
|
-
/** Show scrollbar indicator */
|
|
255
|
-
scrollbar?: boolean;
|
|
256
|
-
/** Custom scrollbar thumb view */
|
|
257
|
-
thumbView?: ViewInput;
|
|
258
|
-
scrollbarWidth?: number;
|
|
259
|
-
scrollbarPadding?: number;
|
|
260
|
-
scrollbarColor?: number;
|
|
261
|
-
scrollbarAlpha?: number;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export interface ModalComponentProps extends BaseProps, ModalConfig {
|
|
265
|
-
onClose?: () => void;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface ToastComponentProps extends BaseProps, ToastConfig {
|
|
269
|
-
/** Custom background view */
|
|
270
|
-
backgroundView?: ViewInput;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export interface BalanceDisplayComponentProps extends BaseProps, BalanceDisplayConfig {
|
|
274
|
-
/** Current balance value */
|
|
275
|
-
value?: number;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export interface WinDisplayComponentProps extends BaseProps, WinDisplayConfig {}
|
|
279
|
-
|
|
280
|
-
export interface LayoutComponentProps extends BaseProps, LayoutConfig {}
|
|
281
|
-
|
|
282
|
-
export interface SliderComponentProps extends BaseProps, Omit<SliderConfig, 'width' | 'height'> {
|
|
283
|
-
width?: number;
|
|
284
|
-
height?: number;
|
|
285
|
-
onUpdate?: (value: number) => void;
|
|
286
|
-
onChange?: (value: number) => void;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export interface ToggleComponentProps extends BaseProps, Omit<ToggleConfig, 'width' | 'height'> {
|
|
290
|
-
width?: number;
|
|
291
|
-
height?: number;
|
|
292
|
-
onView?: ViewInput;
|
|
293
|
-
offView?: ViewInput;
|
|
294
|
-
onChange?: (value: boolean) => void;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// ─── IntrinsicElements map ───────────────────────────────
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Complete element → prop-type map for all engine-registered JSX elements.
|
|
301
|
-
* Also consumable directly for typing custom wrappers around engine elements.
|
|
302
|
-
*/
|
|
303
|
-
export interface EngineIntrinsicElements {
|
|
304
|
-
// PixiJS primitives
|
|
305
|
-
container: BaseProps;
|
|
306
|
-
sprite: SpriteProps;
|
|
307
|
-
text: TextProps;
|
|
308
|
-
graphics: GraphicsProps;
|
|
309
|
-
animatedSprite: AnimatedSpriteProps;
|
|
310
|
-
nineSliceSprite: NineSliceSpriteProps;
|
|
311
|
-
tilingSprite: TilingSpriteProps;
|
|
312
|
-
|
|
313
|
-
// Engine UI components
|
|
314
|
-
button: ButtonComponentProps;
|
|
315
|
-
label: LabelComponentProps;
|
|
316
|
-
labelValue: LabelValueComponentProps;
|
|
317
|
-
panel: PanelComponentProps;
|
|
318
|
-
flexContainer: FlexContainerComponentProps;
|
|
319
|
-
progressBar: ProgressBarComponentProps;
|
|
320
|
-
scrollContainer: ScrollContainerComponentProps;
|
|
321
|
-
modal: ModalComponentProps;
|
|
322
|
-
toast: ToastComponentProps;
|
|
323
|
-
balanceDisplay: BalanceDisplayComponentProps;
|
|
324
|
-
winDisplay: WinDisplayComponentProps;
|
|
325
|
-
layout: LayoutComponentProps;
|
|
326
|
-
slider: SliderComponentProps;
|
|
327
|
-
toggle: ToggleComponentProps;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// ─── Auto-augment React's JSX namespace ──────────────────
|
|
331
|
-
//
|
|
332
|
-
// React 19 scopes `JSX.IntrinsicElements` inside `declare module 'react'`,
|
|
333
|
-
// so we augment the same module. `extends EngineIntrinsicElements {}` adds
|
|
334
|
-
// every engine element to the interface the reconciler sees.
|
|
335
|
-
//
|
|
336
|
-
// Interface merging with `@types/react`'s HTML defaults: property names
|
|
337
|
-
// unique to the engine (`flexContainer`, `labelValue`, `button` since it
|
|
338
|
-
// carries our ButtonComponentProps, etc.) merge cleanly. For HTML-colliding
|
|
339
|
-
// names (`button`, `label`), this module-scoped augmentation takes precedence
|
|
340
|
-
// over the legacy global JSX namespace in React-19 apps.
|
|
341
|
-
|
|
342
|
-
declare module 'react' {
|
|
343
|
-
namespace JSX {
|
|
344
|
-
interface IntrinsicElements extends EngineIntrinsicElements {}
|
|
345
|
-
}
|
|
346
|
-
}
|