UNPKG

@rr0/data

Version:
16 lines (15 loc) 766 B
import { FileContents } from "@javarome/fileutil"; import { RR0Data } from "./RR0Data.js"; import { AbstractDataFactory } from "./AbstractDataFactory.js"; import { RR0EventFactory } from "./event/RR0EventFactory.js"; import { RR0DataJson, RR0DataType } from "./RR0DataJson.js"; /** * A RR0Data factory which can read either <someType>.json files of index.json with a "type": "<someType>" property. */ export declare class TypedDataFactory<T extends RR0Data, J extends RR0DataJson> extends AbstractDataFactory<T, J> { readonly type: RR0DataType; readonly fileNames: string[]; constructor(eventFactory: RR0EventFactory, type: RR0DataType, fileNames?: string[]); createFromFile(file: FileContents): T | undefined; getFiles(): Promise<string[]>; }