UNPKG

@log4brains/core

Version:

Log4brains architecture knowledge base core API

56 lines 1.93 kB
import { AggregateRoot } from "@src/domain"; import { AdrFile } from "./AdrFile"; import { AdrSlug } from "./AdrSlug"; import { AdrStatus } from "./AdrStatus"; import type { MarkdownBody } from "./MarkdownBody"; import { PackageRef } from "./PackageRef"; import { Author } from "./Author"; declare type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; declare type Props = { slug: AdrSlug; package?: PackageRef; body: MarkdownBody; file?: AdrFile; creationDate: Date; lastEditDate: Date; lastEditAuthor: Author; }; export declare class Adr extends AggregateRoot<Props> { /** * Global TimeZone. * This static property must be set at startup with Adr.setTz(), otherwise it will throw an Error. * This dirty behavior is temporary, until we get a better vision on how to deal with timezones in the project. * TODO: refactor */ private static tz?; constructor(props: WithOptional<Props, "creationDate" | "lastEditDate" | "lastEditAuthor">); /** * @see Adr.tz */ static setTz(tz: string): void; /** * For test purposes only */ static clearTz(): void; get slug(): AdrSlug; get package(): PackageRef | undefined; get body(): MarkdownBody; get file(): AdrFile | undefined; get creationDate(): Date; get lastEditDate(): Date; get lastEditAuthor(): Author; get title(): string | undefined; get status(): AdrStatus; get superseder(): AdrSlug | undefined; get publicationDate(): Date | undefined; get tags(): string[]; get deciders(): string[]; setFile(file: AdrFile): void; setTitle(title: string): void; supersedeBy(superseder: Adr): void; private markAsSuperseder; getEnhancedMdx(): Promise<string>; static compare(a: Adr, b: Adr): number; } export {}; //# sourceMappingURL=Adr.d.ts.map