@defold-typescript/library-types 0.18.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/NOTICE +52 -0
- package/README.md +78 -0
- package/api-doc/boom.boom.json +26 -0
- package/api-doc/bridge.bridge.json +1653 -0
- package/api-doc/bzAnim.bzLibrary.json +156 -0
- package/api-doc/defcon.console.json +109 -0
- package/api-doc/defmath.defmath.json +1381 -0
- package/api-doc/defsave.defsave.json +175 -0
- package/api-doc/deftest.deftest.json +71 -0
- package/api-doc/dicebag.dicebag.json +323 -0
- package/api-doc/event.event.json +238 -0
- package/api-doc/gooey.gooey.json +963 -0
- package/api-doc/immutable.immutable.json +63 -0
- package/api-doc/in.accelerometer.json +281 -0
- package/api-doc/in.button.json +148 -0
- package/api-doc/in.cursor.json +203 -0
- package/api-doc/in.gesture.json +206 -0
- package/api-doc/in.keyboard.json +45 -0
- package/api-doc/in.mapper.json +141 -0
- package/api-doc/in.onscreen.json +265 -0
- package/api-doc/in.state.json +195 -0
- package/api-doc/in.textbox.json +213 -0
- package/api-doc/in.triggers.json +1260 -0
- package/api-doc/lang.lang.json +411 -0
- package/api-doc/log.log.json +50 -0
- package/api-doc/metrics.fps.json +88 -0
- package/api-doc/metrics.mem.json +80 -0
- package/api-doc/monarch.monarch.json +1065 -0
- package/api-doc/monarch.transitions.easings.json +206 -0
- package/api-doc/monarch.transitions.gui.json +445 -0
- package/api-doc/nakama.engine.defold.json +165 -0
- package/api-doc/nakama.nakama.json +6574 -0
- package/api-doc/nakama.util.log.json +25 -0
- package/api-doc/narrator.narrator.json +150 -0
- package/api-doc/orthographic.camera.json +1019 -0
- package/api-doc/persist.persist.json +142 -0
- package/api-doc/platypus.platypus.json +631 -0
- package/api-doc/proto.proto.json +355 -0
- package/api-doc/rendy.rendy.json +408 -0
- package/api-doc/richtext.color.json +219 -0
- package/api-doc/richtext.richtext.json +382 -0
- package/api-doc/richtext.tags.json +67 -0
- package/api-doc/saver.saver.json +553 -0
- package/api-doc/saver.storage.json +174 -0
- package/api-doc/squid.squid.json +660 -0
- package/api-doc/starly.starly.json +488 -0
- package/api-doc/tweener.tweener.json +419 -0
- package/api-doc/yagames.yagames.json +1465 -0
- package/api-doc/zzfx.api.json +85 -0
- package/generated/boom.boom.d.ts +1585 -0
- package/generated/bridge.bridge.d.ts +533 -0
- package/generated/bzAnim.bzLibrary.d.ts +93 -0
- package/generated/defcon.console.d.ts +24 -0
- package/generated/defmath.defmath.d.ts +194 -0
- package/generated/defsave.defsave.d.ts +31 -0
- package/generated/deftest.deftest.d.ts +47 -0
- package/generated/dicebag.dicebag.d.ts +90 -0
- package/generated/event.event.d.ts +54 -0
- package/generated/gooey.gooey.d.ts +261 -0
- package/generated/immutable.immutable.d.ts +13 -0
- package/generated/in.accelerometer.d.ts +37 -0
- package/generated/in.button.d.ts +20 -0
- package/generated/in.cursor.d.ts +33 -0
- package/generated/in.gesture.d.ts +64 -0
- package/generated/in.keyboard.d.ts +18 -0
- package/generated/in.mapper.d.ts +23 -0
- package/generated/in.onscreen.d.ts +58 -0
- package/generated/in.state.d.ts +34 -0
- package/generated/in.textbox.d.ts +26 -0
- package/generated/in.triggers.d.ts +180 -0
- package/generated/lang.lang.d.ts +33 -0
- package/generated/log.log.d.ts +40 -0
- package/generated/metrics.fps.d.ts +16 -0
- package/generated/metrics.mem.d.ts +16 -0
- package/generated/monarch.monarch.d.ts +412 -0
- package/generated/monarch.transitions.easings.d.ts +65 -0
- package/generated/monarch.transitions.gui.d.ts +197 -0
- package/generated/nakama.engine.defold.d.ts +24 -0
- package/generated/nakama.nakama.d.ts +594 -0
- package/generated/nakama.util.log.d.ts +10 -0
- package/generated/narrator.narrator.d.ts +66 -0
- package/generated/orthographic.camera.d.ts +308 -0
- package/generated/persist.persist.d.ts +34 -0
- package/generated/platypus.platypus.d.ts +76 -0
- package/generated/proto.proto.d.ts +36 -0
- package/generated/rendy.rendy.d.ts +184 -0
- package/generated/richtext.color.d.ts +33 -0
- package/generated/richtext.richtext.d.ts +126 -0
- package/generated/richtext.tags.d.ts +12 -0
- package/generated/saver.saver.d.ts +44 -0
- package/generated/saver.storage.d.ts +16 -0
- package/generated/squid.squid.d.ts +106 -0
- package/generated/starly.starly.d.ts +148 -0
- package/generated/tweener.tweener.d.ts +151 -0
- package/generated/yagames.yagames.d.ts +279 -0
- package/generated/zzfx.api.d.ts +20 -0
- package/library-classification.json +726 -0
- package/library-targets.json +291 -0
- package/package.json +180 -0
- package/scripts/extract-api-doc.ts +418 -0
- package/scripts/sync-library-types.ts +542 -0
package/NOTICE
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@defold-typescript/library-types
|
|
2
|
+
=================================
|
|
3
|
+
|
|
4
|
+
This package vendors TypeScript type declarations derived from the Lua library
|
|
5
|
+
definitions published by the ts-defold/library project:
|
|
6
|
+
|
|
7
|
+
https://github.com/ts-defold/library
|
|
8
|
+
License: MIT
|
|
9
|
+
Pinned commit: 2fe3aed3352a913d2859e6e85d34a8b23d821368
|
|
10
|
+
|
|
11
|
+
The `.d.ts` sources under `generated/` are produced by codemodding the upstream
|
|
12
|
+
declarations — Defold core types (`vmath.*`, `hash`, `url`, engine handles) are
|
|
13
|
+
renamed to the `@defold-typescript/types` surface; all other content is left
|
|
14
|
+
byte-identical. The original copyright and license notices of the upstream
|
|
15
|
+
authors are retained.
|
|
16
|
+
|
|
17
|
+
Attributed upstream libraries (by their directory in ts-defold/library):
|
|
18
|
+
|
|
19
|
+
- monarch — Britzl, https://github.com/britzl/monarch
|
|
20
|
+
- defold-orthographic — Britzl, https://github.com/britzl/defold-orthographic
|
|
21
|
+
- gooey — Britzl, https://github.com/britzl/gooey
|
|
22
|
+
- defold-input — Britzl, https://github.com/britzl/defold-input
|
|
23
|
+
- platypus — Britzl, https://github.com/britzl/platypus
|
|
24
|
+
- defold-event — Insality, https://github.com/Insality/defold-event
|
|
25
|
+
- defold-richtext — Britzl, https://github.com/britzl/defold-richtext
|
|
26
|
+
- narrator — astrochili, https://github.com/astrochili/narrator
|
|
27
|
+
- defcon — Britzl, https://github.com/britzl/defcon
|
|
28
|
+
- defold-lang — Insality, https://github.com/Insality/defold-lang
|
|
29
|
+
- defold-saver — Insality, https://github.com/Insality/defold-saver
|
|
30
|
+
- defsave — subsoap, https://github.com/subsoap/defsave
|
|
31
|
+
- library-defold-persist — klaytonkowalski, https://github.com/klaytonkowalski/library-defold-persist
|
|
32
|
+
- defold-proto — Insality, https://github.com/Insality/defold-proto
|
|
33
|
+
- defmath — subsoap, https://github.com/subsoap/defmath
|
|
34
|
+
- dicebag — 8bitskull, https://github.com/8bitskull/dicebag
|
|
35
|
+
- defold-tweener — Insality, https://github.com/Insality/defold-tweener
|
|
36
|
+
- squid — paweljarosz, https://github.com/paweljarosz/squid
|
|
37
|
+
- starly — VowSoftware, https://github.com/VowSoftware/starly
|
|
38
|
+
- defold-log — Insality, https://github.com/Insality/defold-log
|
|
39
|
+
- defold-metrics — Britzl, https://github.com/britzl/defold-metrics
|
|
40
|
+
- deftest — Britzl, https://github.com/britzl/deftest
|
|
41
|
+
- lua-immutable — paweljarosz, https://github.com/paweljarosz/lua-immutable
|
|
42
|
+
- nakama-defold — Heroic Labs, https://github.com/heroiclabs/nakama-defold
|
|
43
|
+
- defold-yagames — indiesoftby, https://github.com/indiesoftby/defold-yagames
|
|
44
|
+
- defold-bridge — Playgama, https://github.com/Playgama/bridge-defold
|
|
45
|
+
- defold-zzfx — thejustinwalsh, https://github.com/thejustinwalsh/defold-zzfx
|
|
46
|
+
- boom — Britzl, https://github.com/britzl/boom
|
|
47
|
+
- bzAnim — jbp4444, https://github.com/jbp4444/bzAnim
|
|
48
|
+
- library-defold-rendy — klaytonkowalski, https://github.com/klaytonkowalski/library-defold-rendy
|
|
49
|
+
|
|
50
|
+
Each upstream library is distributed under its own license by its original
|
|
51
|
+
author. The ts-defold/library MIT license covers the TypeScript definition
|
|
52
|
+
packaging that this package's `generated/` output is derived from.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @defold-typescript/library-types
|
|
2
|
+
|
|
3
|
+
Vendored TypeScript type declarations for a curated set of popular Defold Lua
|
|
4
|
+
libraries, core-type-renamed against
|
|
5
|
+
[`@defold-typescript/types`](https://www.npmjs.com/package/@defold-typescript/types).
|
|
6
|
+
|
|
7
|
+
This is a support package for the
|
|
8
|
+
[`@defold-typescript`](https://github.com/defold-typescript/toolchain) toolchain.
|
|
9
|
+
You normally do not install it directly — it ships as a dependency of
|
|
10
|
+
[`@defold-typescript/cli`](https://www.npmjs.com/package/@defold-typescript/cli),
|
|
11
|
+
which reads it at runtime.
|
|
12
|
+
|
|
13
|
+
## Why it exists
|
|
14
|
+
|
|
15
|
+
Many popular Defold libraries are plain Lua, installed through the editor's
|
|
16
|
+
**Fetch Libraries** and carrying no `.script_api`, so there is nothing for the
|
|
17
|
+
CLI's `resolve` command to extract types from. For a curated set of those, this
|
|
18
|
+
package ships hand-vetted, ready-to-use TypeScript declarations.
|
|
19
|
+
|
|
20
|
+
When `resolve` encounters a declared dependency with no `.script_api`, it matches
|
|
21
|
+
it against this corpus by source identity, verifies the match against the
|
|
22
|
+
downloaded archive's Lua require paths, and materializes the corresponding
|
|
23
|
+
declaration into the project's `.defold-types/libraries/`. The import specifier is
|
|
24
|
+
the Lua `require` path — e.g. `import * as dicebag from 'dicebag.dicebag'` — so it
|
|
25
|
+
matches what Fetch Libraries installs at runtime.
|
|
26
|
+
|
|
27
|
+
## What's inside
|
|
28
|
+
|
|
29
|
+
- `generated/<module>.d.ts` — one ambient `declare module '<require-path>'` per
|
|
30
|
+
vendored module, core-type-renamed to the `@defold-typescript/types` surface.
|
|
31
|
+
- `library-classification.json`, `library-targets.json` — the registries mapping
|
|
32
|
+
each module to its upstream source and generated path. The CLI reads these to
|
|
33
|
+
drive matching and materialization.
|
|
34
|
+
- `api-doc/<module>.json` — ref-doc JSON extracted from each declaration, consumed
|
|
35
|
+
by the documentation site to render per-library API pages.
|
|
36
|
+
- `NOTICE` — upstream attribution for every vendored library.
|
|
37
|
+
|
|
38
|
+
## Provenance
|
|
39
|
+
|
|
40
|
+
Declarations are adapted from
|
|
41
|
+
[`ts-defold/library`](https://github.com/ts-defold/library) (MIT) at a pinned
|
|
42
|
+
commit, recorded per module in `library-targets.json`. ts-defold's hand-written
|
|
43
|
+
`declare module` files already model these libraries faithfully; the only surface
|
|
44
|
+
that differs is core-type naming. A codemod (`scripts/sync-library-types.ts`)
|
|
45
|
+
walks the TypeScript AST and rewrites **type references only** — property names,
|
|
46
|
+
JSDoc, `declare module`, and passthrough extensions (`LuaMultiReturn`, `LuaMap`)
|
|
47
|
+
stay byte-identical:
|
|
48
|
+
|
|
49
|
+
| ts-defold | `@defold-typescript/types` |
|
|
50
|
+
| --------- | -------------------------- |
|
|
51
|
+
| `hash`, `url` | `Hash`, `Url` |
|
|
52
|
+
| `vmath.vector3` / `vmath.vector4` / `vmath.matrix4` / `vmath.quat` | `Vector3` / `Vector4` / `Matrix4` / `Quaternion` |
|
|
53
|
+
| `node`, `texture`, … (engine handles) | `Opaque<"node">`, `Opaque<"texture">`, … |
|
|
54
|
+
|
|
55
|
+
The renamed names resolve against the ambient globals in `@defold-typescript/types`,
|
|
56
|
+
so no import injection is needed. Any `vmath.*` reference with no mapping is a hard
|
|
57
|
+
error at regeneration time, so a missing rename fails loud rather than degrading to
|
|
58
|
+
`any`. Nothing is authored by hand beyond the source pins, and the committed output
|
|
59
|
+
is guarded against drift in CI.
|
|
60
|
+
|
|
61
|
+
Regenerate after changing the rename table or re-pinning a source:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
bun run --filter @defold-typescript/library-types regen
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Direct use
|
|
68
|
+
|
|
69
|
+
The `exports` map exposes each module under a type-only subpath if you want a
|
|
70
|
+
single library's declarations without the CLI. These are ambient type declarations
|
|
71
|
+
only — there is no runtime code in this package. For the normal workflow, prefer
|
|
72
|
+
letting `@defold-typescript/cli resolve` materialize them for you; see the
|
|
73
|
+
[toolchain docs](https://github.com/defold-typescript/toolchain).
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
MIT. Vendored declarations retain their upstream authors' licenses, credited in
|
|
78
|
+
`NOTICE`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"info": {
|
|
3
|
+
"namespace": "boom.boom",
|
|
4
|
+
"brief": "Boom is a game framework built on top of Defold.",
|
|
5
|
+
"description": "Boom is a game framework built on top of Defold."
|
|
6
|
+
},
|
|
7
|
+
"elements": [
|
|
8
|
+
{
|
|
9
|
+
"type": "FUNCTION",
|
|
10
|
+
"name": "boom",
|
|
11
|
+
"brief": "Start a boom game. Call this from your own game script",
|
|
12
|
+
"description": "Start a boom game. Call this from your own game script",
|
|
13
|
+
"parameters": [
|
|
14
|
+
{
|
|
15
|
+
"name": "game",
|
|
16
|
+
"doc": "Game loop function",
|
|
17
|
+
"types": [
|
|
18
|
+
"() => void"
|
|
19
|
+
],
|
|
20
|
+
"is_optional": "False"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"returnvalues": []
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|