@matvdt/js-toolkit 0.0.1-canary.12 → 0.0.1-canary.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,4 +10,8 @@ export type BaseCollectionMethods<TSlug extends CollectionSlug> = {
|
|
|
10
10
|
delete: (id: string | number, options?: DeleteOptions) => ReturnType<typeof db.delete<TSlug>>;
|
|
11
11
|
deleteMany: (where: Where, options?: DeleteOptions) => ReturnType<typeof db.deleteMany<TSlug>>;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type ExtensionFunction = (...args: any[]) => any;
|
|
14
|
+
type ExtensionObject = Record<string, unknown>;
|
|
15
|
+
export type CollectionExtension = ExtensionFunction | ExtensionObject;
|
|
16
|
+
export declare function createCollection<TSlug extends CollectionSlug, TExtend extends Record<string, CollectionExtension> = {}>(collection: TSlug, extend?: (base: BaseCollectionMethods<TSlug>) => TExtend): BaseCollectionMethods<TSlug> & TExtend;
|
|
17
|
+
export {};
|