declare const TABLE_KIND_PREFIX = "table:"; type Json = Record; /** `custom.table_kind_facts(p_table_id)` verbatim (N1). */ interface TableKindFacts { organization_id: string; table_id: string; name: string | null; title_field: string | null; agent_writable: boolean; purpose: string | null; version: number | null; type_field: string | null; stamp: string | null; /** Every live Field document (typed ones included), plus `id` and `version`, in `sort` order. */ fields: Array>; /** `{: [{key, label, id, retired, position}]}`, retired included, live first. */ choices: Record>; /** `custom.table_column_source` (`fields` / `free_form` / `code`) once the door carries it; absent, the mapping's default. */ column_source?: string | null; /** `custom.record_platform_keys()` once the door carries it; absent, the mapping's keys. */ platform_keys?: string[] | null; } /** The content-ir `KindSchema` shape, structurally (this package does not depend on content-ir). */ interface TableRenderSchema { kind: string; fields: Record>; } type TableSchemaMode = "stored" | "authored"; type KindSpec = { shape: "string" | "number" | "boolean" | "datetime" | "choice" | "relation" | "entity_reference" | "address" | "computed"; value?: Json; authored?: boolean; unit?: boolean; hint?: string; rating?: boolean; }; type Mapping = { kernels: { file: string; person: string; }; system_kinds: string[]; by_behaviour: Record; choice_enum_limit: number; rating_max: number; address_parts: string[]; address_part_max: number; column_source_default: string; platform_keys: Record; stored_patterns: { record_id: string; datetime: string; }; kinds: Record; render: Record; }; /** The one mapping (records' own file; the Python copy is generated from it). */ declare function tableKindMapping(): Readonly; declare function isTableKind(slug: unknown): slug is `table:${string}`; declare function tableKindSlug(tableId: string): `table:${string}`; declare function tableIdOf(slug: string): string; /** Twin of `custom.field_kind_of`: the field kind a stored Field document declares. */ declare function fieldKindOf(d: Record): string | null; /** The Fields-only JSON Schema of a record of this Table (no control keys). */ declare function tableJsonSchema(facts: TableKindFacts, mode: TableSchemaMode): Json; /** * The Fields-only content-ir `KindSchema` the web draws a record of this Table with: every Field * nullable and optional, choices open to every word the store accepts (keys, labels, ids, * retired included). Wrap it with `withControlKeyFields` from @ai-matrx/content-ir — table kinds * never pass through `kindSchemaFromJsonSchema`. */ declare function tableRenderSchema(facts: TableKindFacts): TableRenderSchema; export { TABLE_KIND_PREFIX, fieldKindOf, isTableKind, tableIdOf, tableJsonSchema, tableKindMapping, tableKindSlug, tableRenderSchema }; export type { TableKindFacts, TableRenderSchema, TableSchemaMode };