narraleaf-react
Version:
A React visual novel player framework
25 lines (24 loc) • 1.08 kB
TypeScript
import { NameSpaceContent } from "../../elements/persistent/type";
export declare class Namespace<T extends NameSpaceContent<keyof T>> {
static isSerializable(value: any): boolean;
name: string;
constructor(name: string, initContent: T, key?: string);
set<Key extends keyof T>(key: Key, value: T[Key]): this;
get<Key extends keyof T = any>(key: Key): T[Key];
equals<Key extends keyof T = any>(key: Key, value: T[Key]): boolean;
assign(values: Partial<T>): this;
reset(): this;
}
export declare class Storable {
addNamespace<T extends NameSpaceContent<keyof T>>(namespace: Namespace<T>): this | undefined;
getNamespace<T extends NameSpaceContent<keyof T> = any>(key: string): Namespace<T>;
setNamespace<T extends NameSpaceContent<keyof T> = any>(key: string, namespace: Namespace<T>): this;
hasNamespace(key: string): boolean;
removeNamespace(key: string): this;
getNamespaces(): {
[key: string]: Namespace<any>;
};
keys(): string[];
values(): Namespace<any>[];
entries(): [string, Namespace<any>][];
}