diff --git a/.changeset/smooth-colts-impress.md b/.changeset/smooth-colts-impress.md new file mode 100644 index 0000000..ff6b643 --- /dev/null +++ b/.changeset/smooth-colts-impress.md @@ -0,0 +1,5 @@ +--- +"d1-orm": patch +--- + +Chore: export some types used by Model so VSC can pick up on them diff --git a/src/model.ts b/src/model.ts index 3b8b01f..0500688 100644 --- a/src/model.ts +++ b/src/model.ts @@ -294,7 +294,10 @@ export enum DataTypes { BOOLEAN = "boolean", } -type InferFromColumn = +/** + * This is a helper type that allows you to know the JS type of a {@link ModelColumn} type. + */ +export type InferFromColumn = T["type"] extends DataTypes.INTEGER ? number : T["type"] extends DataTypes.REAL @@ -307,7 +310,10 @@ type InferFromColumn = ? 1 | 0 : never; -type InferFromColumns> = { +/** + * This is a helper type that allows you to know the JS type of a Record of {@link ModelColumn}s. + */ +export type InferFromColumns> = { [K in keyof T]: InferFromColumn; };