@sandustry-modding/types 0.1.0 → 0.3.1
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 +40 -0
- package/LICENSE +21 -0
- package/README.md +28 -18
- package/package.json +62 -11
- package/src/sandkit/api/blueprints.d.ts +33 -0
- package/src/sandkit/api/effects.d.ts +127 -0
- package/src/sandkit/api/elements.d.ts +385 -0
- package/src/sandkit/api/entities.d.ts +79 -0
- package/src/sandkit/api/events.d.ts +137 -0
- package/src/sandkit/api/excavation.d.ts +58 -0
- package/src/sandkit/api/factory.d.ts +38 -0
- package/src/sandkit/api/fire.d.ts +33 -0
- package/src/sandkit/api/game.d.ts +22 -0
- package/src/sandkit/api/grid.d.ts +180 -0
- package/src/sandkit/api/hooks.d.ts +357 -0
- package/{sandkit → src/sandkit}/api/i18n.d.ts +80 -4
- package/{sandkit → src/sandkit}/api/index.d.ts +6 -0
- package/src/sandkit/api/lights.d.ts +101 -0
- package/{sandkit → src/sandkit}/api/maps.d.ts +15 -0
- package/src/sandkit/api/pickups.d.ts +89 -0
- package/src/sandkit/api/pipes.d.ts +54 -0
- package/src/sandkit/api/player.d.ts +141 -0
- package/{sandkit → src/sandkit}/api/rendering.d.ts +8 -0
- package/{sandkit → src/sandkit}/api/sandkit-api.d.ts +19 -2
- package/src/sandkit/api/shared.d.ts +41 -0
- package/{sandkit → src/sandkit}/api/sound.d.ts +32 -2
- package/{sandkit → src/sandkit}/api/structures.d.ts +171 -18
- package/{sandkit → src/sandkit}/api/tech.d.ts +54 -1
- package/src/sandkit/api/terrains.d.ts +147 -0
- package/{sandkit → src/sandkit}/api/upgrades.d.ts +9 -0
- package/{sandkit → src/sandkit}/api/utils.d.ts +19 -2
- package/src/sandkit/api/world.d.ts +105 -0
- package/{sandkit → src/sandkit}/enums/index.d.ts +14 -0
- package/{shared → src/shared}/api/elements.d.ts +84 -12
- package/{shared/api/world.d.ts → src/shared/api/grid.d.ts} +29 -3
- package/{shared → src/shared}/api/player.d.ts +12 -0
- package/{shared → src/shared}/api/shared.d.ts +5 -3
- package/{shared → src/shared}/api/structures.d.ts +46 -0
- package/src/shared/api/terrains.d.ts +231 -0
- package/src/shared/api/world.d.ts +43 -0
- package/{shared → src/shared}/index.d.ts +2 -0
- package/src/worker/api/effects.d.ts +52 -0
- package/src/worker/api/elements.d.ts +266 -0
- package/src/worker/api/events.d.ts +75 -0
- package/src/worker/api/fire.d.ts +29 -0
- package/src/worker/api/grid.d.ts +45 -0
- package/src/worker/api/hooks.d.ts +111 -0
- package/src/worker/api/lights.d.ts +43 -0
- package/{worker → src/worker}/api/shared.d.ts +8 -3
- package/{worker → src/worker}/index.d.ts +8 -5
- package/{worker → src/worker}/sandkit-api.d.ts +12 -3
- package/sandkit/api/effects.d.ts +0 -76
- package/sandkit/api/elements.d.ts +0 -237
- package/sandkit/api/events.d.ts +0 -53
- package/sandkit/api/excavation.d.ts +0 -34
- package/sandkit/api/fire.d.ts +0 -26
- package/sandkit/api/grid.d.ts +0 -26
- package/sandkit/api/hooks.d.ts +0 -52
- package/sandkit/api/lights.d.ts +0 -66
- package/sandkit/api/player.d.ts +0 -84
- package/sandkit/api/shared.d.ts +0 -27
- package/sandkit/api/terrains.d.ts +0 -125
- package/sandkit/api/world.d.ts +0 -107
- package/shared/api/terrains.d.ts +0 -100
- package/worker/api/elements.d.ts +0 -60
- /package/{global.d.ts → src/global.d.ts} +0 -0
- /package/{sandkit → src/sandkit}/api/action.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/assets.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/authorization.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/building.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/camera.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/collector.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/constants.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/cooldown.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/discoveries.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/energy.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/gameconfig.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/input.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/items.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/mods.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/patterns.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/processing.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/progression.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/projectiles.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/random.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/raycast.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/reactions.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/resources.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/scene.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/schedule.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/settings.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/signals.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/sprites.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/storage.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/structureBehaviors.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/time.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/tools.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/triggers.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/ui.d.ts +0 -0
- /package/{sandkit → src/sandkit}/api/workers.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/augments.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/auralite.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/blueprints.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/clipboard.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/colorPicker.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/coloringTool.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/conveyors.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/debug.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/drones.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/entities.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/extensions.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/factory.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/foliage.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/foundationColorPicker.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/game.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/heatTransfer.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/index.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/launchers.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/lightColorPicker.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/matters.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/misc.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/portals.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/prefabData.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/prefabDecor.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/prefabulator.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/prismaline.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/prismite.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/queue.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/shadows.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/strataform.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/swarmConsole.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/sweeperDrone.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/teleportZones.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/tutorialBuild.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/usageTracker.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/wall.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/api/workerLocal.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/index.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/retro-console.d.ts +0 -0
- /package/{sandkit → src/sandkit}/engine/state.d.ts +0 -0
- /package/{sandkit → src/sandkit}/index.d.ts +0 -0
- /package/{sandkit → src/sandkit}/react.d.ts +0 -0
- /package/{shared → src/shared}/api/effects.d.ts +0 -0
- /package/{shared → src/shared}/api/maps.d.ts +0 -0
- /package/{shared → src/shared}/api/ui.d.ts +0 -0
- /package/{shared → src/shared}/asset.d.ts +0 -0
- /package/{shared → src/shared}/engine.d.ts +0 -0
- /package/{shared → src/shared}/jsonvalue.d.ts +0 -0
- /package/{shared → src/shared}/nominal.d.ts +0 -0
- /package/{shared → src/shared}/player.d.ts +0 -0
- /package/{worker → src/worker}/api/main.d.ts +0 -0
- /package/{worker → src/worker}/api/worker.d.ts +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import type { CellCoordinates, Vector2 } from "../../shared/player";
|
|
2
|
+
import { shared } from "../../shared";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Worker-thread `sandkit.api.elements` — shared reads plus immediate grid mutations.
|
|
6
|
+
*
|
|
7
|
+
* Worker-entry mutations apply immediately. Main thread defers matching helpers in
|
|
8
|
+
* `sandkit.api.elements`.
|
|
9
|
+
*
|
|
10
|
+
* @internal Worker extension; not interchangeable with main-thread
|
|
11
|
+
* `sandkit.api.elements`.
|
|
12
|
+
*
|
|
13
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements`
|
|
14
|
+
*/
|
|
15
|
+
export namespace elements {
|
|
16
|
+
/** Numeric id for a registered element type. */
|
|
17
|
+
export import ElementType = shared.api.elements.ElementType;
|
|
18
|
+
/** Mod or built-in element string id. */
|
|
19
|
+
export import ElementId = shared.api.elements.ElementId;
|
|
20
|
+
/** Type handle or string id accepted by lookup helpers. */
|
|
21
|
+
export import ElementRef = shared.api.elements.ElementRef;
|
|
22
|
+
/** Matter category for element physics behavior. */
|
|
23
|
+
export import MatterType = shared.api.elements.MatterType;
|
|
24
|
+
/** Full definition used to register a custom element. */
|
|
25
|
+
export import ElementDefinition = shared.api.elements.ElementDefinition;
|
|
26
|
+
/** Options for {@link createAtCell} and replace helpers. */
|
|
27
|
+
export import ElementCreateOptions = shared.api.elements.ElementCreateOptions;
|
|
28
|
+
/** Options for {@link removeAtCell}. */
|
|
29
|
+
export import ElementRemovalOptions = shared.api.elements.ElementRemovalOptions;
|
|
30
|
+
|
|
31
|
+
/** Returns the mod string id for a numeric element type. */
|
|
32
|
+
export import getIdByType = shared.api.elements.getIdByType;
|
|
33
|
+
/** Resolves a string element id to its numeric type. */
|
|
34
|
+
export import getTypeById = shared.api.elements.getTypeById;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use {@link getTypeById} instead.
|
|
37
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.elements.getTypeById`
|
|
38
|
+
*/
|
|
39
|
+
export import getTypeFromId = shared.api.elements.getTypeFromId;
|
|
40
|
+
/** Returns the definition for an element type. */
|
|
41
|
+
export import getDefinitionByType = shared.api.elements.getDefinitionByType;
|
|
42
|
+
/** Returns the element type at a cell, or null. */
|
|
43
|
+
export import getTypeAtCell = shared.api.elements.getTypeAtCell;
|
|
44
|
+
/** Returns the resolved element type at a cell, or null. */
|
|
45
|
+
export import getResolvedTypeAtCell = shared.api.elements.getResolvedTypeAtCell;
|
|
46
|
+
/** Returns the resolved element type from a cell id, or null. */
|
|
47
|
+
export import getResolvedTypeFromCellId = shared.api.elements.getResolvedTypeFromCellId;
|
|
48
|
+
/** Returns element info at a cell, or null. */
|
|
49
|
+
export import getInfoAtCell = shared.api.elements.getInfoAtCell;
|
|
50
|
+
/** Returns the matter type at a cell, or null. */
|
|
51
|
+
export import getMatterTypeAtCell = shared.api.elements.getMatterTypeAtCell;
|
|
52
|
+
/** Returns true when the cell contains the given element type or id. */
|
|
53
|
+
export import isTypeAtCell = shared.api.elements.isTypeAtCell;
|
|
54
|
+
/** Returns true when the element at the cell is free-falling. */
|
|
55
|
+
export import isFreeFallingAtCell = shared.api.elements.isFreeFallingAtCell;
|
|
56
|
+
/** Returns particle velocity at a cell, or null. */
|
|
57
|
+
export import getVelocityAtCell = shared.api.elements.getVelocityAtCell;
|
|
58
|
+
/** Returns a data field value at a cell, or null. */
|
|
59
|
+
export import getDataFieldAtCell = shared.api.elements.getDataFieldAtCell;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Create an element at a cell immediately on this worker.
|
|
63
|
+
*
|
|
64
|
+
* @param cellX - Grid column of the target cell.
|
|
65
|
+
* @param cellY - Grid row of the target cell.
|
|
66
|
+
* @param elementTypeOrId - Numeric type or string id.
|
|
67
|
+
* @param options - Optional spawn overrides.
|
|
68
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.createAtCell`
|
|
69
|
+
*/
|
|
70
|
+
export function createAtCell(
|
|
71
|
+
...args: [...CellCoordinates, elementTypeOrId: ElementRef, options?: ElementCreateOptions]
|
|
72
|
+
): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Replace the element at a cell immediately on this worker.
|
|
76
|
+
*
|
|
77
|
+
* @param cellX - Grid column of the target cell.
|
|
78
|
+
* @param cellY - Grid row of the target cell.
|
|
79
|
+
* @param elementTypeOrId - Numeric type or string id.
|
|
80
|
+
* @param options - Optional spawn overrides.
|
|
81
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.replaceAtCell`
|
|
82
|
+
*/
|
|
83
|
+
export function replaceAtCell(
|
|
84
|
+
...args: [...CellCoordinates, elementTypeOrId: ElementRef, options?: ElementCreateOptions]
|
|
85
|
+
): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Remove the element at a cell immediately on this worker.
|
|
89
|
+
*
|
|
90
|
+
* @param cellX - Grid column of the target cell.
|
|
91
|
+
* @param cellY - Grid row of the target cell.
|
|
92
|
+
* @param options - Optional removal flags.
|
|
93
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.removeAtCell`
|
|
94
|
+
*/
|
|
95
|
+
export function removeAtCell(
|
|
96
|
+
...args: [...CellCoordinates, options?: ElementRemovalOptions]
|
|
97
|
+
): void;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Move an element between cells immediately on this worker.
|
|
101
|
+
*
|
|
102
|
+
* @param fromCellX - Source cell column.
|
|
103
|
+
* @param fromCellY - Source cell row.
|
|
104
|
+
* @param toCellX - Destination cell column.
|
|
105
|
+
* @param toCellY - Destination cell row.
|
|
106
|
+
* @returns True when the move succeeded.
|
|
107
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.moveBetweenCells`
|
|
108
|
+
*/
|
|
109
|
+
export function moveBetweenCells(
|
|
110
|
+
fromCellX: number,
|
|
111
|
+
fromCellY: number,
|
|
112
|
+
toCellX: number,
|
|
113
|
+
toCellY: number
|
|
114
|
+
): boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Teleport an element between cells immediately on this worker.
|
|
118
|
+
*
|
|
119
|
+
* @param fromCellX - Source cell column.
|
|
120
|
+
* @param fromCellY - Source cell row.
|
|
121
|
+
* @param toCellX - Destination cell column.
|
|
122
|
+
* @param toCellY - Destination cell row.
|
|
123
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.teleportBetweenCells`
|
|
124
|
+
*/
|
|
125
|
+
export function teleportBetweenCells(
|
|
126
|
+
fromCellX: number,
|
|
127
|
+
fromCellY: number,
|
|
128
|
+
toCellX: number,
|
|
129
|
+
toCellY: number
|
|
130
|
+
): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Swap elements between two cells immediately on this worker.
|
|
134
|
+
*
|
|
135
|
+
* @param firstCellX - First cell column.
|
|
136
|
+
* @param firstCellY - First cell row.
|
|
137
|
+
* @param secondCellX - Second cell column.
|
|
138
|
+
* @param secondCellY - Second cell row.
|
|
139
|
+
* @returns True when the swap succeeded.
|
|
140
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.swapBetweenCells`
|
|
141
|
+
*/
|
|
142
|
+
export function swapBetweenCells(
|
|
143
|
+
firstCellX: number,
|
|
144
|
+
firstCellY: number,
|
|
145
|
+
secondCellX: number,
|
|
146
|
+
secondCellY: number
|
|
147
|
+
): boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @deprecated Use {@link swapBetweenCells} instead.
|
|
151
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.elements.swapBetweenCells`
|
|
152
|
+
*/
|
|
153
|
+
export function swapCells(
|
|
154
|
+
firstCellX: number,
|
|
155
|
+
firstCellY: number,
|
|
156
|
+
secondCellX: number,
|
|
157
|
+
secondCellY: number
|
|
158
|
+
): boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Mark an element index as movement-blocked for this tick.
|
|
162
|
+
*
|
|
163
|
+
* @param elementIndex - Element index from {@link getInfoAtCell}.
|
|
164
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.elements.markMovementBlockedByIndex`
|
|
165
|
+
*/
|
|
166
|
+
export function markMovementBlockedByIndex(elementIndex: number): void;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated Use {@link markMovementBlockedByIndex} instead.
|
|
170
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.elements.markMovementBlockedByIndex`
|
|
171
|
+
*/
|
|
172
|
+
export function markMovementBlockedByElementIndex(elementIndex: number): void;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Set particle velocity at a cell immediately on this worker.
|
|
176
|
+
*
|
|
177
|
+
* @param cellX - Grid column of the target cell.
|
|
178
|
+
* @param cellY - Grid row of the target cell.
|
|
179
|
+
* @param velocity - New velocity vector.
|
|
180
|
+
* @returns True when velocity was set.
|
|
181
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.setVelocityAtCell`
|
|
182
|
+
*/
|
|
183
|
+
export function setVelocityAtCell(...args: [...CellCoordinates, velocity: Vector2]): boolean;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Add velocity to a particle at a cell immediately on this worker.
|
|
187
|
+
*
|
|
188
|
+
* @param cellX - Grid column of the target cell.
|
|
189
|
+
* @param cellY - Grid row of the target cell.
|
|
190
|
+
* @param velocity - Velocity delta to add.
|
|
191
|
+
* @param maxSpeedCellsPerSecond - Optional speed cap after the addition.
|
|
192
|
+
* @returns True when velocity was updated.
|
|
193
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.addParticleVelocityAtCell`
|
|
194
|
+
*/
|
|
195
|
+
export function addParticleVelocityAtCell(
|
|
196
|
+
...args: [...CellCoordinates, velocity: Vector2, maxSpeedCellsPerSecond?: number]
|
|
197
|
+
): boolean;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Convert a cell element to a particle immediately on this worker.
|
|
201
|
+
*
|
|
202
|
+
* @param cellX - Grid column of the target cell.
|
|
203
|
+
* @param cellY - Grid row of the target cell.
|
|
204
|
+
* @param velocity - Initial particle velocity.
|
|
205
|
+
* @returns True when conversion succeeded.
|
|
206
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.convertToParticleAtCell`
|
|
207
|
+
*/
|
|
208
|
+
export function convertToParticleAtCell(...args: [...CellCoordinates, velocity: Vector2]): boolean;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Convert a particle back to a solid element immediately on this worker.
|
|
212
|
+
*
|
|
213
|
+
* @param cellX - Grid column of the target cell.
|
|
214
|
+
* @param cellY - Grid row of the target cell.
|
|
215
|
+
* @returns True when conversion succeeded.
|
|
216
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.convertFromParticleAtCell`
|
|
217
|
+
*/
|
|
218
|
+
export function convertFromParticleAtCell(...args: CellCoordinates): boolean;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Set a data field on the element at a cell immediately on this worker.
|
|
222
|
+
*
|
|
223
|
+
* @param cellX - Grid column of the target cell.
|
|
224
|
+
* @param cellY - Grid row of the target cell.
|
|
225
|
+
* @param fieldNumber - Data field index (1–4).
|
|
226
|
+
* @param value - New field value.
|
|
227
|
+
* @returns True when the field was set.
|
|
228
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.setDataFieldAtCell`
|
|
229
|
+
*/
|
|
230
|
+
export function setDataFieldAtCell(
|
|
231
|
+
...args: [...CellCoordinates, fieldNumber: 1 | 2 | 3 | 4, value: number]
|
|
232
|
+
): boolean;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Refresh the rendered color at a cell immediately on this worker.
|
|
236
|
+
*
|
|
237
|
+
* @param cellX - Grid column of the target cell.
|
|
238
|
+
* @param cellY - Grid row of the target cell.
|
|
239
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.refreshColorAtCell`
|
|
240
|
+
*/
|
|
241
|
+
export function refreshColorAtCell(...args: CellCoordinates): void;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Set the physics skip mode at a cell immediately on this worker.
|
|
245
|
+
*
|
|
246
|
+
* @param cellX - Grid column of the target cell.
|
|
247
|
+
* @param cellY - Grid row of the target cell.
|
|
248
|
+
* @param physicsState - Physics skip flags for the element.
|
|
249
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.setPhysicsAtCell`
|
|
250
|
+
*/
|
|
251
|
+
export function setPhysicsAtCell(...args: [...CellCoordinates, physicsState: number]): void;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Set element duration at a cell immediately on this worker.
|
|
255
|
+
*
|
|
256
|
+
* @param cellX - Grid column of the target cell.
|
|
257
|
+
* @param cellY - Grid row of the target cell.
|
|
258
|
+
* @param durationTicks - Duration in simulation ticks.
|
|
259
|
+
* @param options - When `updateMax` is true, also update max duration.
|
|
260
|
+
* @returns True when duration was updated.
|
|
261
|
+
* @see https://sandustry.com/sandkit.html#mutations-heading Official Sandkit API — Worker entry `api.elements.setDurationAtCell`
|
|
262
|
+
*/
|
|
263
|
+
export function setDurationAtCell(
|
|
264
|
+
...args: [...CellCoordinates, durationTicks: number, options?: { updateMax?: boolean; }]
|
|
265
|
+
): boolean;
|
|
266
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { elements as sharedElements } from "../../shared/api/elements";
|
|
2
|
+
import type { LooseString } from "../../shared/nominal";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Worker-thread `sandkit.api.events` — subscribe to and emit worker-scoped events.
|
|
6
|
+
*
|
|
7
|
+
* @internal Worker-only surface; do not use main-thread {@link sandkit.api.events}.
|
|
8
|
+
*/
|
|
9
|
+
export namespace events {
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to a worker event. Returns an unsubscribe function.
|
|
12
|
+
*
|
|
13
|
+
* @param eventId - Registered event name.
|
|
14
|
+
* @param callback - Called when the event is emitted.
|
|
15
|
+
* @param options - Required guard for filtered events.
|
|
16
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.events.on`
|
|
17
|
+
*/
|
|
18
|
+
export function on<K extends EventId>(
|
|
19
|
+
eventId: K,
|
|
20
|
+
callback: (payload: EventPayload<K>) => void,
|
|
21
|
+
options?: EventOnOptions<K>,
|
|
22
|
+
): () => void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Emit a worker event with a payload to subscribers.
|
|
26
|
+
*
|
|
27
|
+
* @param eventId - Registered event name.
|
|
28
|
+
* @param payload - Serializable payload passed to listeners.
|
|
29
|
+
* @param options - Optional guard forwarded to filtered listeners.
|
|
30
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.events.emit`
|
|
31
|
+
*/
|
|
32
|
+
export function emit<K extends EventId>(
|
|
33
|
+
eventId: K,
|
|
34
|
+
payload: EventPayload<K>,
|
|
35
|
+
options?: EventEmitOptions,
|
|
36
|
+
): void;
|
|
37
|
+
|
|
38
|
+
/** Guard filter for worker events. */
|
|
39
|
+
export interface EventGuard {
|
|
40
|
+
/** Required when subscribing to `element:moved`. Optional on emit. */
|
|
41
|
+
elementType?: sharedElements.ElementType;
|
|
42
|
+
/** Required when subscribing to `terrain:updated`. Optional on emit. */
|
|
43
|
+
terrainType?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Options for {@link on}. */
|
|
47
|
+
export type EventOnOptions<K extends EventId> =
|
|
48
|
+
K extends "element:moved"
|
|
49
|
+
? { guard: { elementType: sharedElements.ElementType } }
|
|
50
|
+
: K extends "terrain:updated" | "terrain:update"
|
|
51
|
+
? { guard: { terrainType: number } }
|
|
52
|
+
: { guard?: EventGuard };
|
|
53
|
+
|
|
54
|
+
/** Options for {@link emit}. */
|
|
55
|
+
export interface EventEmitOptions {
|
|
56
|
+
guard?: EventGuard;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Known worker event payloads. Unlisted ids still use `unknown`. */
|
|
60
|
+
export interface EventPayloadMap {
|
|
61
|
+
"element:moved": Record<string, unknown>;
|
|
62
|
+
"terrain:updated": Record<string, unknown>;
|
|
63
|
+
/** @deprecated Use `"terrain:updated"` instead. */
|
|
64
|
+
"terrain:update": EventPayloadMap["terrain:updated"];
|
|
65
|
+
"worker:update:post": Record<string, unknown>;
|
|
66
|
+
/** @deprecated Use `"worker:update:post"` instead. */
|
|
67
|
+
"update:post": EventPayloadMap["worker:update:post"];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Known worker event names plus any custom string id. */
|
|
71
|
+
export type EventId = LooseString<keyof EventPayloadMap>;
|
|
72
|
+
|
|
73
|
+
/** Event payload type for a given event id. */
|
|
74
|
+
export type EventPayload<K> = K extends keyof EventPayloadMap ? EventPayloadMap[K] : unknown;
|
|
75
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CellCoordinates } from "../../shared/player";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Worker-thread `sandkit.api.fire` — ignite and burn elements at grid cells.
|
|
5
|
+
*
|
|
6
|
+
* Worker burns are immediate. Main thread defers burns with `burnElementAtCell`.
|
|
7
|
+
*
|
|
8
|
+
* @internal Worker-only surface; do not use main-thread {@link sandkit.api.fire}.
|
|
9
|
+
*/
|
|
10
|
+
export namespace fire {
|
|
11
|
+
/**
|
|
12
|
+
* Return true when the element at the cell can burn.
|
|
13
|
+
*
|
|
14
|
+
* @param cellX - Grid column of the target cell.
|
|
15
|
+
* @param cellY - Grid row of the target cell.
|
|
16
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.fire.canBurnElementAtCell`
|
|
17
|
+
*/
|
|
18
|
+
export function canBurnElementAtCell(...args: CellCoordinates): boolean;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Burn the element at the cell immediately on this worker.
|
|
22
|
+
*
|
|
23
|
+
* @param cellX - Grid column of the target cell.
|
|
24
|
+
* @param cellY - Grid row of the target cell.
|
|
25
|
+
* @returns True when the burn succeeded.
|
|
26
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.fire.burnElementAtCell`
|
|
27
|
+
*/
|
|
28
|
+
export function burnElementAtCell(...args: CellCoordinates): boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { grid as sharedGrid } from "../../shared/api/grid";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Worker-thread `sandkit.api.grid` — grid reads, activity, and excavation.
|
|
5
|
+
*
|
|
6
|
+
* Worker mutations are immediate. Main thread defers grid writes through `api.grid.mutate`.
|
|
7
|
+
*
|
|
8
|
+
* @internal Worker subset; do not import main-thread {@link sandkit.api.grid} iteration helpers here.
|
|
9
|
+
*/
|
|
10
|
+
export namespace grid {
|
|
11
|
+
/** Return the packed cell id at grid coordinates. */
|
|
12
|
+
export import getCellIdAtCell = sharedGrid.getCellIdAtCell;
|
|
13
|
+
/** Return true when the cell has no element or terrain content. */
|
|
14
|
+
export import isCellEmptyAtCell = sharedGrid.isCellEmptyAtCell;
|
|
15
|
+
/** Return true when the cell holds terrain (not an element). */
|
|
16
|
+
export import isTerrainAtCell = sharedGrid.isTerrainAtCell;
|
|
17
|
+
/** Mark the cell active for simulation this tick. */
|
|
18
|
+
export import reportActivityAtCell = sharedGrid.reportActivityAtCell;
|
|
19
|
+
/** Apply excavation damage and eject velocity at a cell. */
|
|
20
|
+
export import excavateAtCell = sharedGrid.excavateAtCell;
|
|
21
|
+
/** Return the world grid size in cells. */
|
|
22
|
+
export import getDimensions = sharedGrid.getDimensions;
|
|
23
|
+
/** Options for {@link excavateAtCell}. */
|
|
24
|
+
export import ExcavateOptions = sharedGrid.ExcavateOptions;
|
|
25
|
+
/** Packed cell id from {@link getCellIdAtCell}. */
|
|
26
|
+
export import CellId = sharedGrid.CellId;
|
|
27
|
+
/** World grid width and height in cells. */
|
|
28
|
+
export import GridDimensions = sharedGrid.GridDimensions;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use {@link grid} instead.
|
|
33
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.grid`
|
|
34
|
+
*/
|
|
35
|
+
export namespace world {
|
|
36
|
+
export import getCellIdAtCell = grid.getCellIdAtCell;
|
|
37
|
+
export import isCellEmptyAtCell = grid.isCellEmptyAtCell;
|
|
38
|
+
export import isTerrainAtCell = grid.isTerrainAtCell;
|
|
39
|
+
export import reportActivityAtCell = grid.reportActivityAtCell;
|
|
40
|
+
export import excavateAtCell = grid.excavateAtCell;
|
|
41
|
+
export import getDimensions = grid.getDimensions;
|
|
42
|
+
export import ExcavateOptions = grid.ExcavateOptions;
|
|
43
|
+
export import CellId = grid.CellId;
|
|
44
|
+
export import GridDimensions = grid.GridDimensions;
|
|
45
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { elements as sharedElements } from "../../shared/api/elements";
|
|
2
|
+
import type { LooseString } from "../../shared/nominal";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Worker-thread `sandkit.api.hooks` — intercept and modify simulation hook points.
|
|
6
|
+
*
|
|
7
|
+
* @internal Worker-only surface; do not use main-thread {@link sandkit.api.hooks}.
|
|
8
|
+
*/
|
|
9
|
+
export namespace hooks {
|
|
10
|
+
/**
|
|
11
|
+
* Register an intercept hook on this worker. Returns an unsubscribe function.
|
|
12
|
+
*
|
|
13
|
+
* @param hookId - Registered hook identifier.
|
|
14
|
+
* @param callback - Called with hook arguments and context; may cancel the hook.
|
|
15
|
+
* @param options - Optional guard and priority.
|
|
16
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.hooks.intercept`
|
|
17
|
+
*/
|
|
18
|
+
export function intercept<K extends InterceptHookId>(
|
|
19
|
+
hookId: K,
|
|
20
|
+
callback: (args: InterceptHookArgs<K>, context: HookContext) => void,
|
|
21
|
+
options?: InterceptHookOptions<K>,
|
|
22
|
+
): () => void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Register a modifier hook on this worker. Returns an unsubscribe function.
|
|
26
|
+
*
|
|
27
|
+
* @param hookId - Registered hook identifier.
|
|
28
|
+
* @param callback - Called with hook arguments; may mutate hook payload.
|
|
29
|
+
* @param options - Optional guard and priority.
|
|
30
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.hooks.modify`
|
|
31
|
+
*/
|
|
32
|
+
export function modify<K extends ModifyHookId>(
|
|
33
|
+
hookId: K,
|
|
34
|
+
callback: (args: ModifyHookArgs<K>) => void,
|
|
35
|
+
options?: ModifyHookOptions,
|
|
36
|
+
): () => void;
|
|
37
|
+
|
|
38
|
+
/** Context passed to intercept hook callbacks. */
|
|
39
|
+
export interface HookContext {
|
|
40
|
+
/** When called, the intercepted action is skipped. */
|
|
41
|
+
cancel(): void;
|
|
42
|
+
/** True after {@link cancel} was called on this context. */
|
|
43
|
+
cancelled: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Guard filter for worker hook registration. */
|
|
47
|
+
export interface HookGuard {
|
|
48
|
+
/** Required for element-scoped intercept hooks and optional on emit. */
|
|
49
|
+
elementType?: sharedElements.ElementType;
|
|
50
|
+
/** Required for terrain-scoped event guards; optional on emit. */
|
|
51
|
+
terrainType?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Options for {@link intercept}. */
|
|
55
|
+
export type InterceptHookOptions<K extends InterceptHookId> =
|
|
56
|
+
K extends ElementGuardedInterceptHookId
|
|
57
|
+
? { guard: { elementType: sharedElements.ElementType }; priority?: number }
|
|
58
|
+
: { guard?: HookGuard; priority?: number };
|
|
59
|
+
|
|
60
|
+
/** Options for {@link modify}. */
|
|
61
|
+
export interface ModifyHookOptions {
|
|
62
|
+
guard?: HookGuard;
|
|
63
|
+
priority?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Intercept hook ids with a required element guard. */
|
|
67
|
+
export type ElementGuardedInterceptHookId =
|
|
68
|
+
| "cell:process"
|
|
69
|
+
| "element:update"
|
|
70
|
+
| "element:move:blocked"
|
|
71
|
+
| "element:blocked"
|
|
72
|
+
| "element:duration:expire"
|
|
73
|
+
| "element:duration";
|
|
74
|
+
|
|
75
|
+
/** Known worker intercept hook ids plus custom strings. */
|
|
76
|
+
export type InterceptHookId = LooseString<
|
|
77
|
+
| ElementGuardedInterceptHookId
|
|
78
|
+
| "element:move"
|
|
79
|
+
| "fire:element:burn"
|
|
80
|
+
| "shaker:elementOn"
|
|
81
|
+
>;
|
|
82
|
+
|
|
83
|
+
/** Known worker modify hook ids plus custom strings. */
|
|
84
|
+
export type ModifyHookId = LooseString<string>;
|
|
85
|
+
|
|
86
|
+
/** Intercept hook argument shapes keyed by hook id. */
|
|
87
|
+
export interface InterceptHookMap {
|
|
88
|
+
"cell:process": Record<string, unknown>;
|
|
89
|
+
"element:update": Record<string, unknown>;
|
|
90
|
+
"element:move": Record<string, unknown>;
|
|
91
|
+
"element:move:blocked": Record<string, unknown>;
|
|
92
|
+
/** @deprecated Use `"element:move:blocked"` instead. */
|
|
93
|
+
"element:blocked": InterceptHookMap["element:move:blocked"];
|
|
94
|
+
"element:duration:expire": Record<string, unknown>;
|
|
95
|
+
/** @deprecated Use `"element:duration:expire"` instead. */
|
|
96
|
+
"element:duration": InterceptHookMap["element:duration:expire"];
|
|
97
|
+
"fire:element:burn": Record<string, unknown>;
|
|
98
|
+
"shaker:elementOn": Record<string, unknown>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Modify hook argument shapes keyed by hook id. Unlisted ids use `unknown`. */
|
|
102
|
+
export type ModifyHookMap = Record<string, unknown>;
|
|
103
|
+
|
|
104
|
+
/** Intercept hook args for a given hook id. */
|
|
105
|
+
export type InterceptHookArgs<K extends InterceptHookId> =
|
|
106
|
+
K extends keyof InterceptHookMap ? InterceptHookMap[K] : unknown;
|
|
107
|
+
|
|
108
|
+
/** Modify hook args for a given hook id. */
|
|
109
|
+
export type ModifyHookArgs<K extends ModifyHookId> =
|
|
110
|
+
K extends keyof ModifyHookMap ? ModifyHookMap[K] : unknown;
|
|
111
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { shared } from "../../shared";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Worker-thread `sandkit.api.lights` — temporary visual effect lights.
|
|
5
|
+
*
|
|
6
|
+
* @internal Worker exposes only {@link temporary}; persistent lights are main-thread only.
|
|
7
|
+
*/
|
|
8
|
+
export namespace lights {
|
|
9
|
+
/**
|
|
10
|
+
* Short-lived visual effect lights.
|
|
11
|
+
*
|
|
12
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.lights.temporary`
|
|
13
|
+
*/
|
|
14
|
+
export namespace temporary {
|
|
15
|
+
/** Options for {@link createAtWorld}. */
|
|
16
|
+
export type TemporaryLightOptions = shared.api.effects.TemporaryLightOptions;
|
|
17
|
+
|
|
18
|
+
/** Handle returned by {@link createAtWorld}. */
|
|
19
|
+
export interface TemporaryLightHandle {
|
|
20
|
+
/** Runtime light id, or null when the pool is full. */
|
|
21
|
+
lightId: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use {@link lightId} instead.
|
|
24
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `light.lightId`
|
|
25
|
+
*/
|
|
26
|
+
index?: number | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a temporary light at world coordinates.
|
|
31
|
+
*
|
|
32
|
+
* @param worldX - World x position in pixels.
|
|
33
|
+
* @param worldY - World y position in pixels.
|
|
34
|
+
* @param options - Brightness, duration, colour, and dedup settings.
|
|
35
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.lights.temporary.createAtWorld`
|
|
36
|
+
*/
|
|
37
|
+
export function createAtWorld(
|
|
38
|
+
worldX: number,
|
|
39
|
+
worldY: number,
|
|
40
|
+
options?: TemporaryLightOptions,
|
|
41
|
+
): TemporaryLightHandle;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -23,16 +23,21 @@ export namespace shared {
|
|
|
23
23
|
*
|
|
24
24
|
* @param key - Buffer name shared across threads.
|
|
25
25
|
* @param config - Expected array type and length for validation.
|
|
26
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.shared.buffers.require`
|
|
26
27
|
*/
|
|
27
28
|
export function require(key: string, config: { type: SharedArrayType; length: number; }): SharedArray;
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
31
|
* Read an existing buffer without validating type or length.
|
|
32
|
+
*
|
|
30
33
|
* @param key - Buffer name shared across threads.
|
|
34
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — Worker entry `api.shared.buffers.get`
|
|
31
35
|
*/
|
|
32
|
-
export import get = sharedApi.api.shared.buffers.get
|
|
36
|
+
export import get = sharedApi.api.shared.buffers.get;
|
|
33
37
|
}
|
|
38
|
+
|
|
34
39
|
/** Typed array backing store for a shared buffer. */
|
|
35
|
-
export import SharedArray = sharedApi.api.shared.SharedArray
|
|
40
|
+
export import SharedArray = sharedApi.api.shared.SharedArray;
|
|
36
41
|
/** Discriminator for the underlying typed array kind. */
|
|
37
|
-
export import SharedArrayType = sharedApi.api.shared.SharedArrayType
|
|
42
|
+
export import SharedArrayType = sharedApi.api.shared.SharedArrayType;
|
|
38
43
|
}
|
|
@@ -11,19 +11,22 @@ export * from "./api/main"
|
|
|
11
11
|
export * from "./api/shared"
|
|
12
12
|
export * from "./api/worker"
|
|
13
13
|
export * from "./api/elements"
|
|
14
|
+
export * from "./api/hooks"
|
|
15
|
+
export * from "./api/events"
|
|
16
|
+
export * from "./api/effects"
|
|
17
|
+
export * from "./api/fire"
|
|
18
|
+
export * from "./api/grid"
|
|
19
|
+
export * from "./api/lights"
|
|
14
20
|
|
|
15
|
-
// Shared files
|
|
16
21
|
export * from "../sandkit/api/collector"
|
|
17
|
-
export * from "../sandkit/api/
|
|
18
|
-
export * from "../sandkit/api/hooks"
|
|
19
|
-
export * from "../shared/api/maps"
|
|
22
|
+
export * from "../sandkit/api/constants"
|
|
20
23
|
export * from "../sandkit/api/patterns"
|
|
24
|
+
export * from "../shared/api/maps"
|
|
21
25
|
export * from "../shared/api/player"
|
|
22
26
|
export * from "../sandkit/api/random"
|
|
23
27
|
export * from "../shared/api/structures"
|
|
24
28
|
export * from "../shared/api/terrains"
|
|
25
29
|
export * from "../shared/api/ui"
|
|
26
30
|
export * from "../sandkit/api/utils"
|
|
27
|
-
export * from "../shared/api/world"
|
|
28
31
|
|
|
29
32
|
export type { WorkerSandkitApi } from "./sandkit-api"
|
|
@@ -12,10 +12,15 @@
|
|
|
12
12
|
* {@link sandkit.SandkitApi} on worker threads.
|
|
13
13
|
*/
|
|
14
14
|
export type WorkerSandkitApi = {
|
|
15
|
+
constants: typeof import("../sandkit/api/constants").constants;
|
|
15
16
|
collector: typeof import("../sandkit/api/collector").collector;
|
|
17
|
+
effects: typeof import("./api/effects").effects;
|
|
16
18
|
elements: typeof import("./api/elements").elements;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
events: typeof import("./api/events").events;
|
|
20
|
+
fire: typeof import("./api/fire").fire;
|
|
21
|
+
grid: typeof import("./api/grid").grid;
|
|
22
|
+
hooks: typeof import("./api/hooks").hooks;
|
|
23
|
+
lights: typeof import("./api/lights").lights;
|
|
19
24
|
main: typeof import("./api/main").main;
|
|
20
25
|
maps: typeof import("../shared/api/maps").maps;
|
|
21
26
|
patterns: typeof import("../sandkit/api/patterns").patterns;
|
|
@@ -27,5 +32,9 @@ export type WorkerSandkitApi = {
|
|
|
27
32
|
ui: typeof import("../shared/api/ui").ui;
|
|
28
33
|
utils: typeof import("../sandkit/api/utils").utils;
|
|
29
34
|
worker: typeof import("./api/worker").worker;
|
|
30
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use {@link grid} instead.
|
|
37
|
+
* @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.grid`
|
|
38
|
+
*/
|
|
39
|
+
world: typeof import("./api/grid").world;
|
|
31
40
|
};
|