@sandustry-modding/types 0.3.1 → 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.
Files changed (65) hide show
  1. package/CHANGELOG.md +40 -11
  2. package/README.md +3 -0
  3. package/package.json +12 -2
  4. package/src/configs/index.d.ts +38 -0
  5. package/src/configs/modinfo.d.ts +751 -0
  6. package/src/configs/patches.d.ts +195 -0
  7. package/src/sandkit/api/action.d.ts +5 -0
  8. package/src/sandkit/api/blueprints.d.ts +5 -3
  9. package/src/sandkit/api/camera.d.ts +5 -0
  10. package/src/sandkit/api/effects.d.ts +28 -7
  11. package/src/sandkit/api/elements.d.ts +124 -39
  12. package/src/sandkit/api/energy.d.ts +8 -0
  13. package/src/sandkit/api/entities.d.ts +15 -8
  14. package/src/sandkit/api/events.d.ts +139 -2
  15. package/src/sandkit/api/excavation.d.ts +33 -3
  16. package/src/sandkit/api/factory.d.ts +6 -4
  17. package/src/sandkit/api/fire.d.ts +7 -4
  18. package/src/sandkit/api/game.d.ts +8 -2
  19. package/src/sandkit/api/grid.d.ts +72 -23
  20. package/src/sandkit/api/hooks.d.ts +362 -2
  21. package/src/sandkit/api/i18n.d.ts +65 -20
  22. package/src/sandkit/api/input.d.ts +15 -0
  23. package/src/sandkit/api/items.d.ts +7 -0
  24. package/src/sandkit/api/lights.d.ts +55 -8
  25. package/src/sandkit/api/maps.d.ts +10 -1
  26. package/src/sandkit/api/patterns.d.ts +22 -0
  27. package/src/sandkit/api/pickups.d.ts +14 -8
  28. package/src/sandkit/api/pipes.d.ts +9 -5
  29. package/src/sandkit/api/player.d.ts +29 -15
  30. package/src/sandkit/api/progression.d.ts +8 -0
  31. package/src/sandkit/api/reactions.d.ts +11 -0
  32. package/src/sandkit/api/rendering.d.ts +25 -2
  33. package/src/sandkit/api/resources.d.ts +5 -0
  34. package/src/sandkit/api/schedule.d.ts +7 -0
  35. package/src/sandkit/api/settings.d.ts +7 -0
  36. package/src/sandkit/api/shared.d.ts +13 -3
  37. package/src/sandkit/api/signals.d.ts +29 -0
  38. package/src/sandkit/api/sound.d.ts +14 -8
  39. package/src/sandkit/api/structureBehaviors.d.ts +8 -0
  40. package/src/sandkit/api/structures.d.ts +353 -43
  41. package/src/sandkit/api/tech.d.ts +73 -9
  42. package/src/sandkit/api/terrains.d.ts +25 -13
  43. package/src/sandkit/api/triggers.d.ts +10 -0
  44. package/src/sandkit/api/ui.d.ts +146 -1
  45. package/src/sandkit/api/upgrades.d.ts +2 -1
  46. package/src/sandkit/api/utils.d.ts +10 -5
  47. package/src/sandkit/api/world.d.ts +30 -25
  48. package/src/sandkit/index.d.ts +12 -1
  49. package/src/shared/api/elements.d.ts +36 -22
  50. package/src/shared/api/grid.d.ts +11 -6
  51. package/src/shared/api/player.d.ts +8 -4
  52. package/src/shared/api/shared.d.ts +2 -1
  53. package/src/shared/api/structures.d.ts +55 -17
  54. package/src/shared/api/terrains.d.ts +39 -23
  55. package/src/shared/api/ui.d.ts +5 -0
  56. package/src/shared/api/world.d.ts +9 -9
  57. package/src/worker/api/effects.d.ts +11 -3
  58. package/src/worker/api/elements.d.ts +54 -19
  59. package/src/worker/api/events.d.ts +31 -2
  60. package/src/worker/api/fire.d.ts +4 -2
  61. package/src/worker/api/grid.d.ts +10 -2
  62. package/src/worker/api/hooks.d.ts +68 -2
  63. package/src/worker/api/lights.d.ts +13 -3
  64. package/src/worker/api/shared.d.ts +12 -2
  65. package/src/worker/sandkit-api.d.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -5,7 +5,34 @@ 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
