@scml/sc2-verlnir 1.0.5 → 1.0.7
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 +1 -40
- package/package.json +20 -4
- package/src/alert.d.ts +2 -2
- package/src/browser.d.ts +8 -8
- package/src/config.d.ts +45 -40
- package/src/debugbar.d.ts +15 -15
- package/src/dialog.d.ts +13 -13
- package/src/engine.d.ts +24 -24
- package/src/fullscreen.d.ts +11 -11
- package/src/global.d.ts +103 -103
- package/src/has.d.ts +7 -7
- package/src/idb.d.ts +21 -21
- package/src/jquery-shim.d.ts +26 -26
- package/src/l10n.d.ts +2 -2
- package/src/links.d.ts +13 -13
- package/src/loadscreen.d.ts +6 -6
- package/src/macro.d.ts +16 -16
- package/src/passage.d.ts +13 -13
- package/src/save.d.ts +38 -38
- package/src/scripting.d.ts +3 -3
- package/src/setting.d.ts +18 -18
- package/src/simpleaudio.d.ts +27 -27
- package/src/simplestore.d.ts +11 -11
- package/src/state.d.ts +79 -79
- package/src/story.d.ts +16 -16
- package/src/template.d.ts +5 -5
- package/src/ui.d.ts +31 -31
- package/src/uibar.d.ts +11 -11
- package/src/util.d.ts +26 -26
- package/src/version.d.ts +11 -11
- package/src/visibility.d.ts +7 -7
- package/src/wikifier.d.ts +24 -24
package/README.md
CHANGED
|
@@ -1,42 +1,3 @@
|
|
|
1
1
|
# @scml/sc2-verlnir
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
3
|
+
See [documentation](https://scml-type.pages.dev/packages/sc2-verlnir).
|
package/package.json
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scml/sc2-verlnir",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"private": false,
|
|
4
5
|
"description": "TypeScript type definitions for SugarCube 2",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"dol",
|
|
8
|
+
"mod-loader",
|
|
9
|
+
"scml",
|
|
10
|
+
"sugarcube",
|
|
11
|
+
"typescript",
|
|
12
|
+
"verlnir"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/Muromi-Rikka/scml-types/tree/main/packages/sugarcube-2-verlnir#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Muromi-Rikka/scml-types/issues"
|
|
17
|
+
},
|
|
5
18
|
"license": "MIT",
|
|
6
|
-
"private": false,
|
|
7
|
-
"type": "module",
|
|
8
19
|
"author": {
|
|
9
20
|
"name": "Rikka",
|
|
10
21
|
"email": "admin@rikka.cc",
|
|
@@ -12,17 +23,22 @@
|
|
|
12
23
|
},
|
|
13
24
|
"repository": {
|
|
14
25
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/Muromi-Rikka/scml-types.git",
|
|
26
|
+
"url": "git+https://github.com/Muromi-Rikka/scml-types.git",
|
|
16
27
|
"directory": "packages/sugarcube-2-verlnir"
|
|
17
28
|
},
|
|
18
29
|
"files": [
|
|
19
30
|
"src",
|
|
20
31
|
"README.md"
|
|
21
32
|
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"sideEffects": false,
|
|
22
35
|
"types": "./src/global.d.ts",
|
|
23
36
|
"exports": {
|
|
24
37
|
".": "./src/global.d.ts"
|
|
25
38
|
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
26
42
|
"devDependencies": {
|
|
27
43
|
"@types/jquery": "*"
|
|
28
44
|
},
|
package/src/alert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface AlertAPI {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
error(title: string | null, message: string, ex?: unknown): void;
|
|
3
|
+
fatal(title: string | null, message: string, ex?: unknown): never;
|
|
4
4
|
}
|
package/src/browser.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface BrowserAPI {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
readonly userAgent: string;
|
|
3
|
+
readonly isMobile: boolean;
|
|
4
|
+
readonly isGecko: boolean;
|
|
5
|
+
readonly isIE: boolean;
|
|
6
|
+
readonly ieVersion: number | null;
|
|
7
|
+
readonly isOpera: boolean;
|
|
8
|
+
readonly operaVersion: number | null;
|
|
9
|
+
readonly isVivaldi: boolean;
|
|
10
10
|
}
|
package/src/config.d.ts
CHANGED
|
@@ -10,65 +10,70 @@
|
|
|
10
10
|
UI settings.
|
|
11
11
|
*/
|
|
12
12
|
export interface ConfigHistoryAPI {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
controls: boolean;
|
|
14
|
+
maxStates: number;
|
|
15
|
+
maxSessionStates: number;
|
|
16
|
+
maxExpired: number;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface ConfigAudioAPI {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
pauseOnFadeToZero: boolean;
|
|
21
|
+
preloadMetadata: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ConfigMacrosAPI {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
ifAssignmentError: boolean;
|
|
26
|
+
maxLoopIterations: number;
|
|
27
|
+
typeSkipKey: string;
|
|
28
|
+
typeVisitedPassages: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface ConfigNavigationAPI {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
override: ((...args: unknown[]) => unknown) | null | undefined;
|
|
33
|
+
gotohell: unknown;
|
|
34
|
+
rememberYPos: unknown;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface ConfigPassagesAPI {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
descriptions:
|
|
39
|
+
| boolean
|
|
40
|
+
| Record<string, string>
|
|
41
|
+
| ((this: null) => string | undefined)
|
|
42
|
+
| null
|
|
43
|
+
| undefined;
|
|
44
|
+
displayTitles: boolean;
|
|
45
|
+
nobr: boolean;
|
|
46
|
+
onProcess: ((opts: { title: string; tags: string[]; text: string }) => string) | null | undefined;
|
|
47
|
+
start: string | null | undefined;
|
|
48
|
+
transitionOut: string | number | null | undefined;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
export interface ConfigSavesAPI {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
autoload: boolean | string | ((...args: unknown[]) => unknown) | null | undefined;
|
|
53
|
+
autosave: boolean | string[] | ((...args: unknown[]) => unknown) | null | undefined;
|
|
54
|
+
id: string;
|
|
55
|
+
isAllowed: ((...args: unknown[]) => unknown) | null | undefined;
|
|
56
|
+
slots: number;
|
|
57
|
+
tryDiskOnMobile: boolean;
|
|
58
|
+
version: unknown;
|
|
59
|
+
useLZString: number;
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
export interface ConfigUIAPI {
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
stowBarInitially: boolean | number;
|
|
64
|
+
updateStoryElements: boolean;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
export interface ConfigAPI {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
debug: boolean;
|
|
69
|
+
addVisitedLinkClass: boolean;
|
|
70
|
+
cleanupWikifierOutput: boolean;
|
|
71
|
+
loadDelay: number;
|
|
72
|
+
audio: ConfigAudioAPI;
|
|
73
|
+
history: ConfigHistoryAPI;
|
|
74
|
+
macros: ConfigMacrosAPI;
|
|
75
|
+
navigation: ConfigNavigationAPI;
|
|
76
|
+
passages: ConfigPassagesAPI;
|
|
77
|
+
saves: ConfigSavesAPI;
|
|
78
|
+
ui: ConfigUIAPI;
|
|
74
79
|
}
|
package/src/debugbar.d.ts
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
Watch Functions.
|
|
5
5
|
*/
|
|
6
6
|
export interface DebugBarWatchAPI {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
add(name: string, getValue: () => unknown): void;
|
|
8
|
+
all(): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
delete(name: string): void;
|
|
11
|
+
disable(name: string): void;
|
|
12
|
+
enable(name: string): void;
|
|
13
|
+
isEnabled(name: string): boolean;
|
|
14
|
+
toggle(name: string): void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface DebugBarAPI {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
init(): void;
|
|
19
|
+
isStowed(): boolean;
|
|
20
|
+
start(): void;
|
|
21
|
+
stow(): void;
|
|
22
|
+
toggle(): void;
|
|
23
|
+
unstow(): void;
|
|
24
|
+
watch: DebugBarWatchAPI;
|
|
25
25
|
}
|
package/src/dialog.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export interface DialogAPI {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
append(...args: unknown[]): DialogAPI;
|
|
3
|
+
body(): HTMLElement | undefined;
|
|
4
|
+
close(ev?: unknown): DialogAPI;
|
|
5
|
+
create(title?: string, classNames?: string): DialogAPI;
|
|
6
|
+
empty(): DialogAPI;
|
|
7
|
+
init(): void;
|
|
8
|
+
isOpen(classNames?: string): boolean;
|
|
9
|
+
open(options?: { top?: number }, onClose?: () => void): DialogAPI;
|
|
10
|
+
resize(options?: { top?: number }): void;
|
|
11
|
+
wiki(...args: unknown[]): DialogAPI;
|
|
12
|
+
wikiPassage(name: string): DialogAPI;
|
|
13
|
+
/** Deprecated Functions. */
|
|
14
|
+
setup(title?: string, classNames?: string): HTMLElement | undefined;
|
|
15
15
|
}
|
package/src/engine.d.ts
CHANGED
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/* Engine state types object (pseudo-enumeration). */
|
|
8
8
|
export interface EngineStatesAPI {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Idle: string;
|
|
10
|
+
Playing: string;
|
|
11
|
+
Rendering: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface EngineAPI {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
/* Constants. */
|
|
16
|
+
readonly States: EngineStatesAPI;
|
|
17
|
+
/* Minimum delay for DOM actions (in milliseconds). */
|
|
18
|
+
readonly minDomActionDelay: number;
|
|
19
|
+
init(): void;
|
|
20
|
+
start(): void;
|
|
21
|
+
restart(): void;
|
|
22
|
+
readonly state: string;
|
|
23
|
+
isIdle(): boolean;
|
|
24
|
+
isPlaying(): boolean;
|
|
25
|
+
isRendering(): boolean;
|
|
26
|
+
readonly lastPlay: number | null;
|
|
27
|
+
goTo(index: number): void;
|
|
28
|
+
go(delta: number): void;
|
|
29
|
+
backward(): void;
|
|
30
|
+
forward(): void;
|
|
31
|
+
show(passage: string, ...args: unknown[]): void;
|
|
32
|
+
play(passage?: string, ...args: unknown[]): void;
|
|
33
|
+
/* Legacy Functions. */
|
|
34
|
+
display(passage?: string, ...args: unknown[]): void;
|
|
35
|
+
flags: Record<string, unknown>;
|
|
36
36
|
}
|
package/src/fullscreen.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface FullscreenAPI {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
readonly vendor: unknown;
|
|
3
|
+
readonly element: Element | null;
|
|
4
|
+
isEnabled(): boolean;
|
|
5
|
+
isFullscreen(): boolean;
|
|
6
|
+
request(): Promise<void>;
|
|
7
|
+
exit(): Promise<void>;
|
|
8
|
+
toggle(): Promise<void>;
|
|
9
|
+
onChange(handler: () => void): void;
|
|
10
|
+
offChange(handler: () => void): void;
|
|
11
|
+
onError(handler: (err: unknown) => void): void;
|
|
12
|
+
offError(handler: (err: unknown) => void): void;
|
|
13
13
|
}
|
package/src/global.d.ts
CHANGED
|
@@ -3,114 +3,114 @@
|
|
|
3
3
|
testing for the object (e.g. `"SugarCube" in window`) and contains exported identifiers
|
|
4
4
|
for debugging purposes.
|
|
5
5
|
*/
|
|
6
|
-
import type { AlertAPI } from
|
|
7
|
-
import type { BrowserAPI } from
|
|
8
|
-
import type { ConfigAPI } from
|
|
9
|
-
import type { DebugBarAPI } from
|
|
10
|
-
import type { DialogAPI } from
|
|
11
|
-
import type { EngineAPI } from
|
|
12
|
-
import type { FullscreenAPI } from
|
|
13
|
-
import type { HasAPI } from
|
|
14
|
-
import type { IdbAPI } from
|
|
15
|
-
import type { L10nAPI } from
|
|
16
|
-
import type { LinksAPI } from
|
|
17
|
-
import type { LoadScreenAPI } from
|
|
18
|
-
import type { MacroAPI } from
|
|
19
|
-
import type { PassageAPI, PassageConstructor } from
|
|
20
|
-
import type { SaveAPI } from
|
|
21
|
-
import type { ScriptingAPI } from
|
|
22
|
-
import type { SettingAPI } from
|
|
23
|
-
import type { SimpleAudioAPI } from
|
|
24
|
-
import type { SimpleStoreAPI, SimpleStoreInstanceAPI } from
|
|
25
|
-
import type { StateAPI } from
|
|
26
|
-
import type { StoryAPI } from
|
|
27
|
-
import type { TemplateAPI } from
|
|
28
|
-
import type { UIBarAPI } from
|
|
29
|
-
import type { UIAPI } from
|
|
30
|
-
import type { UtilAPI } from
|
|
31
|
-
import type { VersionInfo } from
|
|
32
|
-
import type { VisibilityAPI } from
|
|
33
|
-
import type { WikifierAPI } from
|
|
6
|
+
import type { AlertAPI } from "./alert.d.ts";
|
|
7
|
+
import type { BrowserAPI } from "./browser.d.ts";
|
|
8
|
+
import type { ConfigAPI } from "./config.d.ts";
|
|
9
|
+
import type { DebugBarAPI } from "./debugbar.d.ts";
|
|
10
|
+
import type { DialogAPI } from "./dialog.d.ts";
|
|
11
|
+
import type { EngineAPI } from "./engine.d.ts";
|
|
12
|
+
import type { FullscreenAPI } from "./fullscreen.d.ts";
|
|
13
|
+
import type { HasAPI } from "./has.d.ts";
|
|
14
|
+
import type { IdbAPI } from "./idb.d.ts";
|
|
15
|
+
import type { L10nAPI } from "./l10n.d.ts";
|
|
16
|
+
import type { LinksAPI } from "./links.d.ts";
|
|
17
|
+
import type { LoadScreenAPI } from "./loadscreen.d.ts";
|
|
18
|
+
import type { MacroAPI } from "./macro.d.ts";
|
|
19
|
+
import type { PassageAPI, PassageConstructor } from "./passage.d.ts";
|
|
20
|
+
import type { SaveAPI } from "./save.d.ts";
|
|
21
|
+
import type { ScriptingAPI } from "./scripting.d.ts";
|
|
22
|
+
import type { SettingAPI } from "./setting.d.ts";
|
|
23
|
+
import type { SimpleAudioAPI } from "./simpleaudio.d.ts";
|
|
24
|
+
import type { SimpleStoreAPI, SimpleStoreInstanceAPI } from "./simplestore.d.ts";
|
|
25
|
+
import type { StateAPI } from "./state.d.ts";
|
|
26
|
+
import type { StoryAPI } from "./story.d.ts";
|
|
27
|
+
import type { TemplateAPI } from "./template.d.ts";
|
|
28
|
+
import type { UIBarAPI } from "./uibar.d.ts";
|
|
29
|
+
import type { UIAPI } from "./ui.d.ts";
|
|
30
|
+
import type { UtilAPI } from "./util.d.ts";
|
|
31
|
+
import type { VersionInfo } from "./version.d.ts";
|
|
32
|
+
import type { VisibilityAPI } from "./visibility.d.ts";
|
|
33
|
+
import type { WikifierAPI } from "./wikifier.d.ts";
|
|
34
34
|
|
|
35
35
|
declare global {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
36
|
+
const Alert: AlertAPI;
|
|
37
|
+
const Browser: BrowserAPI;
|
|
38
|
+
const Config: ConfigAPI;
|
|
39
|
+
const DebugBar: DebugBarAPI;
|
|
40
|
+
const Dialog: DialogAPI;
|
|
41
|
+
const Engine: EngineAPI;
|
|
42
|
+
const Fullscreen: FullscreenAPI;
|
|
43
|
+
const Has: HasAPI;
|
|
44
|
+
const L10n: L10nAPI;
|
|
45
|
+
const Links: LinksAPI;
|
|
46
|
+
const LoadScreen: LoadScreenAPI;
|
|
47
|
+
const Macro: MacroAPI;
|
|
48
|
+
const Passage: PassageConstructor;
|
|
49
|
+
const Save: SaveAPI;
|
|
50
|
+
const Scripting: ScriptingAPI;
|
|
51
|
+
const Setting: SettingAPI;
|
|
52
|
+
const SimpleAudio: SimpleAudioAPI;
|
|
53
|
+
const SimpleStore: SimpleStoreAPI;
|
|
54
|
+
const State: StateAPI;
|
|
55
|
+
const Story: StoryAPI;
|
|
56
|
+
const Template: TemplateAPI;
|
|
57
|
+
const UIBar: UIBarAPI;
|
|
58
|
+
const UI: UIAPI;
|
|
59
|
+
const Util: UtilAPI;
|
|
60
|
+
const Visibility: VisibilityAPI;
|
|
61
|
+
const Wikifier: WikifierAPI;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
/* Version object. */
|
|
64
|
+
const version: VersionInfo;
|
|
65
|
+
/* Session storage manager object. */
|
|
66
|
+
const session: SimpleStoreInstanceAPI | null;
|
|
67
|
+
/* Settings object. */
|
|
68
|
+
const settings: Record<string, unknown>;
|
|
69
|
+
/* Setup object. */
|
|
70
|
+
const setup: Record<string, unknown>;
|
|
71
|
+
/* Persistant storage manager object. */
|
|
72
|
+
const storage: SimpleStoreInstanceAPI | null;
|
|
73
|
+
const idb: IdbAPI;
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
/* Legacy aliases. */
|
|
76
|
+
const browser: BrowserAPI;
|
|
77
|
+
const config: ConfigAPI;
|
|
78
|
+
const has: HasAPI;
|
|
79
|
+
const History: StateAPI;
|
|
80
|
+
const state: StateAPI;
|
|
81
|
+
const tale: StoryAPI;
|
|
82
|
+
const TempVariables: StateAPI["temporary"];
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
84
|
+
interface Window {
|
|
85
|
+
SugarCube: {
|
|
86
|
+
Browser: BrowserAPI;
|
|
87
|
+
Config: ConfigAPI;
|
|
88
|
+
Dialog: DialogAPI;
|
|
89
|
+
Engine: EngineAPI;
|
|
90
|
+
Fullscreen: FullscreenAPI;
|
|
91
|
+
Has: HasAPI;
|
|
92
|
+
L10n: L10nAPI;
|
|
93
|
+
Macro: MacroAPI;
|
|
94
|
+
Passage: typeof Passage;
|
|
95
|
+
Save: SaveAPI;
|
|
96
|
+
Scripting: ScriptingAPI;
|
|
97
|
+
Setting: SettingAPI;
|
|
98
|
+
SimpleAudio: SimpleAudioAPI;
|
|
99
|
+
State: StateAPI;
|
|
100
|
+
Story: StoryAPI;
|
|
101
|
+
UI: UIAPI;
|
|
102
|
+
UIBar: UIBarAPI;
|
|
103
|
+
DebugBar: DebugBarAPI;
|
|
104
|
+
Util: UtilAPI;
|
|
105
|
+
Visibility: VisibilityAPI;
|
|
106
|
+
Wikifier: WikifierAPI;
|
|
107
|
+
session: SimpleStoreInstanceAPI | null;
|
|
108
|
+
settings: Record<string, unknown>;
|
|
109
|
+
setup: Record<string, unknown>;
|
|
110
|
+
storage: SimpleStoreInstanceAPI | null;
|
|
111
|
+
version: VersionInfo;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export {};
|
package/src/has.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* Module Exports. */
|
|
2
2
|
export interface HasAPI {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
readonly audio: boolean;
|
|
4
|
+
readonly fileAPI: boolean;
|
|
5
|
+
readonly geolocation: boolean;
|
|
6
|
+
readonly mutationObserver: boolean;
|
|
7
|
+
readonly performance: boolean;
|
|
8
|
+
readonly touch: boolean;
|
|
9
|
+
readonly transitionEndEvent: string;
|
|
10
10
|
}
|