From 1e8e4e54d948d6eac4aff13b24676926fd5f7dce Mon Sep 17 00:00:00 2001 From: Skye <46286597+Skye-31@users.noreply.github.com> Date: Sat, 17 Sep 2022 16:43:14 +0100 Subject: [PATCH] Chore: Model constructor, stricter types (#27) --- .changeset/spotty-mangos-hug.md | 5 +++++ src/model.ts | 2 +- typedoc.json | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/spotty-mangos-hug.md diff --git a/.changeset/spotty-mangos-hug.md b/.changeset/spotty-mangos-hug.md new file mode 100644 index 0000000..4354e75 --- /dev/null +++ b/.changeset/spotty-mangos-hug.md @@ -0,0 +1,5 @@ +--- +"d1-orm": patch +--- + +Chore: Make Model#constructor#columns use the provided type of the model, rather than any keys diff --git a/src/model.ts b/src/model.ts index 1cac724..ea9f47e 100644 --- a/src/model.ts +++ b/src/model.ts @@ -19,7 +19,7 @@ export class Model { D1Orm: D1Orm; tableName: string; }, - columns: Record + columns: Record, ModelColumn> ) { this.#D1Orm = options.D1Orm; this.tableName = options.tableName; diff --git a/typedoc.json b/typedoc.json index e5e62ee..658aeaa 100644 --- a/typedoc.json +++ b/typedoc.json @@ -16,7 +16,8 @@ "Partial": "https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype", "Pick": "https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys", "Record": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type", - "Omit": "https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys" + "Omit": "https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys", + "Extract": "https://www.typescriptlang.org/docs/handbook/utility-types.html#extracttype-union" } }, "githubPages": false,