8
+ ## Unreleased
9
+
10
+ ## 0.4.0 - 2026-08-29
11
+
12
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.4.0
13
+
14
+ ### Added
15
+
16
+ - `npm run release` script: changelog/registry/auth checks, `validate`, then `npm publish` (optional `--dry-run`)
17
+ - `src/configs/` types for `modinfo.json` and `patches.json` (`@sandustry-modding/types/configs`), with JSDoc on every key
18
+ - Stronger structure definition fields: `tooltipHover`, `spanTiles`, `linkedClearance`, spritesheet/ui render blocks
19
+ - Stronger `TechDefinition` fields used by tech nodes (`cost`, `unlocks`, `currencyType`, `branch`)
20
+ - JSDoc `@example` blocks on many Sandkit members (main, worker, and configs)
21
+ - Prebuilt Docsify search index (`docs/assets/search-index.js`) so API search works without a runtime crawl
22
+ - Nested namespace roots in the docs sidebar (`sandkit`, `sandkit.api`, worker, engine, react)
23
+
24
+ ### Changed
25
+
26
+ - Official `@see` links use a short “Official docs” label that deep-links to Sandkit HTML sections
27
+ - Docs search ranks full runtime paths (`sandkit.api.settings.get()`) instead of local member names only
28
+ - Move Full API reference to the bottom of the docs root nav block
29
+ - Drop the page TOC plugin and the nested `docs/api/_sidebar.md` in favor of one site sidebar
30
+
31
+ ## 0.3.1 - 2026-08-27
32
+
33
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.1
34
+
35
+
9
36
 
10
37
  ### Fixed
11
38
 
@@ -17,14 +44,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
44
 
18
45
  - `npm run validate` gate: declaration typecheck, unit tests, and packed-tarball consumer probes
19
46
 
20
- ## [0.3.0] - 2026-08-27
47
+ ## 0.3.0 - 2026-08-27
48
+
49
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.0
21
50
 
22
51
  ### Changed
23
52
 
24
53
  - 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
54
  - Show local names for API member headings in the Docsify reference (full runtime path stays under each heading)
26
55
 
27
- ## [0.2.0] - 2026-08-27
56
+ ## 0.2.0 - 2026-08-27
57
+
58
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.2.0
28
59
 
29
60
  ### Added
30
61
 
@@ -35,13 +66,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
35
66
 
36
67
  - 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
68
 
38
- ## [0.1.1] - 2026-08-27
69
+ ## 0.1.1 - 2026-08-27
70
+
71
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.1
39
72
 
40
73
  ### Changed
41
74
 
42
75
  - Export subpaths (`./*`) so mods can import declaration modules such as `@sandustry-modding/types/sandkit/engine`
43
76
 
44
- ## [0.1.0] - 2026-08-27
77
+ ## 0.1.0 - 2026-08-27
78
+
79
+ https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.0
45
80
 
46
81
  ### Added
47
82
 
@@ -51,9 +86,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
51
86
  - Shared base shapes under `shared/` for main and worker reuse
52
87
  - Ambient `sandkit` free variable and type aliases via `global.d.ts`
