@sandustry-modding/types 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.
- package/CHANGELOG.md +19 -0
- package/README.md +66 -0
- package/global.d.ts +38 -0
- package/package.json +44 -0
- package/sandkit/api/action.d.ts +28 -0
- package/sandkit/api/assets.d.ts +30 -0
- package/sandkit/api/authorization.d.ts +54 -0
- package/sandkit/api/building.d.ts +92 -0
- package/sandkit/api/camera.d.ts +23 -0
- package/sandkit/api/collector.d.ts +36 -0
- package/sandkit/api/constants.d.ts +21 -0
- package/sandkit/api/cooldown.d.ts +26 -0
- package/sandkit/api/discoveries.d.ts +18 -0
- package/sandkit/api/effects.d.ts +76 -0
- package/sandkit/api/elements.d.ts +237 -0
- package/sandkit/api/energy.d.ts +70 -0
- package/sandkit/api/events.d.ts +53 -0
- package/sandkit/api/excavation.d.ts +34 -0
- package/sandkit/api/fire.d.ts +26 -0
- package/sandkit/api/gameconfig.d.ts +15 -0
- package/sandkit/api/grid.d.ts +26 -0
- package/sandkit/api/hooks.d.ts +52 -0
- package/sandkit/api/i18n.d.ts +101 -0
- package/sandkit/api/index.d.ts +66 -0
- package/sandkit/api/input.d.ts +119 -0
- package/sandkit/api/items.d.ts +60 -0
- package/sandkit/api/lights.d.ts +66 -0
- package/sandkit/api/maps.d.ts +33 -0
- package/sandkit/api/mods.d.ts +18 -0
- package/sandkit/api/patterns.d.ts +32 -0
- package/sandkit/api/player.d.ts +84 -0
- package/sandkit/api/processing.d.ts +66 -0
- package/sandkit/api/progression.d.ts +22 -0
- package/sandkit/api/projectiles.d.ts +80 -0
- package/sandkit/api/random.d.ts +21 -0
- package/sandkit/api/raycast.d.ts +19 -0
- package/sandkit/api/reactions.d.ts +30 -0
- package/sandkit/api/rendering.d.ts +26 -0
- package/sandkit/api/resources.d.ts +23 -0
- package/sandkit/api/sandkit-api.d.ts +117 -0
- package/sandkit/api/scene.d.ts +15 -0
- package/sandkit/api/schedule.d.ts +14 -0
- package/sandkit/api/settings.d.ts +29 -0
- package/sandkit/api/shared.d.ts +27 -0
- package/sandkit/api/signals.d.ts +25 -0
- package/sandkit/api/sound.d.ts +91 -0
- package/sandkit/api/sprites.d.ts +45 -0
- package/sandkit/api/storage.d.ts +55 -0
- package/sandkit/api/structureBehaviors.d.ts +22 -0
- package/sandkit/api/structures.d.ts +320 -0
- package/sandkit/api/tech.d.ts +66 -0
- package/sandkit/api/terrains.d.ts +125 -0
- package/sandkit/api/time.d.ts +13 -0
- package/sandkit/api/tools.d.ts +35 -0
- package/sandkit/api/triggers.d.ts +24 -0
- package/sandkit/api/ui.d.ts +175 -0
- package/sandkit/api/upgrades.d.ts +63 -0
- package/sandkit/api/utils.d.ts +35 -0
- package/sandkit/api/workers.d.ts +14 -0
- package/sandkit/api/world.d.ts +107 -0
- package/sandkit/engine/api/augments.d.ts +96 -0
- package/sandkit/engine/api/auralite.d.ts +21 -0
- package/sandkit/engine/api/blueprints.d.ts +47 -0
- package/sandkit/engine/api/clipboard.d.ts +46 -0
- package/sandkit/engine/api/colorPicker.d.ts +74 -0
- package/sandkit/engine/api/coloringTool.d.ts +56 -0
- package/sandkit/engine/api/conveyors.d.ts +16 -0
- package/sandkit/engine/api/debug.d.ts +16 -0
- package/sandkit/engine/api/drones.d.ts +21 -0
- package/sandkit/engine/api/entities.d.ts +66 -0
- package/sandkit/engine/api/extensions.d.ts +16 -0
- package/sandkit/engine/api/factory.d.ts +56 -0
- package/sandkit/engine/api/foliage.d.ts +31 -0
- package/sandkit/engine/api/foundationColorPicker.d.ts +16 -0
- package/sandkit/engine/api/game.d.ts +26 -0
- package/sandkit/engine/api/heatTransfer.d.ts +46 -0
- package/sandkit/engine/api/index.d.ts +47 -0
- package/sandkit/engine/api/launchers.d.ts +16 -0
- package/sandkit/engine/api/lightColorPicker.d.ts +16 -0
- package/sandkit/engine/api/matters.d.ts +26 -0
- package/sandkit/engine/api/misc.d.ts +16 -0
- package/sandkit/engine/api/portals.d.ts +16 -0
- package/sandkit/engine/api/prefabData.d.ts +36 -0
- package/sandkit/engine/api/prefabDecor.d.ts +21 -0
- package/sandkit/engine/api/prefabulator.d.ts +21 -0
- package/sandkit/engine/api/prismaline.d.ts +26 -0
- package/sandkit/engine/api/prismite.d.ts +26 -0
- package/sandkit/engine/api/queue.d.ts +41 -0
- package/sandkit/engine/api/shadows.d.ts +26 -0
- package/sandkit/engine/api/strataform.d.ts +36 -0
- package/sandkit/engine/api/swarmConsole.d.ts +71 -0
- package/sandkit/engine/api/sweeperDrone.d.ts +16 -0
- package/sandkit/engine/api/teleportZones.d.ts +46 -0
- package/sandkit/engine/api/tutorialBuild.d.ts +66 -0
- package/sandkit/engine/api/usageTracker.d.ts +26 -0
- package/sandkit/engine/api/wall.d.ts +31 -0
- package/sandkit/engine/api/workerLocal.d.ts +30 -0
- package/sandkit/engine/index.d.ts +135 -0
- package/sandkit/engine/retro-console.d.ts +52 -0
- package/sandkit/engine/state.d.ts +31 -0
- package/sandkit/enums/index.d.ts +444 -0
- package/sandkit/index.d.ts +47 -0
- package/sandkit/react.d.ts +49 -0
- package/shared/api/effects.d.ts +76 -0
- package/shared/api/elements.d.ts +162 -0
- package/shared/api/maps.d.ts +30 -0
- package/shared/api/player.d.ts +31 -0
- package/shared/api/shared.d.ts +46 -0
- package/shared/api/structures.d.ts +138 -0
- package/shared/api/terrains.d.ts +100 -0
- package/shared/api/ui.d.ts +54 -0
- package/shared/api/world.d.ts +71 -0
- package/shared/asset.d.ts +14 -0
- package/shared/engine.d.ts +17 -0
- package/shared/index.d.ts +25 -0
- package/shared/jsonvalue.d.ts +30 -0
- package/shared/nominal.d.ts +31 -0
- package/shared/player.d.ts +173 -0
- package/worker/api/elements.d.ts +60 -0
- package/worker/api/main.d.ts +16 -0
- package/worker/api/shared.d.ts +38 -0
- package/worker/api/worker.d.ts +20 -0
- package/worker/index.d.ts +29 -0
- package/worker/sandkit-api.d.ts +31 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.queue` — deferred tick queue with handlers.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace queue {
|
|
11
|
+
/**
|
|
12
|
+
* Enqueue work to run on a future tick.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function enqueue(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Enqueue work to run after a tick delay.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function enqueueInTicks(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Enqueue work that skips the current tick.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function enqueueSkipTick(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Process pending queue items for the current tick.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function process(...args: unknown[]): unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Register a handler for a queue item type.
|
|
33
|
+
* @param args - Game state first, then method-specific arguments.
|
|
34
|
+
*/
|
|
35
|
+
export function registerHandler(...args: unknown[]): unknown;
|
|
36
|
+
/**
|
|
37
|
+
* Remove queued items by key.
|
|
38
|
+
* @param args - Game state first, then method-specific arguments.
|
|
39
|
+
*/
|
|
40
|
+
export function removeByKey(...args: unknown[]): unknown;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.shadows` — shadow map refresh for regions.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace shadows {
|
|
11
|
+
/**
|
|
12
|
+
* Refresh shadows for the whole visible area.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function refresh(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Refresh shadows within a circular radius.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function refreshRadius(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Refresh shadows within a rectangle.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function refreshRect(...args: unknown[]): unknown;
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.strataform` — strataform event triggers and type registration.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace strataform {
|
|
11
|
+
/**
|
|
12
|
+
* Return the default strataform configuration.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function getDefaultConfig(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return all registered strataform types.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function getRegisteredTypes(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Register a custom strataform type.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function registerType(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Trigger a strataform event at a location.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function trigger(...args: unknown[]): unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Trigger a strataform event by type id.
|
|
33
|
+
* @param args - Game state first, then method-specific arguments.
|
|
34
|
+
*/
|
|
35
|
+
export function triggerByType(...args: unknown[]): unknown;
|
|
36
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.swarmConsole` — swarm convergence console state.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace swarmConsole {
|
|
11
|
+
/**
|
|
12
|
+
* Decrease the convergence buffer by one step.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function decrementConvergenceBuffer(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return total crystal mined for swarm consoles.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function getCrystalMined(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Return the disk radius in cells for a console.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function getDiskRadiusCells(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Return the entity type used by swarm consoles.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function getEntityType(...args: unknown[]): unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Return the nearest convergence point.
|
|
33
|
+
* @param args - Game state first, then method-specific arguments.
|
|
34
|
+
*/
|
|
35
|
+
export function getNearestConvergence(...args: unknown[]): unknown;
|
|
36
|
+
/**
|
|
37
|
+
* Return the pending convergence target.
|
|
38
|
+
* @param args - Game state first, then method-specific arguments.
|
|
39
|
+
*/
|
|
40
|
+
export function getPendingConvergence(...args: unknown[]): unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Return all placed swarm console structures.
|
|
43
|
+
* @param args - Game state first, then method-specific arguments.
|
|
44
|
+
*/
|
|
45
|
+
export function getPlacedConsoles(...args: unknown[]): unknown;
|
|
46
|
+
/**
|
|
47
|
+
* Return the console effect radius in pixels.
|
|
48
|
+
* @param args - Game state first, then method-specific arguments.
|
|
49
|
+
*/
|
|
50
|
+
export function getRadiusPx(...args: unknown[]): unknown;
|
|
51
|
+
/**
|
|
52
|
+
* Return whether swarm spawn is currently jammed.
|
|
53
|
+
* @param args - Game state first, then method-specific arguments.
|
|
54
|
+
*/
|
|
55
|
+
export function isSpawnJammed(...args: unknown[]): unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Register the entity type for swarm consoles.
|
|
58
|
+
* @param args - Game state first, then method-specific arguments.
|
|
59
|
+
*/
|
|
60
|
+
export function registerEntityType(...args: unknown[]): unknown;
|
|
61
|
+
/**
|
|
62
|
+
* Reset convergence buffers on all consoles.
|
|
63
|
+
* @param args - Game state first, then method-specific arguments.
|
|
64
|
+
*/
|
|
65
|
+
export function resetAllConvergenceBuffers(...args: unknown[]): unknown;
|
|
66
|
+
/**
|
|
67
|
+
* Set whether swarm spawn is jammed.
|
|
68
|
+
* @param args - Game state first, then method-specific arguments.
|
|
69
|
+
*/
|
|
70
|
+
export function setSpawnJammed(...args: unknown[]): unknown;
|
|
71
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.sweeperDrone` — sweeper drone selection control.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace sweeperDrone {
|
|
11
|
+
/**
|
|
12
|
+
* Cancel the active sweeper drone selection.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function cancelSelection(...args: unknown[]): unknown;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.teleportZones` — player teleport zone management.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace teleportZones {
|
|
11
|
+
/**
|
|
12
|
+
* Add a teleport zone to the world.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function add(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return all teleport zones.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function getAll(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Return the teleport zone at one grid cell.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function getAtCell(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Return one teleport zone by id.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function getById(...args: unknown[]): unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Remove a teleport zone.
|
|
33
|
+
* @param args - Game state first, then method-specific arguments.
|
|
34
|
+
*/
|
|
35
|
+
export function remove(...args: unknown[]): unknown;
|
|
36
|
+
/**
|
|
37
|
+
* Spawn default particles at a teleport zone.
|
|
38
|
+
* @param args - Game state first, then method-specific arguments.
|
|
39
|
+
*/
|
|
40
|
+
export function spawnDefaultParticles(...args: unknown[]): unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Teleport the player to a zone or position.
|
|
43
|
+
* @param args - Game state first, then method-specific arguments.
|
|
44
|
+
*/
|
|
45
|
+
export function teleportPlayerTo(...args: unknown[]): unknown;
|
|
46
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.tutorialBuild` — tutorial build-step constraints and targets.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace tutorialBuild {
|
|
11
|
+
/**
|
|
12
|
+
* Return whether all active tutorial targets are built.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function areAllTargetsBuilt(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return whether all targets in a structure family are built.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function areFamilyTargetsBuilt(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Return whether placement is allowed at the active target.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function canPlaceAtActiveTarget(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Return foundation move destination cells for the tutorial step.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function getFoundationMoveDests(...args: unknown[]): unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Return foundation move source cells for the tutorial step.
|
|
33
|
+
* @param args - Game state first, then method-specific arguments.
|
|
34
|
+
*/
|
|
35
|
+
export function getFoundationMoveSources(...args: unknown[]): unknown;
|
|
36
|
+
/**
|
|
37
|
+
* Return build targets for the current tutorial step.
|
|
38
|
+
* @param args - Game state first, then method-specific arguments.
|
|
39
|
+
*/
|
|
40
|
+
export function getTargets(...args: unknown[]): unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Return whether a tutorial build definition exists.
|
|
43
|
+
* @param args - Game state first, then method-specific arguments.
|
|
44
|
+
*/
|
|
45
|
+
export function hasDefinition(...args: unknown[]): unknown;
|
|
46
|
+
/**
|
|
47
|
+
* Return whether the current step restricts building.
|
|
48
|
+
* @param args - Game state first, then method-specific arguments.
|
|
49
|
+
*/
|
|
50
|
+
export function isStepConstrained(...args: unknown[]): unknown;
|
|
51
|
+
/**
|
|
52
|
+
* Return whether a foundation move matches tutorial rules.
|
|
53
|
+
* @param args - Game state first, then method-specific arguments.
|
|
54
|
+
*/
|
|
55
|
+
export function matchesFoundationMove(...args: unknown[]): unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Return whether a foundation remove matches tutorial rules.
|
|
58
|
+
* @param args - Game state first, then method-specific arguments.
|
|
59
|
+
*/
|
|
60
|
+
export function matchesFoundationRemove(...args: unknown[]): unknown;
|
|
61
|
+
/**
|
|
62
|
+
* Return whether the active target should be protected at a cell.
|
|
63
|
+
* @param args - Game state first, then method-specific arguments.
|
|
64
|
+
*/
|
|
65
|
+
export function shouldProtectActiveTargetAt(...args: unknown[]): unknown;
|
|
66
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.usageTracker` — tool and structure usage statistics.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace usageTracker {
|
|
11
|
+
/**
|
|
12
|
+
* Clear recorded usage statistics.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function clear(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return the most recently used item or structure.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function getLatest(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Return the most frequently used item or structure.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function getMostUsed(...args: unknown[]): unknown;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.wall` — wall tile palette and cell data.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Methods use loose stubs; signatures may take game state as the first argument.
|
|
6
|
+
* Engine methods pass game state as the first argument (args[0]); remaining entries are method-specific.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export namespace wall {
|
|
11
|
+
/**
|
|
12
|
+
* Return wall palette data for rendering.
|
|
13
|
+
* @param args - Game state first, then method-specific arguments.
|
|
14
|
+
*/
|
|
15
|
+
export function getPaletteData(...args: unknown[]): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Return wall tile data at one cell.
|
|
18
|
+
* @param args - Game state first, then method-specific arguments.
|
|
19
|
+
*/
|
|
20
|
+
export function getWallDataAt(...args: unknown[]): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Return the byte size of wall tile data.
|
|
23
|
+
* @param args - Game state first, then method-specific arguments.
|
|
24
|
+
*/
|
|
25
|
+
export function getWallDataSize(...args: unknown[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Set wall tile data at one cell.
|
|
28
|
+
* @param args - Game state first, then method-specific arguments.
|
|
29
|
+
*/
|
|
30
|
+
export function setWallDataAt(...args: unknown[]): unknown;
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.workerLocal` — per-worker ephemeral key-value storage.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Available on worker threads only. Values do not persist across workers.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export namespace workerLocal {
|
|
10
|
+
/**
|
|
11
|
+
* Remove all keys from worker-local storage.
|
|
12
|
+
* @param args - Worker-local context first on workers; otherwise game state first, then method-specific arguments.
|
|
13
|
+
*/
|
|
14
|
+
export function clear(...args: unknown[]): unknown;
|
|
15
|
+
/**
|
|
16
|
+
* Return a value by key, or undefined when missing.
|
|
17
|
+
* @param args - Worker-local context first on workers; otherwise game state first, then method-specific arguments.
|
|
18
|
+
*/
|
|
19
|
+
export function get(...args: unknown[]): unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Return a value by key, initializing it when missing.
|
|
22
|
+
* @param args - Worker-local context first on workers; otherwise game state first, then method-specific arguments.
|
|
23
|
+
*/
|
|
24
|
+
export function getOrInit(...args: unknown[]): unknown;
|
|
25
|
+
/**
|
|
26
|
+
* Store a value by key.
|
|
27
|
+
* @param args - Worker-local context first on workers; otherwise game state first, then method-specific arguments.
|
|
28
|
+
*/
|
|
29
|
+
export function set(...args: unknown[]): unknown;
|
|
30
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine` — state-first engine APIs and Retro Console.
|
|
3
|
+
*
|
|
4
|
+
* Runtime paths: `sandkit.engine.api.<name>` and `sandkit.engine.state`
|
|
5
|
+
* (same object as `sandkit.state`). Available on both the main thread
|
|
6
|
+
* (`main.js`) and worker thread (`worker.js`). The public `sandkit.api`
|
|
7
|
+
* surface still differs by runtime.
|
|
8
|
+
*
|
|
9
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
10
|
+
* These declarations are best-effort stubs. There is no guarantee they are
|
|
11
|
+
* complete or correct.
|
|
12
|
+
*
|
|
13
|
+
* @module engine
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
import type { RetroConsoleApi } from "./retro-console";
|
|
17
|
+
import type { EngineFn, EngineOverlapNs } from "../../shared/engine";
|
|
18
|
+
import type { SandkitState } from "./state";
|
|
19
|
+
|
|
20
|
+
export * from "./retro-console";
|
|
21
|
+
export * from "./api";
|
|
22
|
+
export * from "./state";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Composed `sandkit.engine.api` shape.
|
|
26
|
+
*
|
|
27
|
+
* Overlap namespaces mirror {@link sandkit.api} with state-first signatures.
|
|
28
|
+
* Engine-only namespaces are declared under `api/`.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export type SandkitEngineApi = {
|
|
33
|
+
// --- Overlap with sandkit.api (prefer the public API) ---
|
|
34
|
+
action: EngineOverlapNs;
|
|
35
|
+
authorization: EngineOverlapNs;
|
|
36
|
+
building: EngineOverlapNs;
|
|
37
|
+
camera: EngineOverlapNs;
|
|
38
|
+
collector: EngineOverlapNs;
|
|
39
|
+
constants: EngineOverlapNs;
|
|
40
|
+
cooldown: EngineOverlapNs;
|
|
41
|
+
discoveries: EngineOverlapNs;
|
|
42
|
+
effects: EngineOverlapNs;
|
|
43
|
+
elements: EngineOverlapNs;
|
|
44
|
+
energy: EngineOverlapNs;
|
|
45
|
+
events: EngineOverlapNs;
|
|
46
|
+
excavation: EngineOverlapNs;
|
|
47
|
+
fire: EngineOverlapNs;
|
|
48
|
+
grid: EngineOverlapNs;
|
|
49
|
+
hooks: EngineOverlapNs;
|
|
50
|
+
i18n: EngineOverlapNs;
|
|
51
|
+
input: EngineOverlapNs;
|
|
52
|
+
items: EngineOverlapNs;
|
|
53
|
+
lights: EngineOverlapNs;
|
|
54
|
+
maps: EngineOverlapNs;
|
|
55
|
+
patterns: EngineOverlapNs;
|
|
56
|
+
player: EngineOverlapNs;
|
|
57
|
+
processing: EngineOverlapNs;
|
|
58
|
+
progression: EngineOverlapNs;
|
|
59
|
+
projectiles: EngineOverlapNs;
|
|
60
|
+
random: EngineOverlapNs;
|
|
61
|
+
raycast: EngineOverlapNs;
|
|
62
|
+
reactions: EngineOverlapNs;
|
|
63
|
+
rendering: EngineOverlapNs;
|
|
64
|
+
resources: EngineOverlapNs;
|
|
65
|
+
scene: EngineOverlapNs;
|
|
66
|
+
schedule: EngineOverlapNs;
|
|
67
|
+
signals: EngineOverlapNs;
|
|
68
|
+
sound: EngineOverlapNs;
|
|
69
|
+
sprites: EngineOverlapNs;
|
|
70
|
+
storage: EngineOverlapNs;
|
|
71
|
+
structures: EngineOverlapNs;
|
|
72
|
+
tech: EngineOverlapNs;
|
|
73
|
+
terrains: EngineOverlapNs;
|
|
74
|
+
tools: EngineOverlapNs;
|
|
75
|
+
triggers: EngineOverlapNs;
|
|
76
|
+
ui: EngineOverlapNs;
|
|
77
|
+
upgrades: EngineOverlapNs;
|
|
78
|
+
utils: EngineOverlapNs;
|
|
79
|
+
workers: EngineOverlapNs;
|
|
80
|
+
world: EngineOverlapNs;
|
|
81
|
+
|
|
82
|
+
// --- Engine-only ---
|
|
83
|
+
augments: typeof import("./api/augments").augments;
|
|
84
|
+
auralite: typeof import("./api/auralite").auralite;
|
|
85
|
+
blueprints: typeof import("./api/blueprints").blueprints;
|
|
86
|
+
clipboard: typeof import("./api/clipboard").clipboard;
|
|
87
|
+
colorPicker: typeof import("./api/colorPicker").colorPicker;
|
|
88
|
+
coloringTool: typeof import("./api/coloringTool").coloringTool;
|
|
89
|
+
conveyors: typeof import("./api/conveyors").conveyors;
|
|
90
|
+
debug: typeof import("./api/debug").debug;
|
|
91
|
+
drones: typeof import("./api/drones").drones;
|
|
92
|
+
entities: typeof import("./api/entities").entities;
|
|
93
|
+
extensions: typeof import("./api/extensions").extensions;
|
|
94
|
+
factory: typeof import("./api/factory").factory;
|
|
95
|
+
foliage: typeof import("./api/foliage").foliage;
|
|
96
|
+
foundationColorPicker: typeof import("./api/foundationColorPicker").foundationColorPicker;
|
|
97
|
+
game: typeof import("./api/game").game;
|
|
98
|
+
heatTransfer: typeof import("./api/heatTransfer").heatTransfer;
|
|
99
|
+
launchers: typeof import("./api/launchers").launchers;
|
|
100
|
+
lightColorPicker: typeof import("./api/lightColorPicker").lightColorPicker;
|
|
101
|
+
matters: typeof import("./api/matters").matters;
|
|
102
|
+
misc: typeof import("./api/misc").misc;
|
|
103
|
+
portals: typeof import("./api/portals").portals;
|
|
104
|
+
prefabData: typeof import("./api/prefabData").prefabData;
|
|
105
|
+
prefabDecor: typeof import("./api/prefabDecor").prefabDecor;
|
|
106
|
+
prefabulator: typeof import("./api/prefabulator").prefabulator;
|
|
107
|
+
prismaline: typeof import("./api/prismaline").prismaline;
|
|
108
|
+
prismite: typeof import("./api/prismite").prismite;
|
|
109
|
+
queue: typeof import("./api/queue").queue;
|
|
110
|
+
shadows: typeof import("./api/shadows").shadows;
|
|
111
|
+
strataform: typeof import("./api/strataform").strataform;
|
|
112
|
+
swarmConsole: typeof import("./api/swarmConsole").swarmConsole;
|
|
113
|
+
sweeperDrone: typeof import("./api/sweeperDrone").sweeperDrone;
|
|
114
|
+
teleportZones: typeof import("./api/teleportZones").teleportZones;
|
|
115
|
+
tutorialBuild: typeof import("./api/tutorialBuild").tutorialBuild;
|
|
116
|
+
usageTracker: typeof import("./api/usageTracker").usageTracker;
|
|
117
|
+
wall: typeof import("./api/wall").wall;
|
|
118
|
+
workerLocal: typeof import("./api/workerLocal").workerLocal;
|
|
119
|
+
config: EngineFn;
|
|
120
|
+
extend: EngineFn;
|
|
121
|
+
retroConsole: RetroConsoleApi;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Host `sandkit.engine` object (main and worker).
|
|
126
|
+
*
|
|
127
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
128
|
+
* At runtime `sandkit.engine.state === sandkit.state`.
|
|
129
|
+
*
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
export interface SandkitEngine {
|
|
133
|
+
api: SandkitEngineApi;
|
|
134
|
+
state: SandkitState;
|
|
135
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.api.retroConsole` — in-world Retro Console game types.
|
|
3
|
+
*
|
|
4
|
+
* **Internal API.** Prefer {@link sandkit.api} when a public method exists.
|
|
5
|
+
* Register games through {@link RetroConsoleApi.registerGame}.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Pixel value for the Retro Console framebuffer. @internal */
|
|
11
|
+
export type RetroConsolePixel = boolean | number;
|
|
12
|
+
|
|
13
|
+
/** Low-resolution display buffer for a Retro Console game. @internal */
|
|
14
|
+
export interface RetroConsoleDisplay {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
/** Clear the framebuffer. Optional fill value defaults to off. */
|
|
18
|
+
clearScreen(value?: RetroConsolePixel): void;
|
|
19
|
+
/** Set one pixel in the framebuffer. */
|
|
20
|
+
drawPixel(x: number, y: number, value: RetroConsolePixel): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Directional input from the Retro Console controls. @internal */
|
|
24
|
+
export interface RetroConsoleInput {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Display size options for a registered Retro Console game. @internal */
|
|
30
|
+
export interface RetroConsoleGameOptions {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Retro Console game definition passed to {@link RetroConsoleApi.registerGame}. @internal */
|
|
36
|
+
export interface RetroConsoleGame<TState = unknown> {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
options?: RetroConsoleGameOptions;
|
|
40
|
+
/** Create initial game state and draw the first frame. */
|
|
41
|
+
init(display: RetroConsoleDisplay): TState;
|
|
42
|
+
/** Advance one frame and return updated game state. */
|
|
43
|
+
update(display: RetroConsoleDisplay, state: TState): TState;
|
|
44
|
+
/** Handle player input when provided. */
|
|
45
|
+
handleInput?(display: RetroConsoleDisplay, state: TState, input: RetroConsoleInput): TState;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** `sandkit.engine.api.retroConsole` registration API. @internal */
|
|
49
|
+
export interface RetroConsoleApi {
|
|
50
|
+
/** Register a Retro Console mini-game. */
|
|
51
|
+
registerGame<TState>(game: RetroConsoleGame<TState>): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sandkit.engine.state` — live game state object.
|
|
3
|
+
*
|
|
4
|
+
* Same object as `sandkit.state` at runtime. **Internal API.** Prefer
|
|
5
|
+
* {@link sandkit.api} when a public method exists. Shapes below are stubs;
|
|
6
|
+
* refine fields as they are confirmed.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Live game state exposed on `sandkit.engine.state`. @internal */
|
|
12
|
+
export type SandkitState = {
|
|
13
|
+
environment: {
|
|
14
|
+
context: number;
|
|
15
|
+
multithreading: unknown;
|
|
16
|
+
readonly [key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
sandkit: {
|
|
19
|
+
events: unknown;
|
|
20
|
+
gameReady: boolean;
|
|
21
|
+
graphics: unknown;
|
|
22
|
+
hooks: unknown;
|
|
23
|
+
keyBindings: unknown;
|
|
24
|
+
mods: unknown;
|
|
25
|
+
registeredLauncherTypes: unknown;
|
|
26
|
+
readonly [key: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
session: unknown;
|
|
29
|
+
shared: unknown;
|
|
30
|
+
store: unknown;
|
|
31
|
+
};
|