@sandustry-modding/types 0.1.0 → 0.3.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/README.md +36 -12
- package/docs/Changelog.md +46 -0
- package/docs/README.md +62 -0
- package/package.json +11 -10
- 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/CHANGELOG.md +0 -19
- 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
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,7 +37,9 @@ 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
|
-
|
|
40
|
+
### Project config (preferred)
|
|
41
|
+
|
|
42
|
+
Add the package to `compilerOptions.types` in `tsconfig.json` or `jsconfig.json`:
|
|
39
43
|
|
|
40
44
|
```json
|
|
41
45
|
{
|
|
@@ -45,6 +49,26 @@ In `tsconfig.json`, include the package types (or reference them from an ambient
|
|
|
45
49
|
}
|
|
46
50
|
```
|
|
47
51
|
|
|
52
|
+
If you already list other packages in `types` (for example `"react"` or `"node"`), keep those entries and add `"@sandustry-modding/types"` to the same array. A non-empty `types` list replaces TypeScript’s default auto-inclusion of all `@types/*` packages.
|
|
53
|
+
|
|
54
|
+
`jsconfig.json` uses the same shape for JavaScript mods.
|
|
55
|
+
|
|
56
|
+
### Per-file reference
|
|
57
|
+
|
|
58
|
+
You can also pull the ambient types into one file:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
/// <reference types="@sandustry-modding/types" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
That triple-slash directive works in `.ts` and `.js` (including checked JS with `checkJs`). Put it at the top of `main.js` / `worker.js`, or in a small ambient `.d.ts` included by your project.
|
|
65
|
+
|
|
66
|
+
Deep declaration modules are also available, for example:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import type { RetroConsoleGame } from "@sandustry-modding/types/sandkit/engine";
|
|
70
|
+
```
|
|
71
|
+
|
|
48
72
|
## Usage
|
|
49
73
|
|
|
50
74
|
- **Main mod (`main.js`):** use the ambient free name `sandkit`. Type aliases such as `SandkitApi` are global; do not import a value binding.
|
|
@@ -53,7 +77,7 @@ In `tsconfig.json`, include the package types (or reference them from an ambient
|
|
|
53
77
|
|
|
54
78
|
## Maintaining types
|
|
55
79
|
|
|
56
|
-
Edit `.d.ts` files
|
|
80
|
+
Edit `.d.ts` files under `src/`. Regenerate the Docsify API reference after JSDoc changes.
|
|
57
81
|
|
|
58
82
|
## Docs site
|
|
59
83
|
|
|
@@ -63,4 +87,4 @@ Regenerate the Docsify API reference from these declarations:
|
|
|
63
87
|
npm run docs:api
|
|
64
88
|
```
|
|
65
89
|
|
|
66
|
-
Output lands in `docs/api/`. `npm run docs` runs that step, then serves the docs site.
|
|
90
|
+
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.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-08-27
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- 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
|
|
13
|
+
- Show local names for API member headings in the Docsify reference (full runtime path stays under each heading)
|
|
14
|
+
|
|
15
|
+
## [0.2.0] - 2026-08-27
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- 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
|
|
20
|
+
- JSDoc `@see` links back to the official Sandkit page on documented members
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Canonical mutation names match official docs (`createAtCell`, `grid.mutate`, `getTypeById`, and similar). Old names stay as `@deprecated` aliases (`*WhenIdle`, `api.world`, `getTypeFromId`, and similar)
|
|
25
|
+
|
|
26
|
+
## [0.1.1] - 2026-08-27
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Export subpaths (`./*`) so mods can import declaration modules such as `@sandustry-modding/types/sandkit/engine`
|
|
31
|
+
|
|
32
|
+
## [0.1.0] - 2026-08-27
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Initial public release of `@sandustry-modding/types`
|
|
37
|
+
- TypeScript declarations for main-thread `sandkit` (`sandkit/api`, `sandkit/engine`, `sandkit/enums`, `sandkit/react`)
|
|
38
|
+
- Worker-thread declarations under `worker/` (`WorkerSandkitApi`)
|
|
39
|
+
- Shared base shapes under `shared/` for main and worker reuse
|
|
40
|
+
- Ambient `sandkit` free variable and type aliases via `global.d.ts`
|
|
41
|
+
- Docsify API reference generated from the declarations
|
|
42
|
+
|
|
43
|
+
[0.3.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.0
|
|
44
|
+
[0.2.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.2.0
|
|
45
|
+
[0.1.1]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.1
|
|
46
|
+
[0.1.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.0
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Sandkit API
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> **Unofficial** community docs. Not affiliated with Lantto Games, Hooded Horse, or the [official Sandustry wiki](https://wiki.hoodedhorse.com/Sandustry/Sandustry_Official_Wiki). See the [official Sandkit docs](https://sandustry.com/sandkit.html).
|
|
5
|
+
|
|
6
|
+
Community TypeScript reference for the live Sandustry `sandkit` host API. Package: [`@sandustry-modding/types`](https://www.npmjs.com/package/@sandustry-modding/types).
|
|
7
|
+
|
|
8
|
+
## Start here
|
|
9
|
+
|
|
10
|
+
| Go to | When you need |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| [Namespaces](modules.md) | Browse namespaces by group |
|
|
13
|
+
| [Full API reference](full.md) | All namespaces on one page |
|
|
14
|
+
| [Main thread](api/sandkit.api.md) | `main.js` APIs (`sandkit.api`) |
|
|
15
|
+
| [Worker thread](api/sandkit.api.worker.md) | `worker.js` APIs (subset + direct mutations) |
|
|
16
|
+
| [Engine](api/sandkit.engine.md) | Escape hatch (`sandkit.engine`) |
|
|
17
|
+
| [Enums](api/sandkit.enums.md) | Runtime enum values |
|
|
18
|
+
| [React](api/sandkit.react.md) | HUD JSX helpers |
|
|
19
|
+
|
|
20
|
+
## Install types
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @sandustry-modding/types
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Project config (preferred)
|
|
27
|
+
|
|
28
|
+
In `tsconfig.json` or `jsconfig.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"compilerOptions": {
|
|
33
|
+
"types": ["@sandustry-modding/types"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If `types` already lists other packages (for example `"react"` or `"node"`), add `"@sandustry-modding/types"` to that array. A non-empty `types` list replaces auto-inclusion of all `@types/*` packages.
|
|
39
|
+
|
|
40
|
+
### Per-file reference
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
/// <reference types="@sandustry-modding/types" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Works in `.ts` and `.js` (including checked JS). Put it at the top of a source file, or in an ambient `.d.ts` included by the project.
|
|
47
|
+
|
|
48
|
+
Use the ambient `sandkit` free name in `main.js`. In `worker.js`, type the API as `WorkerSandkitApi` — worker and main surfaces overlap but are not interchangeable.
|
|
49
|
+
|
|
50
|
+
## Also useful
|
|
51
|
+
|
|
52
|
+
- [Official Sandkit docs](https://sandustry.com/sandkit.html)
|
|
53
|
+
- [Sandustry Mod Template](https://sandustry-modding.github.io/SandustryModTemplate/#/)
|
|
54
|
+
- [Official Sandustry wiki](https://wiki.hoodedhorse.com/Sandustry/Sandustry_Official_Wiki)
|
|
55
|
+
|
|
56
|
+
## Regenerate
|
|
57
|
+
|
|
58
|
+
From the package repo root:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm run docs:api
|
|
62
|
+
```
|
package/package.json
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandustry-modding/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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://
|
|
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
|
+
"./*": {
|
|
21
|
+
"types": "./src/*"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"files": [
|
|
21
|
-
"
|
|
22
|
-
"sandkit/**/*.d.ts",
|
|
23
|
-
"shared/**/*.d.ts",
|
|
24
|
-
"worker/**/*.d.ts",
|
|
25
|
+
"src/**/*.d.ts",
|
|
25
26
|
"CHANGELOG.md",
|
|
27
|
+
"docs/Changelog.md",
|
|
26
28
|
"LICENSE",
|
|
27
|
-
"README.md"
|
|
28
|
-
"ATTRIBUTION.md"
|
|
29
|
+
"README.md"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"docs": "npm run docs:api && npm run docs:serve",
|
|
@@ -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
|
+
}
|