@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.
Files changed (152) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +21 -0
  3. package/README.md +28 -18
  4. package/package.json +62 -11
  5. package/src/sandkit/api/blueprints.d.ts +33 -0
  6. package/src/sandkit/api/effects.d.ts +127 -0
  7. package/src/sandkit/api/elements.d.ts +385 -0
  8. package/src/sandkit/api/entities.d.ts +79 -0
  9. package/src/sandkit/api/events.d.ts +137 -0
  10. package/src/sandkit/api/excavation.d.ts +58 -0
  11. package/src/sandkit/api/factory.d.ts +38 -0
  12. package/src/sandkit/api/fire.d.ts +33 -0
  13. package/src/sandkit/api/game.d.ts +22 -0
  14. package/src/sandkit/api/grid.d.ts +180 -0
  15. package/src/sandkit/api/hooks.d.ts +357 -0
  16. package/{sandkit → src/sandkit}/api/i18n.d.ts +80 -4
  17. package/{sandkit → src/sandkit}/api/index.d.ts +6 -0
  18. package/src/sandkit/api/lights.d.ts +101 -0
  19. package/{sandkit → src/sandkit}/api/maps.d.ts +15 -0
  20. package/src/sandkit/api/pickups.d.ts +89 -0
  21. package/src/sandkit/api/pipes.d.ts +54 -0
  22. package/src/sandkit/api/player.d.ts +141 -0
  23. package/{sandkit → src/sandkit}/api/rendering.d.ts +8 -0
  24. package/{sandkit → src/sandkit}/api/sandkit-api.d.ts +19 -2
  25. package/src/sandkit/api/shared.d.ts +41 -0
  26. package/{sandkit → src/sandkit}/api/sound.d.ts +32 -2
  27. package/{sandkit → src/sandkit}/api/structures.d.ts +171 -18
  28. package/{sandkit → src/sandkit}/api/tech.d.ts +54 -1
  29. package/src/sandkit/api/terrains.d.ts +147 -0
  30. package/{sandkit → src/sandkit}/api/upgrades.d.ts +9 -0
  31. package/{sandkit → src/sandkit}/api/utils.d.ts +19 -2
  32. package/src/sandkit/api/world.d.ts +105 -0
  33. package/{sandkit → src/sandkit}/enums/index.d.ts +14 -0
  34. package/{shared → src/shared}/api/elements.d.ts +84 -12
  35. package/{shared/api/world.d.ts → src/shared/api/grid.d.ts} +29 -3
  36. package/{shared → src/shared}/api/player.d.ts +12 -0
  37. package/{shared → src/shared}/api/shared.d.ts +5 -3
  38. package/{shared → src/shared}/api/structures.d.ts +46 -0
  39. package/src/shared/api/terrains.d.ts +231 -0
  40. package/src/shared/api/world.d.ts +43 -0
  41. package/{shared → src/shared}/index.d.ts +2 -0
  42. package/src/worker/api/effects.d.ts +52 -0
  43. package/src/worker/api/elements.d.ts +266 -0
  44. package/src/worker/api/events.d.ts +75 -0
  45. package/src/worker/api/fire.d.ts +29 -0
  46. package/src/worker/api/grid.d.ts +45 -0
  47. package/src/worker/api/hooks.d.ts +111 -0
  48. package/src/worker/api/lights.d.ts +43 -0
  49. package/{worker → src/worker}/api/shared.d.ts +8 -3
  50. package/{worker → src/worker}/index.d.ts +8 -5
  51. package/{worker → src/worker}/sandkit-api.d.ts +12 -3
  52. package/sandkit/api/effects.d.ts +0 -76
  53. package/sandkit/api/elements.d.ts +0 -237
  54. package/sandkit/api/events.d.ts +0 -53
  55. package/sandkit/api/excavation.d.ts +0 -34
  56. package/sandkit/api/fire.d.ts +0 -26
  57. package/sandkit/api/grid.d.ts +0 -26
  58. package/sandkit/api/hooks.d.ts +0 -52
  59. package/sandkit/api/lights.d.ts +0 -66
  60. package/sandkit/api/player.d.ts +0 -84
  61. package/sandkit/api/shared.d.ts +0 -27
  62. package/sandkit/api/terrains.d.ts +0 -125
  63. package/sandkit/api/world.d.ts +0 -107
  64. package/shared/api/terrains.d.ts +0 -100
  65. package/worker/api/elements.d.ts +0 -60
  66. /package/{global.d.ts → src/global.d.ts} +0 -0
  67. /package/{sandkit → src/sandkit}/api/action.d.ts +0 -0
  68. /package/{sandkit → src/sandkit}/api/assets.d.ts +0 -0
  69. /package/{sandkit → src/sandkit}/api/authorization.d.ts +0 -0
  70. /package/{sandkit → src/sandkit}/api/building.d.ts +0 -0
  71. /package/{sandkit → src/sandkit}/api/camera.d.ts +0 -0
  72. /package/{sandkit → src/sandkit}/api/collector.d.ts +0 -0
  73. /package/{sandkit → src/sandkit}/api/constants.d.ts +0 -0
  74. /package/{sandkit → src/sandkit}/api/cooldown.d.ts +0 -0
  75. /package/{sandkit → src/sandkit}/api/discoveries.d.ts +0 -0
  76. /package/{sandkit → src/sandkit}/api/energy.d.ts +0 -0
  77. /package/{sandkit → src/sandkit}/api/gameconfig.d.ts +0 -0
  78. /package/{sandkit → src/sandkit}/api/input.d.ts +0 -0
  79. /package/{sandkit → src/sandkit}/api/items.d.ts +0 -0
  80. /package/{sandkit → src/sandkit}/api/mods.d.ts +0 -0
  81. /package/{sandkit → src/sandkit}/api/patterns.d.ts +0 -0
  82. /package/{sandkit → src/sandkit}/api/processing.d.ts +0 -0
  83. /package/{sandkit → src/sandkit}/api/progression.d.ts +0 -0
  84. /package/{sandkit → src/sandkit}/api/projectiles.d.ts +0 -0
  85. /package/{sandkit → src/sandkit}/api/random.d.ts +0 -0
  86. /package/{sandkit → src/sandkit}/api/raycast.d.ts +0 -0
  87. /package/{sandkit → src/sandkit}/api/reactions.d.ts +0 -0
  88. /package/{sandkit → src/sandkit}/api/resources.d.ts +0 -0
  89. /package/{sandkit → src/sandkit}/api/scene.d.ts +0 -0
  90. /package/{sandkit → src/sandkit}/api/schedule.d.ts +0 -0
  91. /package/{sandkit → src/sandkit}/api/settings.d.ts +0 -0
  92. /package/{sandkit → src/sandkit}/api/signals.d.ts +0 -0
  93. /package/{sandkit → src/sandkit}/api/sprites.d.ts +0 -0
  94. /package/{sandkit → src/sandkit}/api/storage.d.ts +0 -0
  95. /package/{sandkit → src/sandkit}/api/structureBehaviors.d.ts +0 -0
  96. /package/{sandkit → src/sandkit}/api/time.d.ts +0 -0
  97. /package/{sandkit → src/sandkit}/api/tools.d.ts +0 -0
  98. /package/{sandkit → src/sandkit}/api/triggers.d.ts +0 -0
  99. /package/{sandkit → src/sandkit}/api/ui.d.ts +0 -0
  100. /package/{sandkit → src/sandkit}/api/workers.d.ts +0 -0
  101. /package/{sandkit → src/sandkit}/engine/api/augments.d.ts +0 -0
  102. /package/{sandkit → src/sandkit}/engine/api/auralite.d.ts +0 -0
  103. /package/{sandkit → src/sandkit}/engine/api/blueprints.d.ts +0 -0
  104. /package/{sandkit → src/sandkit}/engine/api/clipboard.d.ts +0 -0
  105. /package/{sandkit → src/sandkit}/engine/api/colorPicker.d.ts +0 -0
  106. /package/{sandkit → src/sandkit}/engine/api/coloringTool.d.ts +0 -0
  107. /package/{sandkit → src/sandkit}/engine/api/conveyors.d.ts +0 -0
  108. /package/{sandkit → src/sandkit}/engine/api/debug.d.ts +0 -0
  109. /package/{sandkit → src/sandkit}/engine/api/drones.d.ts +0 -0
  110. /package/{sandkit → src/sandkit}/engine/api/entities.d.ts +0 -0
  111. /package/{sandkit → src/sandkit}/engine/api/extensions.d.ts +0 -0
  112. /package/{sandkit → src/sandkit}/engine/api/factory.d.ts +0 -0
  113. /package/{sandkit → src/sandkit}/engine/api/foliage.d.ts +0 -0
  114. /package/{sandkit → src/sandkit}/engine/api/foundationColorPicker.d.ts +0 -0
  115. /package/{sandkit → src/sandkit}/engine/api/game.d.ts +0 -0
  116. /package/{sandkit → src/sandkit}/engine/api/heatTransfer.d.ts +0 -0
  117. /package/{sandkit → src/sandkit}/engine/api/index.d.ts +0 -0
  118. /package/{sandkit → src/sandkit}/engine/api/launchers.d.ts +0 -0
  119. /package/{sandkit → src/sandkit}/engine/api/lightColorPicker.d.ts +0 -0
  120. /package/{sandkit → src/sandkit}/engine/api/matters.d.ts +0 -0
  121. /package/{sandkit → src/sandkit}/engine/api/misc.d.ts +0 -0
  122. /package/{sandkit → src/sandkit}/engine/api/portals.d.ts +0 -0
  123. /package/{sandkit → src/sandkit}/engine/api/prefabData.d.ts +0 -0
  124. /package/{sandkit → src/sandkit}/engine/api/prefabDecor.d.ts +0 -0
  125. /package/{sandkit → src/sandkit}/engine/api/prefabulator.d.ts +0 -0
  126. /package/{sandkit → src/sandkit}/engine/api/prismaline.d.ts +0 -0
  127. /package/{sandkit → src/sandkit}/engine/api/prismite.d.ts +0 -0
  128. /package/{sandkit → src/sandkit}/engine/api/queue.d.ts +0 -0
  129. /package/{sandkit → src/sandkit}/engine/api/shadows.d.ts +0 -0
  130. /package/{sandkit → src/sandkit}/engine/api/strataform.d.ts +0 -0
  131. /package/{sandkit → src/sandkit}/engine/api/swarmConsole.d.ts +0 -0
  132. /package/{sandkit → src/sandkit}/engine/api/sweeperDrone.d.ts +0 -0
  133. /package/{sandkit → src/sandkit}/engine/api/teleportZones.d.ts +0 -0
  134. /package/{sandkit → src/sandkit}/engine/api/tutorialBuild.d.ts +0 -0
  135. /package/{sandkit → src/sandkit}/engine/api/usageTracker.d.ts +0 -0
  136. /package/{sandkit → src/sandkit}/engine/api/wall.d.ts +0 -0
  137. /package/{sandkit → src/sandkit}/engine/api/workerLocal.d.ts +0 -0
  138. /package/{sandkit → src/sandkit}/engine/index.d.ts +0 -0
  139. /package/{sandkit → src/sandkit}/engine/retro-console.d.ts +0 -0
  140. /package/{sandkit → src/sandkit}/engine/state.d.ts +0 -0
  141. /package/{sandkit → src/sandkit}/index.d.ts +0 -0
  142. /package/{sandkit → src/sandkit}/react.d.ts +0 -0
  143. /package/{shared → src/shared}/api/effects.d.ts +0 -0
  144. /package/{shared → src/shared}/api/maps.d.ts +0 -0
  145. /package/{shared → src/shared}/api/ui.d.ts +0 -0
  146. /package/{shared → src/shared}/asset.d.ts +0 -0
  147. /package/{shared → src/shared}/engine.d.ts +0 -0
  148. /package/{shared → src/shared}/jsonvalue.d.ts +0 -0
  149. /package/{shared → src/shared}/nominal.d.ts +0 -0
  150. /package/{shared → src/shared}/player.d.ts +0 -0
  151. /package/{worker → src/worker}/api/main.d.ts +0 -0
  152. /package/{worker → src/worker}/api/worker.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,42 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.1] - 2026-08-27
