Update CRUD functions type defs

This commit is contained in:
2026-03-02 17:03:00 +01:00
parent 83bc501bd1
commit 077a15ed71
12 changed files with 82 additions and 52 deletions
+6 -6
View File
@@ -1,17 +1,17 @@
import type { APIResponseObject, ServerQueryParam } from "../../types";
type Params<T extends {
type Params<Schema extends {
[k: string]: any;
} = {
[k: string]: any;
}> = {
query?: ServerQueryParam<T>;
table: string;
}, Table extends string = string> = {
query?: ServerQueryParam<Schema>;
table: Table;
count?: boolean;
targetId?: number | string;
};
export default function DbSelect<T extends {
export default function DbSelect<Schema extends {
[k: string]: any;
} = {
[k: string]: any;
}>({ table, query, count, targetId }: Params<T>): Promise<APIResponseObject<T>>;
}, Table extends string = string>({ table, query, count, targetId, }: Params<Schema, Table>): Promise<APIResponseObject<Schema>>;
export {};