@tstdl/base 0.92.26 → 0.92.28
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.
- package/ai/types.d.ts +2 -3
- package/package.json +1 -1
- package/utils/value-or-provider.d.ts +2 -2
package/ai/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LiteralUnion } from 'type-fest';
|
|
2
2
|
import type { ObjectSchema, SchemaOutput, SchemaTestable } from '../schema/index.js';
|
|
3
|
-
import type { Record,
|
|
3
|
+
import type { Record, UndefinableJsonObject } from '../types.js';
|
|
4
4
|
import type { ResolvedValueOrProvider, ValueOrAsyncProvider } from '../utils/value-or-provider.js';
|
|
5
5
|
export type FileInput = {
|
|
6
6
|
path: string;
|
|
@@ -84,6 +84,5 @@ export type GenerationResult = {
|
|
|
84
84
|
usage: GenerationUsage;
|
|
85
85
|
};
|
|
86
86
|
export declare function defineFunctions<T extends SchemaFunctionDeclarations>(declarations: T): T;
|
|
87
|
-
export declare function defineFunction<P extends Record, T extends
|
|
88
|
-
export declare function defineFunction<T extends SchemaFunctionDeclarationWithoutHandler>(declaration: T): T;
|
|
87
|
+
export declare function defineFunction<P extends Record, T extends SchemaFunctionDeclaration<P>>(declaration: T & Pick<SchemaFunctionDeclaration<P>, 'parameters'>): T;
|
|
89
88
|
export declare function isSchemaFunctionDeclarationWithHandler(declaration: SchemaFunctionDeclaration): declaration is SchemaFunctionDeclarationWithHandler;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type Provider<T> = () => T;
|
|
2
2
|
export type AsyncProvider<T> = () => (T | Promise<T>);
|
|
3
|
-
export type ValueOrProvider<T> = T
|
|
4
|
-
export type ValueOrAsyncProvider<T> = T
|
|
3
|
+
export type ValueOrProvider<T> = T | Provider<T>;
|
|
4
|
+
export type ValueOrAsyncProvider<T> = T | Provider<T> | AsyncProvider<T>;
|
|
5
5
|
export type ResolvedValueOrProvider<T extends ValueOrAsyncProvider<any>> = T extends ValueOrAsyncProvider<infer U> ? U : never;
|
|
6
6
|
export declare function resolveValueOrProvider<T>(valueOrProvider: ValueOrProvider<T>): T;
|
|
7
7
|
/**
|