import { Constructable } from "../action/constructable"; import { Scene } from "../elements/scene"; import { SceneAction } from "../action/actions/sceneAction"; import { Persistent, PersistentContent } from "../elements/persistent"; import { Service } from "../elements/service"; export declare enum Origins { topLeft = "top left", topRight = "top right", bottomLeft = "bottom left", bottomRight = "bottom right" } export interface IStoryConfig { origin: Origins; } export declare class Story extends Constructable, Story> { constructor(name: string, config?: IStoryConfig); /** * Set the entry scene of the story * @example * ```typescript * const story = new Story("story"); * const scene = new Scene("scene"); * story.entry(scene); // The story will start from this scene * ``` */ entry(scene: Scene): this; /** * Register a Persistent to the story * * You can't use a Persistent that isn't registered to the story */ registerPersistent(persistent: Persistent): this; /** * Create a Persistent and register it to the story * @example * ```typescript * const persistent = story.createPersistent("playerData", { * name: "persistent", * }); * * // is equivalent to * const persistent = new Persistent("playerData", { * name: "persistent", * }); * story.registerPersistent(persistent); * ``` */ createPersistent(namespace: string, defaultContent: T): Persistent; /** * Register a Service to the story * * **Note**: service name should be unique */ registerService(name: string, service: Service): this; /** * Get a registered service, throw an error if the service isn't found */ getService(name: string): T; /** * Returns a 64-bit hash of the story * * The hash is calculated by the stringified story. * * If `strict` is true, the hash will be calculated by the stringified story with strict mode. * * In strict mode, the hash will be calculated * - With all the Lambda functions stringified (If the lambda function is changed, the hash will be different) * * However, the hash is **not** calculated with the text content of the story. */ hash(strict?: boolean): string; stringify(strict?: boolean): string; getScene(name: string | Scene, assert?: false): Scene | null; }