types/record.types.ts

types/record.types.ts is a file in Bane's Lab Build Scripts. 39 lines of code and 5 definitions.

import type { Identity, Leaf, Link, Linker, Placed, PlacementOf, Relation } from "#types/catalog.types";
import type { ReferenceRecord, ReferenceRelation } from "@banes-lab/web/types/reference.types.js";
import type { GovlabContext } from "@govlab/context";
import type { RecordSubject } from "@banes-lab/web/types/page.types.js";

export interface RecordSources {
    readonly context: GovlabContext;
    readonly evidence: (ref: string) => readonly Link[];
    readonly inbound: (ref: string) => readonly ReferenceRelation[];
    readonly linkedBy: (ref: string) => readonly Link[];
    readonly placement: PlacementOf;
    readonly linker: Linker;
    readonly tabLabel: (path: string) => string;
}

export interface RecordData extends Placed {
    readonly href: string | null;
    readonly kind: string;
    readonly layer: Link | null;
    readonly name: string;
    readonly ref: string;
    readonly relations: readonly Relation[];
    readonly summary: string | null;
}

export interface RecordPageInput {
    readonly aliases: readonly string[];
    readonly data: RecordData;
    readonly identity: Identity;
    readonly layer: Link | null;
    readonly record: ReferenceRecord;
    readonly relations: readonly Relation[];
    readonly site: string;
    readonly tabLabel: (path: string) => string;
}

export interface RecordLeaf extends Leaf {
    readonly page: RecordSubject;
}

export interface RecordSubjectCounts {
    readonly descriptions: ReadonlyMap<string, number>;
    readonly titles: ReadonlyMap<string, number>;
}