9
+
10
+ ### Fixed
11
+
12
+ - Deep package imports such as `@sandustry-modding/types/sandkit/engine` (Node `exports` `*` matches one path segment; map file and `index.d.ts` targets under `src/`)
13
+ - Ship root `CHANGELOG.md` and `LICENSE` in the npm tarball
14
+ - Document ambient setup with `/// <reference types="@sandustry-modding/types" />` (do not list this package under `compilerOptions.types`)
15
+
16
+ ### Added
17
+
18
+ - `npm run validate` gate: declaration typecheck, unit tests, and packed-tarball consumer probes
19
+
20
+ ## [0.3.0] - 2026-08-27
21
+
22
+ ### Changed
23
+
24
+ - Move declaration sources into `src/` (`src/sandkit`, `src/worker`, `src/shared`, `src/global.d.ts`). Package subpaths such as `@sandustry-modding/types/sandkit/engine` stay the same
25
+ - Show local names for API member headings in the Docsify reference (full runtime path stays under each heading)
26
+
27
+ ## [0.2.0] - 2026-08-27
28
+
29
+ ### Added
30
+
31
+ - Official Sandkit API coverage from [sandustry.com/sandkit.html](https://sandustry.com/sandkit.html): `api.entities`, `api.pipes`, `api.factory`, `api.game`, `api.blueprints`, `api.pickups`, `api.grid.mutate`, and related worker surfaces
32
+ - JSDoc `@see` links back to the official Sandkit page on documented members
33
+
34
+ ### Changed
35
+
36
+ - Canonical mutation names match official docs (`createAtCell`, `grid.mutate`, `getTypeById`, and similar). Old names stay as `@deprecated` aliases (`*WhenIdle`, `api.world`, `getTypeFromId`, and similar)
37
+
38
+ ## [0.1.1] - 2026-08-27
39
+
40
+ ### Changed
41
+
42
+ - Export subpaths (`./*`) so mods can import declaration modules such as `@sandustry-modding/types/sandkit/engine`
43
+
8
44
  ## [0.1.0] - 2026-08-27
9
45
 
10
46
  ### Added
@@ -16,4 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
52
  - Ambient `sandkit` free variable and type aliases via `global.d.ts`
17
53
  - Docsify API reference generated from the declarations
18
54
 
55
+ [0.3.1]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.1
56
+ [0.3.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.0
57
+ [0.2.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.2.0
58
+ [0.1.1]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.1
19
59
  [0.1.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sandustry-modding
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  TypeScript declarations and Docsify API docs for the live Sandustry `sandkit` object. Package name: `@sandustry-modding/types`.
4
4
 
5
+ Originally a fork of [flamableassassin/sandustry-modding-types](https://github.com/flamableassassin/sandustry-modding-types/).
6
+
5
7
  Folder layout mirrors runtime shape so you can jump from code to the matching `.d.ts` path.
6
8
 
7
9
  ## Runtime map
8
10
 
9
11
  | Path | Runtime object |
10
12
  | --- | --- |
11
- | `sandkit/api/` | `sandkit.api` (main thread) |
12
- | `sandkit/engine/api/` | `sandkit.engine.api` |
13
- | `sandkit/engine/state.d.ts` | `sandkit.engine.state` / `sandkit.state` |
14
- | `sandkit/enums/` | `sandkit.enums` |
15
- | `sandkit/react.d.ts` | `sandkit.react` |
16
- | `sandkit/index.d.ts` | Composed `Sandkit` root type |
17
- | `global.d.ts` | Ambient `sandkit` free variable and type aliases |
18
- | `worker/` | Worker-thread `sandkit.api` (see `WorkerSandkitApi`) |
19
- | `shared/` | Internal base shapes reused by main and worker declarations |
13
+ | `src/sandkit/api/` | `sandkit.api` (main thread) |
14
+ | `src/sandkit/engine/api/` | `sandkit.engine.api` |
15
+ | `src/sandkit/engine/state.d.ts` | `sandkit.engine.state` / `sandkit.state` |
16
+ | `src/sandkit/enums/` | `sandkit.enums` |
17
+ | `src/sandkit/react.d.ts` | `sandkit.react` |
18
+ | `src/sandkit/index.d.ts` | Composed `Sandkit` root type |
19
+ | `src/global.d.ts` | Ambient `sandkit` free variable and type aliases |
20
+ | `src/worker/` | Worker-thread `sandkit.api` (see `WorkerSandkitApi`) |
21
+ | `src/shared/` | Internal base shapes reused by main and worker declarations |
20
22
 
21
23
  ## Runtime shape vs `export namespace`
22
24
 
@@ -35,14 +37,22 @@ Declaration files use `export namespace` because it is the usual `.d.ts` pattern
35
37
  npm install @sandustry-modding/types
36
38
  ```
37
39
 
38
- In `tsconfig.json`, include the package types (or reference them from an ambient file):
40
+ ### Ambient types (preferred)
41
+
42
+ Pull the host `sandkit` ambient into your project with a triple-slash reference. Put it at the top of `main.js` / `worker.js`, or in a small ambient `.d.ts` that your `tsconfig` / `jsconfig` includes:
43
+
44
+ ```ts
45
+ /// <reference types="@sandustry-modding/types" />
46
+ ```
47
+
48
+ That works in `.ts` and `.js` (including checked JS with `checkJs`).
49
+
50
+ Do **not** list `@sandustry-modding/types` under `compilerOptions.types`. That list only loads packages from `node_modules/@types` (for example `"react"` or `"node"`).
51
+
52
+ Deep declaration modules are also available, for example:
39
53
 
40
- ```json
41
- {
42
- "compilerOptions": {
43
- "types": ["@sandustry-modding/types"]
44
- }
45
- }
54
+ ```ts
55
+ import type { RetroConsoleGame } from "@sandustry-modding/types/sandkit/engine";
46
56
  ```
47
57
 
48
58
  ## Usage
@@ -53,7 +63,7 @@ In `tsconfig.json`, include the package types (or reference them from an ambient
53
63
 
54
64
  ## Maintaining types
55
65
 
56
- Edit `.d.ts` files here. Regenerate the Docsify API reference after JSDoc changes.
66
+ Edit `.d.ts` files under `src/`. Regenerate the Docsify API reference after JSDoc changes.
57
67
 
58
68
  ## Docs site
59
69
 
@@ -63,4 +73,4 @@ Regenerate the Docsify API reference from these declarations:
63
73
  npm run docs:api
64
74
  ```
65
75
 
66
- Output lands in `docs/api/`. `npm run docs` runs that step, then serves the docs site.
76
+ Output lands in `docs/api/`. The namespace index is `docs/modules.md` and the combined page is `docs/full.md`. `npm run docs` runs that step, then serves the docs site.
package/package.json CHANGED
@@ -1,38 +1,89 @@
1
1
  {
2
2
  "name": "@sandustry-modding/types",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "TypeScript declarations and API docs for the Sandustry Sandkit host API",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/sandustry-modding/SandustryTypes.git"
9
9
  },
10
- "homepage": "https://github.com/sandustry-modding/SandustryTypes#readme",
10
+ "homepage": "https://sandustry-modding.github.io/SandustryTypes/",
11
11
  "bugs": {
12
12
  "url": "https://github.com/sandustry-modding/SandustryTypes/issues"
13
13
  },
14
- "types": "./global.d.ts",
14
+ "types": "./src/global.d.ts",
15
15
  "exports": {
16
16
  ".": {
17
- "types": "./global.d.ts"
17
+ "types": "./src/global.d.ts"
18
+ },
19
+ "./package.json": "./package.json",
20
+ "./sandkit": {
21
+ "types": "./src/sandkit/index.d.ts"
22
+ },
23
+ "./sandkit/*": {
24
+ "types": [
25
+ "./src/sandkit/*.d.ts",
26
+ "./src/sandkit/*/index.d.ts"
27
+ ]
28
+ },
29
+ "./sandkit/*/*": {
30
+ "types": [
31
+ "./src/sandkit/*/*.d.ts",
32
+ "./src/sandkit/*/*/index.d.ts"
33
+ ]
34
+ },
35
+ "./sandkit/*/*/*": {
36
+ "types": [
37
+ "./src/sandkit/*/*/*.d.ts",
38
+ "./src/sandkit/*/*/*/index.d.ts"
39
+ ]
40
+ },
41
+ "./shared": {
42
+ "types": "./src/shared/index.d.ts"
43
+ },
44
+ "./shared/*": {
45
+ "types": [
46
+ "./src/shared/*.d.ts",
47
+ "./src/shared/*/index.d.ts"
48
+ ]
49
+ },
50
+ "./shared/*/*": {
51
+ "types": [
52
+ "./src/shared/*/*.d.ts",
53
+ "./src/shared/*/*/index.d.ts"
54
+ ]
55
+ },
56
+ "./worker": {
57
+ "types": "./src/worker/index.d.ts"
58
+ },
59
+ "./worker/*": {
60
+ "types": [
61
+ "./src/worker/*.d.ts",
62
+ "./src/worker/*/index.d.ts"
63
+ ]
64
+ },
65
+ "./worker/*/*": {
66
+ "types": [
67
+ "./src/worker/*/*.d.ts",
68
+ "./src/worker/*/*/index.d.ts"
69
+ ]
18
70
  }
19
71
  },
20
72
  "files": [
21
- "global.d.ts",
22
- "sandkit/**/*.d.ts",
23
- "shared/**/*.d.ts",
24
- "worker/**/*.d.ts",
73
+ "src/**/*.d.ts",
25
74
  "CHANGELOG.md",
26
75
  "LICENSE",
27
- "README.md",
28
- "ATTRIBUTION.md"
76
+ "README.md"
29
77
  ],
30
78
  "scripts": {
31
79
  "docs": "npm run docs:api && npm run docs:serve",
32
80
  "docs:api": "node scripts/generate-api-docs.mjs",
33
81
  "docs:serve": "npx --yes docsify-cli serve docs",
34
82
  "test": "node --test scripts/api-search.test.js",
35
- "typecheck": "tsc -p tsconfig.json --noEmit"
83
+ "typecheck": "tsc -p tsconfig.json --noEmit",
84
+ "verify-package": "node scripts/verify-package.mjs",
85
+ "validate": "npm run typecheck && npm test && npm run verify-package",
86
+ "prepack": "npm run validate"
36
87
  },
37
88
  "devDependencies": {
38
89
  "@types/react": "^18.3.1",
@@ -0,0 +1,33 @@
1
+ import type { structures } from "../../shared/api/structures";
2
+
3
+ /**
4
+ * Structure blueprint serialize and localize helpers.
5
+ *
6
+ * Available as `sandkit.api.blueprints`.
7
+ *
8
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.blueprints`
9
+ */
10
+ export namespace blueprints {
11
+ /**
12
+ * Serialize live structure instances into blueprint records.
13
+ *
14
+ * @param structures - Structure instances to encode.
15
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.blueprints.serializeStructures`
16
+ */
17
+ export function serializeStructures(structures: readonly structures.Structure[]): BlueprintStructure[];
18
+
19
+ /**
20
+ * Localize blueprint structure records for placement.
21
+ *
22
+ * @param structures - Blueprint structure records to localize.
23
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.blueprints.localizeStructures`
24
+ */
25
+ export function localizeStructures(structures: readonly BlueprintStructure[]): BlueprintStructure[];
26
+
27
+ /** Serialized structure entry used in blueprints. */
28
+ export interface BlueprintStructure {
29
+ x: number;
30
+ y: number;
31
+ [key: string]: unknown;
32
+ }
33
+ }
@@ -0,0 +1,127 @@
1
+ import { shared } from "../../shared";
2
+
3
+ /**
4
+ * `sandkit.api.effects` — visual effects, particles, and lasers at world positions.
5
+ * Main thread only. Temporary lights live under {@link lights.temporary}.
6
+ */
7
+ export namespace effects {
8
+ /** Options for generic screen effects. */
9
+ export import EffectOptions = shared.api.effects.EffectOptions;
10
+ /** Options for temporary lights. */
11
+ export import TemporaryLightOptions = shared.api.effects.TemporaryLightOptions;
12
+ /** Options for particle effects. */
13
+ export import ParticleEffectOptions = shared.api.effects.ParticleEffectOptions;
14
+
15
+ /**
16
+ * Creates a named screen effect at world coordinates.
17
+ *
18
+ * @param effectId - Registered effect id (for example `heatWave`).
19
+ * @param worldX - World X coordinate in pixels.
20
+ * @param worldY - World Y coordinate in pixels.
21
+ * @param options - Duration, radius, and intensity settings.
22
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.effects.createAtWorld`
23
+ */
24
+ export function createAtWorld(
25
+ effectId: string,
26
+ worldX: number,
27
+ worldY: number,
28
+ options?: EffectOptions,
29
+ ): void;
30
+
31
+ /**
32
+ * @deprecated Use {@link createAtWorld} instead.
33
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.effects.createAtWorld`
34
+ */
35
+ export function createEffectAtWorld(
36
+ effectId: string,
37
+ worldX: number,
38
+ worldY: number,
39
+ options?: EffectOptions,
40
+ ): void;
41
+
42
+ /**
43
+ * Spawns particles at world coordinates.
44
+ *
45
+ * @param worldX - World X coordinate in pixels.
46
+ * @param worldY - World Y coordinate in pixels.
47
+ * @param options - Count, velocity, colour, and lifetime settings.
48
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.effects.createParticlesAtWorld`
49
+ */
50
+ export import createParticlesAtWorld = shared.api.effects.createParticlesAtWorld;
51
+
52
+ /**
53
+ * @deprecated Use {@link lights.temporary.createAtWorld} instead.
54
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.lights.temporary.createAtWorld`
55
+ */
56
+ export function createLightAtWorld(
57
+ worldX: number,
58
+ worldY: number,
59
+ options?: TemporaryLightOptions,
60
+ ): { lightId: number | null; index?: number | null; };
61
+
62
+ /**
63
+ * Creates a distortion wave effect at world coordinates.
64
+ *
65
+ * @param worldX - World X coordinate in pixels.
66
+ * @param worldY - World Y coordinate in pixels.
67
+ * @param options - Style, duration, radius, intensity, and color.
68
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.effects.createDistortionWaveAtWorld`
69
+ */
70
+ export function createDistortionWaveAtWorld(worldX: number, worldY: number, options?: DistortionEffectOptions): void;
71
+
72
+ /**
73
+ * Creates a laser beam between two world points. Returns a handle to destroy it.
74
+ *
75
+ * @param startWorldX - Beam start world X in pixels.
76
+ * @param startWorldY - Beam start world Y in pixels.
77
+ * @param endWorldX - Beam end world X in pixels.
78
+ * @param endWorldY - Beam end world Y in pixels.
79
+ * @param options - Width, brightness, color, and glow options.
80
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — Main entry `api.effects.createLaserAtWorld`
81
+ */
82
+ export function createLaserAtWorld(
83
+ startWorldX: number,
84
+ startWorldY: number,
85
+ endWorldX: number,
86
+ endWorldY: number,
87
+ options?: LaserEffectOptions,
88
+ ): LaserEffectHandle;
89
+
90
+ /**
91
+ * @deprecated Use {@link lights.temporary.removeById} instead.
92
+ * @see https://sandustry.com/sandkit.html Official Sandkit API — deprecated alias of `api.lights.temporary.removeById`
93
+ */
94
+ export function removeLightById(lightId: number): void;
95
+
96
+ /** Options for laser beam effects. */
97
+ export interface LaserEffectOptions {
98
+ /** Beam width in pixels. */
99
+ width?: number;
100
+ /** Beam brightness multiplier. */
101
+ brightness?: number;
102
+ /** Beam color as a packed integer. */
103
+ color?: number;
104
+ /** When true, draws a glow around the beam. */
105
+ glow?: boolean;
106
+ }
107
+
108
+ /** Handle returned by createLaserAtWorld. */
109
+ export interface LaserEffectHandle {
110
+ /** Removes the laser from the scene. */
111
+ destroy(): void;
112
+ }
113
+
114
+ /** Options for distortion wave effects. */
115
+ export interface DistortionEffectOptions {
116
+ /** Distortion style: implode or explode. */
117
+ style?: "implode" | "explode";
118
+ /** Effect duration in seconds. */
119
+ duration?: number;
120
+ /** Maximum radius of the wave. */
121
+ maxRadius?: number;
122
+ /** Visual intensity of the distortion. */
123
+ intensity?: number;
124
+ /** RGBA color components for the effect. */
125
+ color?: [number, number, number, number];
126
+ }
127
+ }