@inkweave/core 1.0.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.
@@ -0,0 +1,4 @@
1
+ import { Story } from 'inkjs/engine/Story';
2
+ import { InkStory } from './story/InkStory';
3
+ import { InkStoryOptions } from './types';
4
+ export declare function createInkStory(source: string | Story, options?: InkStoryOptions): InkStory;
@@ -0,0 +1,10 @@
1
+ import { Choice } from '../types';
2
+ import { Choice as InkChoice } from 'inkjs/engine/Choice';
3
+ export declare class ChoiceParser {
4
+ private static _tags;
5
+ private static readonly excludeKeys;
6
+ static get tags(): Map<string, (choice: Choice, val?: string) => void>;
7
+ static clear: () => void;
8
+ static add: (tag: string, callback: (choice: Choice, val?: string) => void) => void;
9
+ static process: (item: InkChoice, choice: Choice) => Choice | undefined;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { InkStory } from '../story/InkStory';
2
+ export declare class ExternalFunctions {
3
+ private static _functions;
4
+ static get functions(): Map<string, Function>;
5
+ static set functions(value: Map<string, Function>);
6
+ static add(id: string, func: Function): void;
7
+ static get(id: string): Function | undefined;
8
+ static bind(ink: InkStory, id: string): void;
9
+ static clear(): void;
10
+ }
@@ -0,0 +1,20 @@
1
+ export interface ParserLine {
2
+ text: string;
3
+ tags: string[];
4
+ classes: string[];
5
+ }
6
+ export declare class Parser {
7
+ private static _tags;
8
+ private static _patterns;
9
+ static get tags(): {
10
+ [key: string]: Function;
11
+ };
12
+ static get patterns(): {
13
+ matcher: string | RegExp;
14
+ callback: Function;
15
+ }[];
16
+ static clear: () => void;
17
+ static tag(tag: string, callback: Function): void;
18
+ static pattern(pattern: string | RegExp, callback: Function): void;
19
+ static process: (text: string, tags?: string[]) => string;
20
+ }
@@ -0,0 +1,11 @@
1
+ import { InkStoryContext } from '../types';
2
+ export type PatchFunction = (this: InkStoryContext, content: string) => void;
3
+ export declare class Patches {
4
+ private static _patches;
5
+ private static _options;
6
+ static get patches(): PatchFunction[];
7
+ static set patches(value: PatchFunction[]);
8
+ static add(callback: PatchFunction | null, patchOptions?: Record<string, unknown>): void;
9
+ static apply(story: InkStoryContext | object, content: string): void;
10
+ static clear(): void;
11
+ }
@@ -0,0 +1,18 @@
1
+ import { InkStory } from '../story/InkStory';
2
+ type TagFunction = (val: string | null | undefined, ink: InkStory) => void;
3
+ export declare class Tags {
4
+ private static _functions;
5
+ private static readonly excludeKeys;
6
+ static get functions(): Map<string, TagFunction>;
7
+ static clear(): void;
8
+ static add(tagName: string, callback: TagFunction): void;
9
+ static process: (ink: InkStory, inputString: string) => void;
10
+ }
11
+ export declare const splitAtCharacter: (text: string, character: string) => {
12
+ before: string;
13
+ after?: undefined;
14
+ } | {
15
+ before: string;
16
+ after: string;
17
+ } | undefined;
18
+ export {};