@e280/quay
Version:
File-browser and outliner UI for the web
18 lines (17 loc) • 781 B
TypeScript
import { Clade } from "./parts/clade.js";
import { Hierarchy } from "./parts/hierarchy.js";
import { CodexItem } from "./parts/codex-item.js";
import { Id, Schema, Taxons } from "./parts/types.js";
export declare class Codex<Sc extends Schema> {
#private;
clade: Clade<Sc>;
hierarchy: Hierarchy;
static setup<Sc extends Schema>(taxons: Taxons<Sc>): Codex<Sc>;
constructor(clade: Clade<Sc>, hierarchy: Hierarchy);
/** create an item, not yet added to hierarchy */
create<K extends keyof Sc["specimens"]>(kind: K, specimen: Sc["specimens"][K]): CodexItem<Sc, keyof Sc["specimens"]>;
/** add an item to the hierachy as a root root */
root<I extends CodexItem<Sc>>(item: I): I;
/** get an item by its id */
require(id: Id): CodexItem<Sc>;
}