@scml/sc2-verlnir 1.0.4 → 1.0.5
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 +42 -0
- package/package.json +9 -6
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @scml/sc2-verlnir
|
|
2
|
+
|
|
3
|
+
TypeScript type definitions for SugarCube 2 API (based on verlnir).
|
|
4
|
+
|
|
5
|
+
This package uses type declarations from `src/` directly in the repository. No `download` or `build` required.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D @scml/sc2-verlnir
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Main entry (global SugarCube types)
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
/// <reference types="@scml/sc2-verlnir" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The main entry `./src/global.d.ts` declares SugarCube 2's global API.
|
|
22
|
+
|
|
23
|
+
## Types
|
|
24
|
+
|
|
25
|
+
### Global APIs (via `declare global`)
|
|
26
|
+
- **`Story`** – `StoryAPI` – Story and passage access.
|
|
27
|
+
- **`Config`** – `ConfigAPI` – Engine configuration.
|
|
28
|
+
- **`State`** – `StateAPI` – Game state, history, temporary variables.
|
|
29
|
+
- **`Passage`** – `PassageConstructor` – Current passage.
|
|
30
|
+
- **`Save`** – `SaveAPI` – Save/load.
|
|
31
|
+
- **`Dialog`** – `DialogAPI` – Dialog system.
|
|
32
|
+
- **`Engine`** – `EngineAPI` – Engine control.
|
|
33
|
+
- **`Macro`** – `MacroAPI` – Macro definitions.
|
|
34
|
+
- **`Scripting`** – `ScriptingAPI` – Script evaluation.
|
|
35
|
+
- **`Template`** – `TemplateAPI` – Template engine.
|
|
36
|
+
- **`UI`** / **`UIBar`** – `UIAPI` / `UIBarAPI` – UI components.
|
|
37
|
+
- **`Alert`**, **`Browser`**, **`Config`**, **`DebugBar`**, **`Fullscreen`**, **`Has`**, **`L10n`**, **`Links`**, **`LoadScreen`**, **`Setting`**, **`SimpleAudio`**, **`SimpleStore`**, **`Util`**, **`Visibility`**, **`Wikifier`** – Other SugarCube APIs.
|
|
38
|
+
- **`version`** – `VersionInfo`.
|
|
39
|
+
- **`session`**, **`storage`** – `SimpleStoreInstanceAPI | null`.
|
|
40
|
+
- **`settings`**, **`setup`** – `Record<string, unknown>`.
|
|
41
|
+
- **`idb`** – `IdbAPI`.
|
|
42
|
+
- **`window.SugarCube`** – Object containing all above APIs for detection and debugging.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scml/sc2-verlnir",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "TypeScript type definitions for SugarCube 2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -15,16 +15,19 @@
|
|
|
15
15
|
"url": "https://github.com/Muromi-Rikka/scml-types.git",
|
|
16
16
|
"directory": "packages/sugarcube-2-verlnir"
|
|
17
17
|
},
|
|
18
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
19
22
|
"types": "./src/global.d.ts",
|
|
20
23
|
"exports": {
|
|
21
24
|
".": "./src/global.d.ts"
|
|
22
25
|
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/jquery": "*"
|
|
28
|
+
},
|
|
23
29
|
"scripts": {
|
|
24
30
|
"typecheck": "tsc --noEmit",
|
|
25
31
|
"publint": "publint"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/jquery": "*"
|
|
29
32
|
}
|
|
30
|
-
}
|
|
33
|
+
}
|