@rr0/data
Version:
RR0 data model
15 lines (14 loc) • 768 B
TypeScript
import { RR0Event, RR0EventFactory, RR0EventJson } from "./index.js";
import { FileContents } from "@javarome/fileutil";
import { TypedDataFactory } from "../TypedDataFactory.js";
import { RR0EventType } from "./RR0EventType.js";
/**
* A RR0Data factory which can read either <someType>.json files of index.json with a "type": "<someType>" property.
*/
export declare class EventDataFactory<T extends RR0EventType = RR0EventType> extends TypedDataFactory<RR0Event, RR0EventJson> {
readonly eventTypes: RR0EventType[];
readonly fileNames: string[];
constructor(eventFactory: RR0EventFactory, eventTypes: RR0EventType[], fileNames?: string[]);
parse(dataJson: RR0EventJson): RR0Event;
createFromFile(file: FileContents): RR0Event<T> | undefined;
}