53
88
  - Docsify API reference generated from the declarations
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
59
- [0.1.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.0
package/README.md CHANGED
@@ -19,6 +19,7 @@ Folder layout mirrors runtime shape so you can jump from code to the matching `.
19
19
  | `src/global.d.ts` | Ambient `sandkit` free variable and type aliases |
20
20
  | `src/worker/` | Worker-thread `sandkit.api` (see `WorkerSandkitApi`) |
21
21
  | `src/shared/` | Internal base shapes reused by main and worker declarations |
22
+ | `src/configs/` | `modinfo.json` / `patches.json` schemas (not a runtime object) |
22
23
 
23
24
  ## Runtime shape vs `export namespace`
24
25
 
@@ -53,6 +54,7 @@ Deep declaration modules are also available, for example:
53
54
 
54
55
  ```ts
55
56
  import type { RetroConsoleGame } from "@sandustry-modding/types/sandkit/engine";
57
+ import type { ModInfo, BundlePatch } from "@sandustry-modding/types/configs";
56
58
  ```
57
59
 
58
60
  ## Usage
@@ -60,6 +62,7 @@ import type { RetroConsoleGame } from "@sandustry-modding/types/sandkit/engine";
60
62
  - **Main mod (`main.js`):** use the ambient free name `sandkit`. Type aliases such as `SandkitApi` are global; do not import a value binding.
61
63
  - **Worker mod (`worker.js`):** type `sandkit.api` as `WorkerSandkitApi`. Worker and main APIs overlap but are not interchangeable.
62
64
  - **Shared folder:** not a runtime namespace. It holds domain shapes and API bases that main and worker modules extend.
65
+ - **Configs folder:** `modinfo.json` and `patches.json` schemas (`@sandustry-modding/types/configs`). Not part of the live `sandkit` object.
63
66
 
64
67
  ## Maintaining types
65
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandustry-modding/types",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript declarations and API docs for the Sandustry Sandkit host API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -67,6 +67,15 @@
67
67
  "./src/worker/*/*.d.ts",
68
68
  "./src/worker/*/*/index.d.ts"
69
69
  ]
70
+ },
71
+ "./configs": {
72
+ "types": "./src/configs/index.d.ts"
73
+ },
74
+ "./configs/*": {
75
+ "types": [
76
+ "./src/configs/*.d.ts",
77
+ "./src/configs/*/index.d.ts"
78
+ ]
70
79
  }
71
80
  },
72
81
  "files": [
@@ -83,7 +92,8 @@
83
92
  "typecheck": "tsc -p tsconfig.json --noEmit",
84
93
  "verify-package": "node scripts/verify-package.mjs",
85
94
  "validate": "npm run typecheck && npm test && npm run verify-package",
86
- "prepack": "npm run validate"
95
+ "prepack": "npm run validate",
96
+ "release": "node scripts/publish.mjs"
87
97
  },
88
98
  "devDependencies": {
89
99
  "@types/react": "^18.3.1",
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Sandkit mod file schemas: `modinfo.json` and `patches.json`.
3
+ *
4
+ * These are not runtime `sandkit` properties. Import from
5
+ * `@sandustry-modding/types/configs` when typing mod folder config files.
6
+ *
7
+ * @module
8
+ *
9
+ * @see [Official docs](https://sandustry.com/sandkit.html#mod-files-heading)
10
+ */
11
+
12
+ export type {
13
+ ConfigSchemaBoolean,
14
+ ConfigSchemaChoice,
15
+ ConfigSchemaChoiceOption,
16
+ ConfigSchemaEntry,
17
+ ConfigSchemaNumber,
18
+ ModGameVersion,
19
+ ModInfo,
20
+ ModMapBlueprints,
21
+ ModMapColorMapping,
22
+ ModMapColorMappingLayers,
23
+ ModMapDefinition,
24
+ ModMapDepthLight,
25
+ ModMapParallax,
26
+ ModMapPoint,
27
+ ModMapTopBounds,
28
+ ModProvide,
29
+ TextureOverride,
30
+ } from "./modinfo";
31
+
32
+ export type {
33
+ BundlePatch,
34
+ BundlePatchRegex,
35
+ BundlePatchesFile,
36
+ PatchOperation,
37
+ PatchTargetFile,
38
+ } from "./patches";