@sandustry-modding/types 0.3.0 → 0.4.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 +88 -0
- package/LICENSE +21 -0
- package/README.md +8 -19
- package/package.json +65 -5
- package/src/configs/index.d.ts +38 -0
- package/src/configs/modinfo.d.ts +751 -0
- package/src/configs/patches.d.ts +195 -0
- package/src/sandkit/api/action.d.ts +5 -0
- package/src/sandkit/api/blueprints.d.ts +5 -3
- package/src/sandkit/api/camera.d.ts +5 -0
- package/src/sandkit/api/effects.d.ts +28 -7
- package/src/sandkit/api/elements.d.ts +124 -39
- package/src/sandkit/api/energy.d.ts +8 -0
- package/src/sandkit/api/entities.d.ts +15 -8
- package/src/sandkit/api/events.d.ts +139 -2
- package/src/sandkit/api/excavation.d.ts +33 -3
- package/src/sandkit/api/factory.d.ts +6 -4
- package/src/sandkit/api/fire.d.ts +7 -4
- package/src/sandkit/api/game.d.ts +8 -2
- package/src/sandkit/api/grid.d.ts +72 -23
- package/src/sandkit/api/hooks.d.ts +362 -2
- package/src/sandkit/api/i18n.d.ts +65 -20
- package/src/sandkit/api/input.d.ts +15 -0
- package/src/sandkit/api/items.d.ts +7 -0
- package/src/sandkit/api/lights.d.ts +55 -8
- package/src/sandkit/api/maps.d.ts +10 -1
- package/src/sandkit/api/patterns.d.ts +22 -0
- package/src/sandkit/api/pickups.d.ts +14 -8
- package/src/sandkit/api/pipes.d.ts +9 -5
- package/src/sandkit/api/player.d.ts +29 -15
- package/src/sandkit/api/progression.d.ts +8 -0
- package/src/sandkit/api/reactions.d.ts +11 -0
- package/src/sandkit/api/rendering.d.ts +25 -2
- package/src/sandkit/api/resources.d.ts +5 -0
- package/src/sandkit/api/schedule.d.ts +7 -0
- package/src/sandkit/api/settings.d.ts +7 -0
- package/src/sandkit/api/shared.d.ts +13 -3
- package/src/sandkit/api/signals.d.ts +29 -0
- package/src/sandkit/api/sound.d.ts +14 -8
- package/src/sandkit/api/structureBehaviors.d.ts +8 -0
- package/src/sandkit/api/structures.d.ts +353 -43
- package/src/sandkit/api/tech.d.ts +73 -9
- package/src/sandkit/api/terrains.d.ts +25 -13
- package/src/sandkit/api/triggers.d.ts +10 -0
- package/src/sandkit/api/ui.d.ts +146 -1
- package/src/sandkit/api/upgrades.d.ts +2 -1
- package/src/sandkit/api/utils.d.ts +10 -5
- package/src/sandkit/api/world.d.ts +30 -25
- package/src/sandkit/index.d.ts +12 -1
- package/src/shared/api/elements.d.ts +36 -22
- package/src/shared/api/grid.d.ts +11 -6
- package/src/shared/api/player.d.ts +8 -4
- package/src/shared/api/shared.d.ts +2 -1
- package/src/shared/api/structures.d.ts +55 -17
- package/src/shared/api/terrains.d.ts +39 -23
- package/src/shared/api/ui.d.ts +5 -0
- package/src/shared/api/world.d.ts +9 -9
- package/src/worker/api/effects.d.ts +11 -3
- package/src/worker/api/elements.d.ts +54 -19
- package/src/worker/api/events.d.ts +31 -2
- package/src/worker/api/fire.d.ts +4 -2
- package/src/worker/api/grid.d.ts +10 -2
- package/src/worker/api/hooks.d.ts +68 -2
- package/src/worker/api/lights.d.ts +13 -3
- package/src/worker/api/shared.d.ts +12 -2
- package/src/worker/sandkit-api.d.ts +2 -1
- package/docs/Changelog.md +0 -46
- package/docs/README.md +0 -62
|
@@ -15,28 +15,28 @@ export namespace elements {
|
|
|
15
15
|
* Numeric element type handle.
|
|
16
16
|
* Built-in {@link ElementTypeEnum} values autocomplete; {@link getTypeById} returns a tagged handle.
|
|
17
17
|
*
|
|
18
|
-
* @see https://sandustry.com/sandkit.html
|
|
18
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
19
19
|
*/
|
|
20
20
|
export type ElementType = ElementTypeEnum | TaggedNumber<"elementType">;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Mod or built-in element string id.
|
|
24
24
|
*
|
|
25
|
-
* @see https://sandustry.com/sandkit.html
|
|
25
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
26
26
|
*/
|
|
27
27
|
export type ElementId = LooseString<never>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Type handle or string id accepted by lookup helpers.
|
|
31
31
|
*
|
|
32
|
-
* @see https://sandustry.com/sandkit.html
|
|
32
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
33
33
|
*/
|
|
34
34
|
export type ElementRef = ElementType | ElementId;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Physical behaviour category for an element.
|
|
38
38
|
*
|
|
39
|
-
* @see https://sandustry.com/sandkit.html
|
|
39
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
40
40
|
*/
|
|
41
41
|
export enum MatterType {
|
|
42
42
|
Solid = 1,
|
|
@@ -52,7 +52,7 @@ export namespace elements {
|
|
|
52
52
|
/**
|
|
53
53
|
* Mod-registered element definition snapshot.
|
|
54
54
|
*
|
|
55
|
-
* @see https://sandustry.com/sandkit.html
|
|
55
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
56
56
|
*/
|
|
57
57
|
export type ElementDefinition = {
|
|
58
58
|
id: string,
|
|
@@ -75,7 +75,7 @@ export namespace elements {
|
|
|
75
75
|
/**
|
|
76
76
|
* Options for {@link createAtCell}, replace, and related create helpers.
|
|
77
77
|
*
|
|
78
|
-
* @see https://sandustry.com/sandkit.html
|
|
78
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#mutations-heading)
|
|
79
79
|
*/
|
|
80
80
|
export interface ElementCreateOptions {
|
|
81
81
|
/** Initial element data bag. */
|
|
@@ -85,12 +85,13 @@ export namespace elements {
|
|
|
85
85
|
/**
|
|
86
86
|
* Set both max and remaining duration in simulation ticks.
|
|
87
87
|
*
|
|
88
|
-
* @see https://sandustry.com/sandkit.html
|
|
88
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#mutations-heading)
|
|
89
89
|
*/
|
|
90
90
|
durationTicks?: number;
|
|
91
91
|
/**
|
|
92
92
|
* @deprecated Use {@link durationTicks} instead.
|
|
93
|
-
*
|
|
93
|
+
*
|
|
94
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
94
95
|
*/
|
|
95
96
|
duration?: number;
|
|
96
97
|
/** Override free-fall state on spawn. */
|
|
@@ -113,7 +114,7 @@ export namespace elements {
|
|
|
113
114
|
/**
|
|
114
115
|
* Options for element removal helpers.
|
|
115
116
|
*
|
|
116
|
-
* @see https://sandustry.com/sandkit.html
|
|
117
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#mutations-heading)
|
|
117
118
|
*/
|
|
118
119
|
export interface ElementRemovalOptions {
|
|
119
120
|
/** Skip collector accounting when removing the element. */
|
|
@@ -124,7 +125,8 @@ export namespace elements {
|
|
|
124
125
|
* Return the mod string id for a numeric element type.
|
|
125
126
|
*
|
|
126
127
|
* @param elementType - Numeric element type.
|
|
127
|
-
*
|
|
128
|
+
*
|
|
129
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
128
130
|
*/
|
|
129
131
|
export function getIdByType(elementType: ElementType): ElementId;
|
|
130
132
|
|
|
@@ -132,13 +134,15 @@ export namespace elements {
|
|
|
132
134
|
* Resolve a mod element string id to a type handle.
|
|
133
135
|
*
|
|
134
136
|
* @param elementId - Mod-registered element id.
|
|
135
|
-
*
|
|
137
|
+
*
|
|
138
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
136
139
|
*/
|
|
137
140
|
export function getTypeById(elementId: ElementId): ElementType;
|
|
138
141
|
|
|
139
142
|
/**
|
|
140
143
|
* @deprecated Use {@link getTypeById} instead.
|
|
141
|
-
*
|
|
144
|
+
*
|
|
145
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
142
146
|
*/
|
|
143
147
|
export function getTypeFromId(elementId: ElementId): ElementType;
|
|
144
148
|
|
|
@@ -146,7 +150,8 @@ export namespace elements {
|
|
|
146
150
|
* Look up the definition for a type handle.
|
|
147
151
|
*
|
|
148
152
|
* @param elementType - Numeric element type.
|
|
149
|
-
*
|
|
153
|
+
*
|
|
154
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
150
155
|
*/
|
|
151
156
|
export function getDefinitionByType(elementType: ElementType): ElementDefinition | undefined;
|
|
152
157
|
|
|
@@ -155,7 +160,8 @@ export namespace elements {
|
|
|
155
160
|
*
|
|
156
161
|
* @param cellX - Grid column of the target cell.
|
|
157
162
|
* @param cellY - Grid row of the target cell.
|
|
158
|
-
*
|
|
163
|
+
*
|
|
164
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
159
165
|
*/
|
|
160
166
|
export function getTypeAtCell(...args: CellCoordinates): ElementType | null;
|
|
161
167
|
|
|
@@ -164,7 +170,8 @@ export namespace elements {
|
|
|
164
170
|
*
|
|
165
171
|
* @param cellX - Grid column of the target cell.
|
|
166
172
|
* @param cellY - Grid row of the target cell.
|
|
167
|
-
*
|
|
173
|
+
*
|
|
174
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
168
175
|
*/
|
|
169
176
|
export function getResolvedTypeAtCell(...args: CellCoordinates): ElementType | null;
|
|
170
177
|
|
|
@@ -172,7 +179,8 @@ export namespace elements {
|
|
|
172
179
|
* Return the resolved element type from a packed cell id.
|
|
173
180
|
*
|
|
174
181
|
* @param cellId - Packed cell id from {@link world.getCellIdAtCell}.
|
|
175
|
-
*
|
|
182
|
+
*
|
|
183
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
176
184
|
*/
|
|
177
185
|
export function getResolvedTypeFromCellId(cellId: CellId): ElementType | null;
|
|
178
186
|
|
|
@@ -181,7 +189,8 @@ export namespace elements {
|
|
|
181
189
|
*
|
|
182
190
|
* @param cellX - Grid column of the target cell.
|
|
183
191
|
* @param cellY - Grid row of the target cell.
|
|
184
|
-
*
|
|
192
|
+
*
|
|
193
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
185
194
|
*/
|
|
186
195
|
export function getInfoAtCell(...args: CellCoordinates): { elementType: ElementType; isParticle: boolean; cellId: CellId; elementIndex: number; } | null;
|
|
187
196
|
|
|
@@ -190,7 +199,8 @@ export namespace elements {
|
|
|
190
199
|
*
|
|
191
200
|
* @param cellX - Grid column of the target cell.
|
|
192
201
|
* @param cellY - Grid row of the target cell.
|
|
193
|
-
*
|
|
202
|
+
*
|
|
203
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
194
204
|
*/
|
|
195
205
|
export function getMatterTypeAtCell(...args: CellCoordinates): MatterType | null;
|
|
196
206
|
|
|
@@ -200,7 +210,8 @@ export namespace elements {
|
|
|
200
210
|
* @param cellX - Grid column of the target cell.
|
|
201
211
|
* @param cellY - Grid row of the target cell.
|
|
202
212
|
* @param elementTypeOrId - Numeric type or string id.
|
|
203
|
-
*
|
|
213
|
+
*
|
|
214
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
204
215
|
*/
|
|
205
216
|
export function isTypeAtCell(...args: [...CellCoordinates, elementTypeOrId: ElementRef]): boolean;
|
|
206
217
|
|
|
@@ -209,7 +220,8 @@ export namespace elements {
|
|
|
209
220
|
*
|
|
210
221
|
* @param cellX - Grid column of the target cell.
|
|
211
222
|
* @param cellY - Grid row of the target cell.
|
|
212
|
-
*
|
|
223
|
+
*
|
|
224
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
213
225
|
*/
|
|
214
226
|
export function isFreeFallingAtCell(...args: CellCoordinates): boolean;
|
|
215
227
|
|
|
@@ -218,7 +230,8 @@ export namespace elements {
|
|
|
218
230
|
*
|
|
219
231
|
* @param cellX - Grid column of the target cell.
|
|
220
232
|
* @param cellY - Grid row of the target cell.
|
|
221
|
-
*
|
|
233
|
+
*
|
|
234
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
222
235
|
*/
|
|
223
236
|
export function getVelocityAtCell(...args: CellCoordinates): { x: number; y: number; } | null;
|
|
224
237
|
|
|
@@ -228,7 +241,8 @@ export namespace elements {
|
|
|
228
241
|
* @param cellX - Grid column of the target cell.
|
|
229
242
|
* @param cellY - Grid row of the target cell.
|
|
230
243
|
* @param fieldNumber - Data field index (1–4).
|
|
231
|
-
*
|
|
244
|
+
*
|
|
245
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
232
246
|
*/
|
|
233
247
|
export function getDataFieldAtCell(...args: [...CellCoordinates, fieldNumber: 1 | 2 | 3 | 4]): number | null;
|
|
234
248
|
}
|
package/src/shared/api/grid.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export namespace grid {
|
|
|
16
16
|
* @param cellX - Grid column of the target cell.
|
|
17
17
|
* @param cellY - Grid row of the target cell.
|
|
18
18
|
* @returns Packed cell id for the cell.
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
20
21
|
*/
|
|
21
22
|
export function getCellIdAtCell(...args: CellCoordinates): CellId;
|
|
22
23
|
|
|
@@ -25,7 +26,8 @@ export namespace grid {
|
|
|
25
26
|
*
|
|
26
27
|
* @param cellX - Grid column of the target cell.
|
|
27
28
|
* @param cellY - Grid row of the target cell.
|
|
28
|
-
*
|
|
29
|
+
*
|
|
30
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
29
31
|
*/
|
|
30
32
|
export function isCellEmptyAtCell(...args: CellCoordinates): boolean;
|
|
31
33
|
|
|
@@ -34,7 +36,8 @@ export namespace grid {
|
|
|
34
36
|
*
|
|
35
37
|
* @param cellX - Grid column of the target cell.
|
|
36
38
|
* @param cellY - Grid row of the target cell.
|
|
37
|
-
*
|
|
39
|
+
*
|
|
40
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
38
41
|
*/
|
|
39
42
|
export function isTerrainAtCell(...args: CellCoordinates): boolean;
|
|
40
43
|
|
|
@@ -43,7 +46,8 @@ export namespace grid {
|
|
|
43
46
|
*
|
|
44
47
|
* @param cellX - Grid column of the target cell.
|
|
45
48
|
* @param cellY - Grid row of the target cell.
|
|
46
|
-
*
|
|
49
|
+
*
|
|
50
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
47
51
|
*/
|
|
48
52
|
export function reportActivityAtCell(...args: CellCoordinates): void;
|
|
49
53
|
|
|
@@ -55,14 +59,15 @@ export namespace grid {
|
|
|
55
59
|
* @param outVelocity - Ejection velocity written into this vector.
|
|
56
60
|
* @param damage - Damage applied to terrain in the pattern.
|
|
57
61
|
* @param options - Optional excavation source flags.
|
|
58
|
-
*
|
|
62
|
+
*
|
|
63
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
59
64
|
*/
|
|
60
65
|
export function excavateAtCell(...args: [...CellCoordinates, outVelocity: Vector2, damage: number, options?: ExcavateOptions]): void;
|
|
61
66
|
|
|
62
67
|
/**
|
|
63
68
|
* Return the world grid size in cells.
|
|
64
69
|
*
|
|
65
|
-
* @see https://sandustry.com/sandkit.html
|
|
70
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
66
71
|
*/
|
|
67
72
|
export function getDimensions(): GridDimensions;
|
|
68
73
|
|
|
@@ -10,13 +10,15 @@ export namespace player {
|
|
|
10
10
|
* Return the player center position in world pixels.
|
|
11
11
|
*
|
|
12
12
|
* @returns World position as `{ x, y }` in pixels.
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
14
15
|
*/
|
|
15
16
|
export function getPositionAtWorld(): Vector2;
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @deprecated Use {@link getPositionAtWorld} instead.
|
|
19
|
-
*
|
|
20
|
+
*
|
|
21
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
20
22
|
*/
|
|
21
23
|
export function getWorldPosition(): Vector2;
|
|
22
24
|
|
|
@@ -26,7 +28,8 @@ export namespace player {
|
|
|
26
28
|
* @param cellX - Grid column of the cell.
|
|
27
29
|
* @param cellY - Grid row of the cell.
|
|
28
30
|
* @returns True when the player overlaps the cell.
|
|
29
|
-
*
|
|
31
|
+
*
|
|
32
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
30
33
|
*/
|
|
31
34
|
export function isCollidingWithCell(...args: CellCoordinates): boolean;
|
|
32
35
|
|
|
@@ -37,7 +40,8 @@ export namespace player {
|
|
|
37
40
|
* @param cellY - Grid row of the reference cell.
|
|
38
41
|
* @param radius - Maximum distance in cells (inclusive).
|
|
39
42
|
* @returns True when the player is inside the radius.
|
|
40
|
-
*
|
|
43
|
+
*
|
|
44
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
41
45
|
*/
|
|
42
46
|
export function isWithinRadiusOfCell(...args: [...CellCoordinates, radius: number]): boolean;
|
|
43
47
|
}
|
|
@@ -14,7 +14,8 @@ export namespace shared {
|
|
|
14
14
|
*
|
|
15
15
|
* @param key - Buffer name shared across threads.
|
|
16
16
|
* @returns The typed array, or `undefined` when the buffer does not exist.
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
18
19
|
*/
|
|
19
20
|
export function get(key: string): SharedArray | undefined;
|
|
20
21
|
}
|
|
@@ -13,7 +13,15 @@ export namespace structures {
|
|
|
13
13
|
*
|
|
14
14
|
* @param structureTypeOrId - Structure type value or string id.
|
|
15
15
|
* @param callback - Called once per matching structure instance.
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
|
+
* @example Worker entry
|
|
18
|
+
* ```ts
|
|
19
|
+
* api.structures.forEachOfType("exampleStructure", (structure) => {
|
|
20
|
+
* processStructure(structure);
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
17
25
|
*/
|
|
18
26
|
export function forEachOfType(structureTypeOrId: StructureRef, callback: (structure: Structure) => void): void;
|
|
19
27
|
|
|
@@ -22,7 +30,8 @@ export namespace structures {
|
|
|
22
30
|
*
|
|
23
31
|
* @param cellX - Grid column of the target cell.
|
|
24
32
|
* @param cellY - Grid row of the target cell.
|
|
25
|
-
*
|
|
33
|
+
*
|
|
34
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
26
35
|
*/
|
|
27
36
|
export function getAtCell(...args: CellCoordinates): Structure | null;
|
|
28
37
|
|
|
@@ -30,7 +39,8 @@ export namespace structures {
|
|
|
30
39
|
* Return the mod-registered or built-in definition for a structure type.
|
|
31
40
|
*
|
|
32
41
|
* @param structureType - Structure type value or string id.
|
|
33
|
-
*
|
|
42
|
+
*
|
|
43
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
34
44
|
*/
|
|
35
45
|
export function getDefinitionByType(structureType: StructureRef): any;
|
|
36
46
|
|
|
@@ -38,13 +48,15 @@ export namespace structures {
|
|
|
38
48
|
* Map a structure string id to its runtime type value.
|
|
39
49
|
*
|
|
40
50
|
* @param structureId - Structure string id.
|
|
41
|
-
*
|
|
51
|
+
*
|
|
52
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
42
53
|
*/
|
|
43
54
|
export function getTypeById(structureId: StructureId): StructureType;
|
|
44
55
|
|
|
45
56
|
/**
|
|
46
57
|
* @deprecated Use {@link getTypeById} instead.
|
|
47
|
-
*
|
|
58
|
+
*
|
|
59
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
48
60
|
*/
|
|
49
61
|
export function getTypeFromId(structureId: StructureId): StructureType;
|
|
50
62
|
|
|
@@ -53,7 +65,8 @@ export namespace structures {
|
|
|
53
65
|
*
|
|
54
66
|
* @param cellX - Grid column of the target cell.
|
|
55
67
|
* @param cellY - Grid row of the target cell.
|
|
56
|
-
*
|
|
68
|
+
*
|
|
69
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
57
70
|
*/
|
|
58
71
|
export function hasBuiltAtCell(...args: CellCoordinates): boolean;
|
|
59
72
|
|
|
@@ -62,7 +75,8 @@ export namespace structures {
|
|
|
62
75
|
*
|
|
63
76
|
* @param structure - Structure instance, or null.
|
|
64
77
|
* @param structureId - Structure string id to compare.
|
|
65
|
-
*
|
|
78
|
+
*
|
|
79
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
66
80
|
*/
|
|
67
81
|
export function isType(structure: Structure | null, structureId: StructureId): boolean;
|
|
68
82
|
|
|
@@ -72,7 +86,8 @@ export namespace structures {
|
|
|
72
86
|
* @param cellX - Grid column of the target cell.
|
|
73
87
|
* @param cellY - Grid row of the target cell.
|
|
74
88
|
* @param structureId - Structure string id to compare.
|
|
75
|
-
*
|
|
89
|
+
*
|
|
90
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
76
91
|
*/
|
|
77
92
|
export function isTypeAtCell(...args: [...CellCoordinates, structureId: StructureId]): boolean;
|
|
78
93
|
|
|
@@ -81,7 +96,8 @@ export namespace structures {
|
|
|
81
96
|
*
|
|
82
97
|
* @param structure - Target structure instance.
|
|
83
98
|
* @param index - Spritesheet frame index.
|
|
84
|
-
*
|
|
99
|
+
*
|
|
100
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
85
101
|
*/
|
|
86
102
|
export function setSpritesheetIndex(structure: Structure, index: number): void;
|
|
87
103
|
|
|
@@ -91,7 +107,8 @@ export namespace structures {
|
|
|
91
107
|
* @param cellX - Grid column of the target cell.
|
|
92
108
|
* @param cellY - Grid row of the target cell.
|
|
93
109
|
* @param index - Spritesheet frame index.
|
|
94
|
-
*
|
|
110
|
+
*
|
|
111
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
95
112
|
*/
|
|
96
113
|
export function setSpritesheetIndexAtCell(...args: [...CellCoordinates, index: number]): void;
|
|
97
114
|
|
|
@@ -101,7 +118,8 @@ export namespace structures {
|
|
|
101
118
|
* @param structure - Target structure instance.
|
|
102
119
|
* @param value - Numeric value mapped through thresholds.
|
|
103
120
|
* @param thresholds - Ascending threshold values.
|
|
104
|
-
*
|
|
121
|
+
*
|
|
122
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
105
123
|
*/
|
|
106
124
|
export function setSpritesheetIndexByValue(structure: Structure, value: number, thresholds: number[]): void;
|
|
107
125
|
|
|
@@ -112,7 +130,8 @@ export namespace structures {
|
|
|
112
130
|
* @param cellY - Grid row of the target cell.
|
|
113
131
|
* @param value - Numeric value mapped through thresholds.
|
|
114
132
|
* @param thresholds - Ascending threshold values.
|
|
115
|
-
*
|
|
133
|
+
*
|
|
134
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
116
135
|
*/
|
|
117
136
|
export function setSpritesheetIndexByValueAtCell(...args: [...CellCoordinates, value: number, thresholds: number[]]): void;
|
|
118
137
|
|
|
@@ -121,7 +140,13 @@ export namespace structures {
|
|
|
121
140
|
*
|
|
122
141
|
* @param structure - Structure instance to update.
|
|
123
142
|
* @param options - When `propagateToWorkers` is true, sync to worker threads.
|
|
124
|
-
*
|
|
143
|
+
*
|
|
144
|
+
* @example Worker entry
|
|
145
|
+
* ```ts
|
|
146
|
+
* api.structures.update(structure, { propagateToWorkers: true });
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
125
150
|
*/
|
|
126
151
|
export function update(structure: Structure, options?: { propagateToWorkers?: boolean; }): void;
|
|
127
152
|
|
|
@@ -131,13 +156,24 @@ export namespace structures {
|
|
|
131
156
|
* @param structure - Structure instance to update.
|
|
132
157
|
* @param partial - Fields to merge onto `structure.data`.
|
|
133
158
|
* @param options - When `propagateToWorkers` is true, sync to worker threads.
|
|
134
|
-
*
|
|
159
|
+
*
|
|
160
|
+
* @example Worker entry
|
|
161
|
+
* ```ts
|
|
162
|
+
* api.structures.updateData(
|
|
163
|
+
* structure,
|
|
164
|
+
* { mode: "allow" },
|
|
165
|
+
* { propagateToWorkers: true },
|
|
166
|
+
* );
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
135
170
|
*/
|
|
136
171
|
export function updateData(structure: Structure, partial: any, options?: { propagateToWorkers?: boolean; }): void;
|
|
137
172
|
|
|
138
173
|
/**
|
|
139
174
|
* @deprecated Use {@link updateData} instead.
|
|
140
|
-
*
|
|
175
|
+
*
|
|
176
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
141
177
|
*/
|
|
142
178
|
export function setData(structure: Structure, partial: any, options?: { propagateToWorkers?: boolean; }): void;
|
|
143
179
|
|
|
@@ -148,13 +184,15 @@ export namespace structures {
|
|
|
148
184
|
*
|
|
149
185
|
* @param cellX - Grid column of the target cell.
|
|
150
186
|
* @param cellY - Grid row of the target cell.
|
|
151
|
-
*
|
|
187
|
+
*
|
|
188
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
152
189
|
*/
|
|
153
190
|
export function isEnabledAtCell(...args: CellCoordinates): boolean;
|
|
154
191
|
|
|
155
192
|
/**
|
|
156
193
|
* @deprecated Use {@link isEnabledAtCell} instead.
|
|
157
|
-
*
|
|
194
|
+
*
|
|
195
|
+
* @see [Official docs](https://sandustry.com/sandkit.html#api-access-heading)
|
|
158
196
|
*/
|
|
159
197
|
export function isEnabledAt(...args: CellCoordinates): boolean;
|
|
160
198
|
}
|