@rr0/data
Version:
RR0 data model
27 lines (26 loc) • 1 kB
TypeScript
import { AllDataService } from "./AllDataService.js";
import { TypedDataFactory } from "./TypedDataFactory.js";
import { RR0Data } from "./RR0Data.js";
import { RR0DataJson } from "./RR0DataJson.js";
export interface DataServiceConfig {
rootDir: string;
files: string[];
}
export declare abstract class AbstractDataService<T extends RR0Data, J extends RR0DataJson> {
protected readonly dataService: AllDataService;
protected factory: TypedDataFactory<T, J>;
readonly files: string[];
readonly cache: Map<string, T>;
protected constructor(dataService: AllDataService, factory: TypedDataFactory<T, J>, files: string[]);
get type(): string;
getByDir(path: string): Promise<T[] | undefined>;
getAll(): Promise<T[]>;
getFromDirs(dirNames: string[]): Promise<T[]>;
/**
* Get people information found in a directory.
*
* @param dirName
* @return {People[]} The found people information.
*/
getFromDir(dirName: string): Promise<T[]>;
}