kustom-mc 0.1.9 → 1.0.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 +24 -18
- package/dist/block.d.ts +21 -0
- package/dist/block.js +24 -0
- package/dist/camera.d.ts +21 -0
- package/dist/camera.js +23 -0
- package/dist/chat.d.ts +19 -0
- package/dist/chat.js +21 -0
- package/dist/classes.d.ts +206 -0
- package/dist/classes.js +251 -0
- package/dist/command.d.ts +19 -0
- package/dist/command.js +22 -0
- package/dist/commands/editor.d.ts +2 -0
- package/dist/commands/editor.js +284 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/new.js +33 -23
- package/dist/compiler/async-transform.d.ts +0 -4
- package/dist/compiler/async-transform.js +0 -6
- package/dist/compiler/rhino-plugin.d.ts +0 -2
- package/dist/compiler/rhino-plugin.js +3 -21
- package/dist/gui.d.ts +20 -0
- package/dist/gui.js +17 -0
- package/dist/index.js +6 -1
- package/dist/item.d.ts +21 -0
- package/dist/item.js +24 -0
- package/dist/runtime.d.ts +18 -148
- package/dist/runtime.js +28 -88
- package/dist/script.d.ts +50 -0
- package/dist/script.js +21 -0
- package/dist/sound.d.ts +25 -0
- package/dist/sound.js +14 -0
- package/dist/storage.d.ts +13 -0
- package/dist/storage.js +16 -0
- package/dist/types/__tests__/debug-inference.d.ts +1 -1
- package/dist/types/__tests__/debug-inference.js +11 -8
- package/dist/types/__tests__/defineScript-methods-dx-test.d.ts +14 -0
- package/dist/types/__tests__/defineScript-methods-dx-test.js +68 -21
- package/dist/types/__tests__/defineScript-methods-negative-test.d.ts +1 -0
- package/dist/types/__tests__/defineScript-methods-negative-test.js +29 -13
- package/dist/types/__tests__/methods-type-test.js +30 -20
- package/dist/types/__tests__/prototype-this-debug.d.ts +5 -0
- package/dist/types/__tests__/prototype-this-debug.js +46 -0
- package/dist/types/index.d.ts +182 -595
- package/dist/types/index.js +4 -0
- package/editor-dist/assets/index-C_6xy8vE.js +7906 -0
- package/editor-dist/assets/index-cIiKhf-b.css +1 -0
- package/editor-dist/index.html +14 -0
- package/package.json +93 -6
- package/dist/compiler/inline.d.ts +0 -32
- package/dist/compiler/inline.js +0 -87
- package/dist/compiler/postprocess.d.ts +0 -19
- package/dist/compiler/postprocess.js +0 -136
- package/dist/compiler/transform.d.ts +0 -18
- package/dist/compiler/transform.js +0 -59
- package/templates/project/kustom.config.json +0 -26
- package/templates/project/scripts/example.ts +0 -17
- package/templates/project/scripts/lib/utils.ts +0 -19
- package/templates/project/tsconfig.json +0 -27
- package/templates/scripts/block.ts.hbs +0 -14
- package/templates/scripts/gui.ts.hbs +0 -28
- package/templates/scripts/item.ts.hbs +0 -13
- package/templates/scripts/script.ts.hbs +0 -18
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ npx kustom-mc build
|
|
|
22
22
|
# Build and watch for changes
|
|
23
23
|
npx kustom-mc build --watch
|
|
24
24
|
|
|
25
|
-
#
|
|
26
|
-
npx kustom-mc
|
|
25
|
+
# Push to development server
|
|
26
|
+
npx kustom-mc push
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Table of Contents
|
|
@@ -264,8 +264,8 @@ export default defineScript({
|
|
|
264
264
|
|
|
265
265
|
// Create a 27-slot screen (3 rows)
|
|
266
266
|
const screen = new Screen(27, {
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
usePlayerInventorySlots: true, // Use player inv for GUI components
|
|
268
|
+
persistenceKey: "my-gui", // Enable persistence
|
|
269
269
|
});
|
|
270
270
|
|
|
271
271
|
// Or with custom texture
|
|
@@ -296,12 +296,11 @@ export default defineScript({
|
|
|
296
296
|
|
|
297
297
|
```typescript
|
|
298
298
|
new Screen(size, {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
persistenceKey: string, // Enable persistence
|
|
299
|
+
persistenceKey: string, // Enable persistence with this key
|
|
300
|
+
usePlayerInventorySlots: boolean, // Use player inv for GUI components
|
|
301
|
+
id: string, // Unique identifier for persistence path
|
|
302
|
+
persist: boolean, // Enable content slot persistence
|
|
303
|
+
persistScroll: boolean, // Enable scroll position persistence
|
|
305
304
|
});
|
|
306
305
|
```
|
|
307
306
|
|
|
@@ -312,7 +311,6 @@ Use player inventory slots for extended GUIs (like numpad):
|
|
|
312
311
|
```typescript
|
|
313
312
|
const screen = new Screen(9, {
|
|
314
313
|
usePlayerInventorySlots: true, // Enable player inv slots
|
|
315
|
-
autoCover: false,
|
|
316
314
|
});
|
|
317
315
|
|
|
318
316
|
// Chest slots: 0-8 (for 9-slot screen)
|
|
@@ -669,8 +667,8 @@ Compile TypeScript to JavaScript.
|
|
|
669
667
|
```bash
|
|
670
668
|
npx kustom-mc build # Build all scripts
|
|
671
669
|
npx kustom-mc build --watch # Watch mode
|
|
672
|
-
npx kustom-mc build --deploy # Build and copy to server
|
|
673
670
|
npx kustom-mc build --no-validate # Skip validation
|
|
671
|
+
npx kustom-mc build --clean # Clean output before building
|
|
674
672
|
```
|
|
675
673
|
|
|
676
674
|
#### `kustom bundle`
|
|
@@ -750,12 +748,17 @@ run({ process, props, command }) {
|
|
|
750
748
|
],
|
|
751
749
|
"outDir": "dist",
|
|
752
750
|
"lib": ["scripts/lib"],
|
|
753
|
-
"
|
|
754
|
-
"
|
|
755
|
-
"
|
|
751
|
+
"manifest": {
|
|
752
|
+
"id": "my-pack",
|
|
753
|
+
"name": "My Pack",
|
|
754
|
+
"version": "1.0.0",
|
|
755
|
+
"scope": "global"
|
|
756
|
+
},
|
|
757
|
+
"server": {
|
|
758
|
+
"url": "http://localhost:8765"
|
|
756
759
|
},
|
|
757
760
|
"bundle": {
|
|
758
|
-
"output": "
|
|
761
|
+
"output": "dist/kustompack.zip",
|
|
759
762
|
"include": ["**/*.js", "textures/**/*", "gui/**/*", "models/**/*"]
|
|
760
763
|
}
|
|
761
764
|
}
|
|
@@ -769,8 +772,11 @@ run({ process, props, command }) {
|
|
|
769
772
|
| `exclude` | Patterns to exclude |
|
|
770
773
|
| `outDir` | Output directory for compiled scripts |
|
|
771
774
|
| `lib` | Directories containing shared libraries |
|
|
772
|
-
| `
|
|
773
|
-
| `
|
|
775
|
+
| `manifest.id` | Unique pack identifier (required) |
|
|
776
|
+
| `manifest.name` | Human-readable pack name |
|
|
777
|
+
| `manifest.version` | Pack version (semver) |
|
|
778
|
+
| `manifest.scope` | Pack scope: `"global"`, `"world"`, or `"player"` |
|
|
779
|
+
| `server.url` | Server URL for `kustom push` deployment |
|
|
774
780
|
| `bundle.output` | Output path for bundle zip |
|
|
775
781
|
| `bundle.include` | Files to include in bundle |
|
|
776
782
|
|
package/dist/block.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/block — Custom block definition.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { defineBlock } from 'kustom-mc/block';
|
|
7
|
+
*
|
|
8
|
+
* export default defineBlock({
|
|
9
|
+
* id: "tower",
|
|
10
|
+
* model: "kustom:block/tower",
|
|
11
|
+
* collision: "full",
|
|
12
|
+
* autoPlace: true,
|
|
13
|
+
* onClick(event) {
|
|
14
|
+
* event.player.sendMessage("Clicked!");
|
|
15
|
+
* }
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
import type { BlockConfig, BlockDefinition } from './types/index.js';
|
|
20
|
+
export declare function defineBlock(config: BlockConfig): BlockDefinition;
|
|
21
|
+
export type { BlockConfig, BlockDefinition, CollisionConfig, BlockClickEvent, BlockBreakEvent, BlockPlaceEvent, BlockScriptContext, ShaperAPI, ShaperTemplateBuilder, ShaperTemplateWrapper, ShaperBlockInstance, ShaperClickEvent, ShaperBreakEvent, ShaperPlaceEvent, ScriptableCollisionInfo, DefinitionBuilder, ModelNode, ModelRef, ConditionNode, SelectNode, RangeDispatchNode, CompositeNode, } from './types/index.js';
|
package/dist/block.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/block — Custom block definition.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { defineBlock } from 'kustom-mc/block';
|
|
7
|
+
*
|
|
8
|
+
* export default defineBlock({
|
|
9
|
+
* id: "tower",
|
|
10
|
+
* model: "kustom:block/tower",
|
|
11
|
+
* collision: "full",
|
|
12
|
+
* autoPlace: true,
|
|
13
|
+
* onClick(event) {
|
|
14
|
+
* event.player.sendMessage("Clicked!");
|
|
15
|
+
* }
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// ============================================
|
|
20
|
+
// defineBlock
|
|
21
|
+
// ============================================
|
|
22
|
+
export function defineBlock(config) {
|
|
23
|
+
return config;
|
|
24
|
+
}
|
package/dist/camera.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/camera — Camera and Animation classes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { Camera, Animation } from 'kustom-mc/camera';
|
|
7
|
+
*
|
|
8
|
+
* const cam = new Camera(100, 65, 200);
|
|
9
|
+
* cam.startCameraMode("Steve");
|
|
10
|
+
*
|
|
11
|
+
* const anim = Animation.create()
|
|
12
|
+
* .start(100, 65, 200)
|
|
13
|
+
* .end(150, 70, 250)
|
|
14
|
+
* .duration(5)
|
|
15
|
+
* .camera(cam.getId())
|
|
16
|
+
* .build();
|
|
17
|
+
* anim.start();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export { Camera, Animation } from './classes.js';
|
|
21
|
+
export type { CameraAnimationBuilder, TargetAnimationBuilder, EntityTargetAnimationBuilder, AnimationSetBuilder, CameraAnimation, TargetAnimation, EntityTargetAnimation, AnimationSet, PathAPI, Path, CurveAPI, Curve, } from './types/index.js';
|
package/dist/camera.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/camera — Camera and Animation classes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { Camera, Animation } from 'kustom-mc/camera';
|
|
7
|
+
*
|
|
8
|
+
* const cam = new Camera(100, 65, 200);
|
|
9
|
+
* cam.startCameraMode("Steve");
|
|
10
|
+
*
|
|
11
|
+
* const anim = Animation.create()
|
|
12
|
+
* .start(100, 65, 200)
|
|
13
|
+
* .end(150, 70, 250)
|
|
14
|
+
* .duration(5)
|
|
15
|
+
* .camera(cam.getId())
|
|
16
|
+
* .build();
|
|
17
|
+
* anim.start();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
// ============================================
|
|
21
|
+
// Value Exports
|
|
22
|
+
// ============================================
|
|
23
|
+
export { Camera, Animation } from './classes.js';
|
package/dist/chat.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/chat — ChatGUI and ChatSession classes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { ChatGUI, ChatSession } from 'kustom-mc/chat';
|
|
7
|
+
*
|
|
8
|
+
* const gui = new ChatGUI();
|
|
9
|
+
* gui.addLine("Welcome!");
|
|
10
|
+
* gui.open("Steve");
|
|
11
|
+
*
|
|
12
|
+
* const session = new ChatSession("lobby", (player, msg) => {
|
|
13
|
+
* console.log(player + ": " + msg);
|
|
14
|
+
* });
|
|
15
|
+
* session.addPlayer("Steve");
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { ChatGUI, ChatSession } from './classes.js';
|
|
19
|
+
export type { ChatGUILine, ColumnConfig, } from './types/index.js';
|
package/dist/chat.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kustom-mc/chat — ChatGUI and ChatSession classes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { ChatGUI, ChatSession } from 'kustom-mc/chat';
|
|
7
|
+
*
|
|
8
|
+
* const gui = new ChatGUI();
|
|
9
|
+
* gui.addLine("Welcome!");
|
|
10
|
+
* gui.open("Steve");
|
|
11
|
+
*
|
|
12
|
+
* const session = new ChatSession("lobby", (player, msg) => {
|
|
13
|
+
* console.log(player + ": " + msg);
|
|
14
|
+
* });
|
|
15
|
+
* session.addPlayer("Steve");
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// ============================================
|
|
19
|
+
// Value Exports
|
|
20
|
+
// ============================================
|
|
21
|
+
export { ChatGUI, ChatSession } from './classes.js';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { ScreenOptions, ContainerConfig, ScriptablePlayer, ElementClickEvent, GuiText, BackgroundSlot, CellState, Element, ChatGUILine, CameraAnimationBuilder, AnimationSetBuilder, TargetAnimationBuilder, EntityTargetAnimationBuilder, PathAPI, CurveAPI, GuiComponentType } from './types/index.js';
|
|
2
|
+
export declare class Camera {
|
|
3
|
+
constructor(x: number, y: number, z: number, yaw?: number, pitch?: number);
|
|
4
|
+
getId(): string;
|
|
5
|
+
getLocation(): [number, number, number];
|
|
6
|
+
setLocation(x: number, y: number, z: number, yaw?: number, pitch?: number): void;
|
|
7
|
+
getYaw(): number;
|
|
8
|
+
setYaw(yaw: number): void;
|
|
9
|
+
getPitch(): number;
|
|
10
|
+
setPitch(pitch: number): void;
|
|
11
|
+
setRotation(yaw: number, pitch: number): void;
|
|
12
|
+
getDirection(): [number, number, number];
|
|
13
|
+
setDirection(x: number, y: number, z: number): void;
|
|
14
|
+
isActive(): boolean;
|
|
15
|
+
getSpectator(): string | null;
|
|
16
|
+
getSpectatorCount(): number;
|
|
17
|
+
startCameraMode(playerName: string): boolean;
|
|
18
|
+
move(dx: number, dy: number, dz: number): void;
|
|
19
|
+
moveTo(x: number, y: number, z: number): void;
|
|
20
|
+
rotate(yaw: number, pitch: number): void;
|
|
21
|
+
lookAt(x: number, y: number, z: number): void;
|
|
22
|
+
lookAtPlayer(playerName: string): void;
|
|
23
|
+
isTransparentViewEnabled(): boolean;
|
|
24
|
+
setTransparentView(enabled: boolean): void;
|
|
25
|
+
toggleTransparentView(): void;
|
|
26
|
+
clearTransparentView(): void;
|
|
27
|
+
forceUpdateTransparentView(): void;
|
|
28
|
+
setTarget(x: number, y: number, z: number): void;
|
|
29
|
+
setTargetPlayer(playerName: string): void;
|
|
30
|
+
clearTarget(): void;
|
|
31
|
+
hasTarget(): boolean;
|
|
32
|
+
stopSpectating(): boolean;
|
|
33
|
+
remove(): boolean;
|
|
34
|
+
forceUpdate(): void;
|
|
35
|
+
createFakeEntity(): void;
|
|
36
|
+
toString(): string;
|
|
37
|
+
}
|
|
38
|
+
export declare class Animation {
|
|
39
|
+
constructor();
|
|
40
|
+
static create(): CameraAnimationBuilder;
|
|
41
|
+
static createSet(): AnimationSetBuilder;
|
|
42
|
+
static createTargetAnimation(x: number, y: number, z: number): TargetAnimationBuilder;
|
|
43
|
+
static createEntityTargetAnimation(playerName: string): EntityTargetAnimationBuilder | null;
|
|
44
|
+
startFollowing(cameraId: string, playerName: string, xOffset: number, yOffset: number, zOffset: number): boolean;
|
|
45
|
+
stopFollowing(cameraId: string): boolean;
|
|
46
|
+
isFollowing(cameraId: string): boolean;
|
|
47
|
+
stopAllFollowing(): void;
|
|
48
|
+
getPath(): PathAPI;
|
|
49
|
+
getCurve(): CurveAPI;
|
|
50
|
+
stopAllAnimations(): void;
|
|
51
|
+
}
|
|
52
|
+
export declare class ChatGUI {
|
|
53
|
+
constructor();
|
|
54
|
+
onInput(callback: (playerName: string, message: string, guiId: string) => void): void;
|
|
55
|
+
setId(guiId: string): void;
|
|
56
|
+
getId(): string;
|
|
57
|
+
setBlocking(blocking: boolean): void;
|
|
58
|
+
isBlocking(): boolean;
|
|
59
|
+
addLine(content: string | ((line: ChatGUILine) => void) | ChatGUILine): void;
|
|
60
|
+
addEmptyLine(): void;
|
|
61
|
+
createLine(): ChatGUILine;
|
|
62
|
+
setLine(index: number, callback: (line: ChatGUILine) => void): void;
|
|
63
|
+
updateLine(lineIndex: number, callback: (line: ChatGUILine) => void): void;
|
|
64
|
+
removeLine(index: number): void;
|
|
65
|
+
clear(): void;
|
|
66
|
+
size(): number;
|
|
67
|
+
ensureSize(minSize: number): void;
|
|
68
|
+
addLineAt(index: number, content: ((line: ChatGUILine) => void) | ChatGUILine): void;
|
|
69
|
+
setGlobalBackground(color: string): void;
|
|
70
|
+
removeGlobalBackground(): void;
|
|
71
|
+
open(playerName: string): void;
|
|
72
|
+
close(playerName?: string): void;
|
|
73
|
+
rerender(): void;
|
|
74
|
+
rerenderForPlayer(playerName: string): void;
|
|
75
|
+
}
|
|
76
|
+
export declare class ChatSession {
|
|
77
|
+
constructor(sessionId: string, callback: (playerName: string, message: string, sessionId: string) => void);
|
|
78
|
+
getSessionId(): string;
|
|
79
|
+
getViewerCount(): number;
|
|
80
|
+
getPlayerCount(): number;
|
|
81
|
+
hasPlayer(playerName: string): boolean;
|
|
82
|
+
addPlayer(playerName: string): void;
|
|
83
|
+
removePlayer(playerName: string): void;
|
|
84
|
+
sendMessage(message: string): void;
|
|
85
|
+
sendMessageToPlayer(playerName: string, message: string): void;
|
|
86
|
+
close(): void;
|
|
87
|
+
setClusterMode(clusterMode: boolean): void;
|
|
88
|
+
isClusterMode(): boolean;
|
|
89
|
+
clearPlayerChat(playerName: string): void;
|
|
90
|
+
static isPlayerInSession(playerName: string): boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare class Storage {
|
|
93
|
+
constructor(namespace?: string);
|
|
94
|
+
set(key: string, value: unknown): void;
|
|
95
|
+
get<T = unknown>(key: string): T | undefined;
|
|
96
|
+
remove(key: string): boolean;
|
|
97
|
+
has(key: string): boolean;
|
|
98
|
+
keys(): string[];
|
|
99
|
+
clear(): number;
|
|
100
|
+
size(): number;
|
|
101
|
+
}
|
|
102
|
+
export declare class Screen {
|
|
103
|
+
constructor(sizeOrTexture: number | string, sizeOrOptions?: number | ScreenOptions, options?: ScreenOptions);
|
|
104
|
+
createContainer(config: ContainerConfig): Container;
|
|
105
|
+
add(component: GuiComponentType): this;
|
|
106
|
+
addButton(slot: number, texture: string, title: string | null, onClick?: (event: ElementClickEvent) => void): Element;
|
|
107
|
+
removeButton(slot: number): void;
|
|
108
|
+
getButton(slot: number): Element | null;
|
|
109
|
+
appendText(text: string, size: number, y: number, centered: boolean): GuiText;
|
|
110
|
+
clearText(): void;
|
|
111
|
+
setBackgroundColor(hex: string): void;
|
|
112
|
+
putBackground(slot: number): BackgroundSlot;
|
|
113
|
+
open(player: ScriptablePlayer | string): void;
|
|
114
|
+
close(): void;
|
|
115
|
+
refresh(): void;
|
|
116
|
+
setTexture(texture: string | null): void;
|
|
117
|
+
getTexture(): string | null;
|
|
118
|
+
getSize(): number;
|
|
119
|
+
getId(): string;
|
|
120
|
+
getPersistenceKey(): string | null;
|
|
121
|
+
isPersistent(): boolean;
|
|
122
|
+
getViewerCount(): number;
|
|
123
|
+
getTotalSlots(): number;
|
|
124
|
+
isPlayerInventorySlot(screenSlot: number): boolean;
|
|
125
|
+
toPlayerInventorySlot(screenSlot: number): number;
|
|
126
|
+
fromPlayerInventorySlot(playerSlot: number): number;
|
|
127
|
+
isUsingPlayerInventorySlots(): boolean;
|
|
128
|
+
setUsePlayerInventorySlots(enabled: boolean): void;
|
|
129
|
+
getCellState(slot: number): CellState;
|
|
130
|
+
save(): void;
|
|
131
|
+
load(): void;
|
|
132
|
+
destroy(): void;
|
|
133
|
+
onEvent(eventName: "open" | "close", callback: (player: ScriptablePlayer) => void): this;
|
|
134
|
+
on(eventName: string, callback: (...args: unknown[]) => void): void;
|
|
135
|
+
}
|
|
136
|
+
export declare class Container {
|
|
137
|
+
constructor(config: ContainerConfig);
|
|
138
|
+
addChild(child: Element | Container): this;
|
|
139
|
+
addChildAt(index: number, child: Element | Container): this;
|
|
140
|
+
removeChildAt(index: number): this;
|
|
141
|
+
getChildAt(index: number): Element | Container | null;
|
|
142
|
+
getChildCount(): number;
|
|
143
|
+
clear(): this;
|
|
144
|
+
addButton(texture: string, title: string | null, onClick?: (event: ElementClickEvent) => void): Element;
|
|
145
|
+
addButtonAt(index: number, texture: string, title: string | null, onClick?: (event: ElementClickEvent) => void): Element;
|
|
146
|
+
addContentSlot(): Element;
|
|
147
|
+
addContentSlotAt(index: number): Element;
|
|
148
|
+
addContainer(config: ContainerConfig): Container;
|
|
149
|
+
addContainerAt(index: number, config: ContainerConfig): Container;
|
|
150
|
+
add(element: Element | Container): this;
|
|
151
|
+
addAt(index: number, element: Element | Container): this;
|
|
152
|
+
pushButton(texture: string, title: string | null, onClick?: (event: ElementClickEvent) => void): Element;
|
|
153
|
+
putButton(index: number, texture: string, title: string | null, onClick?: (event: ElementClickEvent) => void): Element;
|
|
154
|
+
pushContentSlot(): Element;
|
|
155
|
+
putContentSlot(index: number): Element;
|
|
156
|
+
pushContainer(config: ContainerConfig): Container;
|
|
157
|
+
putContainer(index: number, config: ContainerConfig): Container;
|
|
158
|
+
setBackgroundColor(hex: string): void;
|
|
159
|
+
putBackground(localIndex: number): BackgroundSlot;
|
|
160
|
+
setLayout(layout: "grid" | "flex"): this;
|
|
161
|
+
setDirection(direction: "row" | "column"): this;
|
|
162
|
+
setGap(gap: number): this;
|
|
163
|
+
setStartSlot(slot: number): this;
|
|
164
|
+
setRows(rows: number): this;
|
|
165
|
+
setCols(cols: number): this;
|
|
166
|
+
getLayout(): "grid" | "flex";
|
|
167
|
+
getDirection(): "row" | "column";
|
|
168
|
+
getGap(): number;
|
|
169
|
+
getStartSlot(): number;
|
|
170
|
+
getRows(): number;
|
|
171
|
+
getCols(): number;
|
|
172
|
+
getSlotCount(): number;
|
|
173
|
+
getElementCount(): number;
|
|
174
|
+
getElementAt(index: number): Element | Container | null;
|
|
175
|
+
getElement(index: number): Element | Container | null;
|
|
176
|
+
getIndex(): number;
|
|
177
|
+
setId(id: string): this;
|
|
178
|
+
getId(): string | null;
|
|
179
|
+
setPersist(persist: boolean): this;
|
|
180
|
+
isPersist(): boolean;
|
|
181
|
+
setPersistScroll(persistScroll: boolean): this;
|
|
182
|
+
isPersistScroll(): boolean;
|
|
183
|
+
setScrollable(scrollable: boolean): this;
|
|
184
|
+
isScrollable(): boolean;
|
|
185
|
+
setMaxCapacity(max: number): this;
|
|
186
|
+
getMaxCapacity(): number;
|
|
187
|
+
isFull(): boolean;
|
|
188
|
+
getRemainingCapacity(): number;
|
|
189
|
+
scroll(offset: number): void;
|
|
190
|
+
scrollPage(direction: 1 | -1): void;
|
|
191
|
+
scrollTo(virtualIndex: number): void;
|
|
192
|
+
scrollToPage(page: number): void;
|
|
193
|
+
getPageSize(): number;
|
|
194
|
+
getPageCount(): number;
|
|
195
|
+
getCurrentPage(): number;
|
|
196
|
+
getScrollOffset(): number;
|
|
197
|
+
getVirtualSize(): number;
|
|
198
|
+
hasNextPage(): boolean;
|
|
199
|
+
hasPreviousPage(): boolean;
|
|
200
|
+
toAbsoluteSlot(relativeSlot: number): number;
|
|
201
|
+
toRelativeSlot(absoluteSlot: number): number;
|
|
202
|
+
virtualIndexToSlot(virtualIndex: number): number;
|
|
203
|
+
slotToVirtualIndex(slot: number): number;
|
|
204
|
+
getCellState(slot: number): CellState;
|
|
205
|
+
on(eventName: string, callback: (...args: unknown[]) => void): void;
|
|
206
|
+
}
|