@deessejs/functions 0.0.35 → 0.0.36
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ZodType } from "zod";
|
|
2
2
|
import { Extension, InferOptions } from "./types";
|
|
3
|
-
export declare function extensions<TSchema extends ZodType | undefined = undefined, TContextAddon extends Record<string, unknown> = Record<string, unknown>, TFunctionsFactory extends (context:
|
|
3
|
+
export declare function extensions<TSchema extends ZodType | undefined = undefined, TContextAddon extends Record<string, unknown> = Record<string, unknown>, TFunctionsFactory extends (<C>(context: C) => any) = (<C>(context: C) => any)>(config: {
|
|
4
4
|
name: string;
|
|
5
5
|
schema?: TSchema;
|
|
6
6
|
context?: (options: InferOptions<TSchema>) => TContextAddon;
|
|
@@ -2,7 +2,7 @@ import z, { ZodType } from "zod";
|
|
|
2
2
|
export type InferOptions<T extends ZodType | undefined> = T extends ZodType ? z.infer<T> : undefined;
|
|
3
3
|
export type ExtensionBase = {
|
|
4
4
|
context: any;
|
|
5
|
-
functions: (context:
|
|
5
|
+
functions: <C>(context: C) => any;
|
|
6
6
|
};
|
|
7
7
|
type FnCallSignatureMatchesWith<C, F> = F extends {
|
|
8
8
|
(context: C): infer R;
|
package/package.json
CHANGED