1+ import type { type } from "arktype" ;
12import type { z } from "zod" ;
23
34export type LoomContextHelperFn = ( version : string ) => boolean ;
@@ -29,17 +30,17 @@ export interface LoomContextHelpers {
2930 isVersionLessThanOrEqual : LoomContextHelperFn ;
3031}
3132
32- export interface LoomContext < TOptionsSchema extends z . ZodType > extends LoomContextHelpers {
33+ export interface LoomContext < TOptionsSchema extends type . Any > extends LoomContextHelpers {
3334 /**
3435 * The options.
3536 */
36- options : TOptionsSchema [ "_input " ] ;
37+ options : TOptionsSchema [ "infer " ] ;
3738}
3839
3940export interface LoomConfig <
40- TInputSchema extends z . ZodType ,
41- TOptionsSchema extends z . ZodType ,
42- TPresets extends Record < string , TInputSchema [ "_input " ] [ ] > ,
41+ TInputSchema extends type . Any ,
42+ TOptionsSchema extends type . Any ,
43+ TPresets extends Record < string , TInputSchema [ "infer " ] [ ] > ,
4344> {
4445 /**
4546 * The schema of the input data.
@@ -56,7 +57,7 @@ export interface LoomConfig<
5657 */
5758 template : (
5859 ctx : LoomContext < TOptionsSchema > ,
59- item : TInputSchema [ "_input " ]
60+ item : TInputSchema [ "infer " ]
6061 ) => string ;
6162
6263 /**
@@ -67,7 +68,7 @@ export interface LoomConfig<
6768 /**
6869 * The predicate function. If provided, the loom will only process items that return true.
6970 */
70- predicate ?: ( ctx : LoomContext < TOptionsSchema > , item : TInputSchema [ "_input " ] ) => boolean ;
71+ predicate ?: ( ctx : LoomContext < TOptionsSchema > , item : TInputSchema [ "infer " ] ) => boolean ;
7172
7273 /**
7374 * Attach custom presets to the loom.
@@ -76,11 +77,11 @@ export interface LoomConfig<
7677}
7778
7879export type LoomInstance <
79- TInputSchema extends z . ZodType ,
80- TOptionsSchema extends z . ZodType ,
81- TPresets extends Record < string , TInputSchema [ "_input " ] [ ] > ,
80+ TInputSchema extends type . Any ,
81+ TOptionsSchema extends type . Any ,
82+ TPresets extends Record < string , TInputSchema [ "infer " ] [ ] > ,
8283> = {
83- ( options : TOptionsSchema [ "_input " ] & { input : TInputSchema [ "_input " ] [ ] } ) : string ;
84+ ( options : TOptionsSchema [ "infer " ] & { input : TInputSchema [ "infer " ] [ ] } ) : string ;
8485} & {
85- [ key in keyof TPresets ] : ( options : TOptionsSchema [ "_input " ] ) => string ;
86+ [ key in keyof TPresets ] : ( options : TOptionsSchema [ "infer " ] ) => string ;
8687} ;
0 commit comments