squiffy-runtime 6.0.0-alpha.1 → 6.0.0-alpha.10

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.
@@ -0,0 +1,51 @@
1
+ export interface SquiffyInitOptions {
2
+ element: HTMLElement;
3
+ story: Story;
4
+ scroll?: string;
5
+ persist?: boolean;
6
+ onSet?: (attribute: string, value: any) => void;
7
+ }
8
+ export interface SquiffySettings {
9
+ scroll: string;
10
+ persist: boolean;
11
+ onSet: (attribute: string, value: any) => void;
12
+ }
13
+ export interface SquiffyApi {
14
+ restart: () => void;
15
+ get: (attribute: string) => any;
16
+ set: (attribute: string, value: any) => void;
17
+ clickLink: (link: HTMLElement) => boolean;
18
+ update: (story: Story) => void;
19
+ }
20
+ interface SquiffyJsFunctionApi {
21
+ get: (attribute: string) => any;
22
+ set: (attribute: string, value: any) => void;
23
+ ui: {
24
+ transition: (f: any) => void;
25
+ };
26
+ story: {
27
+ go: (section: string) => void;
28
+ };
29
+ }
30
+ export interface Story {
31
+ js: ((squiffy: SquiffyJsFunctionApi, get: (attribute: string) => any, set: (attribute: string, value: any) => void) => void)[];
32
+ start: string;
33
+ id?: string | null;
34
+ sections: Record<string, Section>;
35
+ }
36
+ export interface Section {
37
+ text?: string;
38
+ clear?: boolean;
39
+ attributes?: string[];
40
+ jsIndex?: number;
41
+ passages?: Record<string, Passage>;
42
+ passageCount?: number;
43
+ }
44
+ export interface Passage {
45
+ text?: string;
46
+ clear?: boolean;
47
+ attributes?: string[];
48
+ jsIndex?: number;
49
+ }
50
+ export declare const init: (options: SquiffyInitOptions) => SquiffyApi;
51
+ export {};