@rr0/data
Version:
RR0 data model
32 lines (31 loc) • 1.52 kB
TypeScript
import { RR0Data } from "./RR0Data.js";
import { RR0DataFactory } from "./RR0DataFactory.js";
import { RR0DataJson } from "./RR0DataJson.js";
import { RR0EventJson } from "./event/RR0EventJson.js";
import { RR0Event } from "./event/RR0Event.js";
import { PublicationJson, SourceJson } from "./source/SourceJson.js";
import { Publication, Source } from "./source/Source.js";
import { RR0EventFactory } from "./event/RR0EventFactory.js";
export declare abstract class AbstractDataFactory<T extends RR0Data, J extends RR0DataJson> implements RR0DataFactory<T> {
protected eventFactory: RR0EventFactory;
protected previewFileNames: string[];
static readonly defaultPreviewFileNames: string[];
/**
* @param eventFactory The factory to create sub-events.
* @param previewFileNames
*/
protected constructor(eventFactory: RR0EventFactory, previewFileNames?: string[]);
parse(dataJson: J): T;
parseSources(json: SourceJson[], parent: RR0Data): Source[] | undefined;
parseSource(json: SourceJson, parent: RR0Data): Source;
parsePublication(json: PublicationJson): Publication;
defaultJsonEvents(dataJson: J): RR0EventJson[];
parseEvents(jsonEvents: RR0EventJson[], defaultParent: RR0Data): RR0Event[];
/**
* Determine people name from directory name.
*
* @param dataJson
*/
protected createTitle(dataJson: J): string;
protected parseEvent(eventJson: RR0EventJson, defaultParent: RR0Data): RR0Event<import("./index.js").RR0EventType>;
}