/// import { URL } from "url"; import { IToMarkdown } from "../markdown/markdown"; import Name from "../name/Name"; import { ResourceType } from "./ResourceList"; import ResourceEvent from "./ResourceEvent"; import ResourceEventLog from "./ResourceEventLog"; import LinkCollection from "./Links"; import Link from "./Link"; import { ResourceData } from "./ResourceData"; export default abstract class Resource implements IToMarkdown { readonly id: string; readonly url: URL; readonly type: ResourceType; readonly name: Name; readonly eventLog: ResourceEventLog; readonly linkList: LinkCollection; protected fileData?: string[]; constructor({ id, name, type, eventLog, links, fileData, }: { id: string; name: string; type: ResourceType; eventLog: ResourceEvent[]; links: Link[]; fileData?: string[]; }); link(resource: Resource, description?: string): Resource; addEvent(event: ResourceEvent): void; toMarkdown(): string; getFileName(): string; getFileUrl(): string; abstract createMarkdownFile(): Resource[]; } export interface IStaticResource { random(): T; parse(args: ResourceData, options?: Record): T; }