import { TableConfig, Column, Table, View } from 'drizzle-orm'; import { Config } from 'drizzle-kit'; import { D as DrizzleLab } from '../symbols-CdI5QtS4.cjs'; type JsonShapeDescription = T extends object ? T extends Array ? `${string}[]` : { [K in keyof T]: JsonShapeDescription } : T extends number ? "number" : T extends boolean ? "boolean" : string; declare module "drizzle-orm" { interface Table< T extends TableConfig = TableConfig>, > { [DrizzleLab]?: { /** * Documentation for the table. */ explain?: { /** * A description of the table. */ description?: string; /** * A description of each column in the table. */ columns?: { [K in keyof T["columns"]]?: string; }; /** * A description of each JSON column in the table. */ jsonShapes?: { [K in keyof T["columns"] as T["columns"][K]["dataType"] extends "json" ? K : never]: JsonShapeDescription; }; }; }; } interface View< T extends TableConfig = TableConfig>, > { [DrizzleLab]?: { /** * Documentation for the table. */ explain?: { /** * A description of the table. */ description?: string; /** * A description of each column in the table. */ columns?: { [K in keyof T["columns"]]?: string; }; /** * A description of each JSON column in the table. */ jsonShapes?: { [K in keyof T["columns"] as T["columns"][K]["dataType"] extends "json" ? K : never]: JsonShapeDescription; }; }; }; } } type LabExtendedConfig = Config & { /** * Configuration extension for Drizzle Lab. */ lab?: { /** * A unique identifier for the project in Drizzle Lab. * * It is used to uniquely identify saved projects configurations * * It defaults to the name of the project directory. */ projectId?: string; }; }; declare module "drizzle-kit" { declare function defineConfig(config: LabExtendedConfig): LabExtendedConfig; } /** * Extend a table or a view with additional descriptions that can be used to generate documentation. */ declare function explain(tableOrView: T, explain: T extends Table ? { /** * A description of the table. */ description?: string; /** * A description of each column in the table. */ columns?: { [K in keyof Columns]?: string; }; /** * A description of each JSON column in the table. */ jsonShapes?: { [K in keyof T["_"]["columns"] as T["_"]["columns"][K]["dataType"] extends "json" ? K : never]: JsonShapeDescription; }; } : { /** * A description of the table. */ description?: string; /** * A description of each column in the table. */ columns?: { [K in keyof Columns]?: string; }; }): T; export { explain };