@rohal12/spindle 0.4.0 → 0.5.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/dist/pkg/types/index.d.ts +26 -0
- package/package.json +1 -1
|
@@ -85,6 +85,23 @@ export interface SettingsAPI {
|
|
|
85
85
|
hasAny(): boolean;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* A parsed passage from the story data.
|
|
90
|
+
* @see {@link ../../src/parser.ts} for the implementation.
|
|
91
|
+
*/
|
|
92
|
+
export interface Passage {
|
|
93
|
+
/** Passage ID from the story data. */
|
|
94
|
+
pid: number;
|
|
95
|
+
/** Passage name. */
|
|
96
|
+
name: string;
|
|
97
|
+
/** Tags from the passage header. */
|
|
98
|
+
tags: string[];
|
|
99
|
+
/** Metadata from the Twee 3 passage header (e.g. position, size, or custom keys). */
|
|
100
|
+
metadata: Record<string, string>;
|
|
101
|
+
/** Raw passage content. */
|
|
102
|
+
content: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
88
105
|
/**
|
|
89
106
|
* The main Story API available as `window.Story` at runtime.
|
|
90
107
|
* Provides access to variables, navigation, save/load, and visit tracking.
|
|
@@ -144,9 +161,18 @@ export interface StoryAPI {
|
|
|
144
161
|
/** Check if all of the given passages have been rendered. */
|
|
145
162
|
hasRenderedAll(...names: string[]): boolean;
|
|
146
163
|
|
|
164
|
+
/** Return the full Passage object for the current passage. */
|
|
165
|
+
currentPassage(): Passage | undefined;
|
|
166
|
+
|
|
167
|
+
/** Return the full Passage object for the previous passage in history. */
|
|
168
|
+
previousPassage(): Passage | undefined;
|
|
169
|
+
|
|
147
170
|
/** The story title. */
|
|
148
171
|
readonly title: string;
|
|
149
172
|
|
|
173
|
+
/** The current passage name. */
|
|
174
|
+
readonly passage: string;
|
|
175
|
+
|
|
150
176
|
/** The settings API. */
|
|
151
177
|
readonly settings: SettingsAPI;
|
|
152
178
|
|