cogsbox-shape 0.5.32 → 0.5.34

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/dist/schema.d.ts CHANGED
@@ -225,28 +225,8 @@ export declare const shape: {
225
225
  };
226
226
  };
227
227
  };
228
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
229
- sql: z.ZodNumber;
230
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
231
- config: {
232
- sql: {
233
- nullable?: boolean;
234
- pk?: true;
235
- field?: string;
236
- default?: number;
237
- type: "int";
238
- };
239
- zodSqlSchema: z.ZodNumber;
240
- zodNewSchema: TNewNext;
241
- initialValue: z.TypeOf<TNewNext>;
242
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
243
- zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
244
- };
245
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
246
- sql: z.ZodNumber;
247
- initialState: TNewNext;
248
- client: InferSmartClientType<z.ZodNumber, TNewNext>;
249
- }) => TValidationNext)) => {
228
+ initialState: {
229
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
250
230
  config: {
251
231
  sql: {
252
232
  nullable?: boolean;
@@ -256,14 +236,145 @@ export declare const shape: {
256
236
  type: "int";
257
237
  };
258
238
  zodSqlSchema: z.ZodNumber;
259
- zodNewSchema: TNewNext;
260
- initialValue: z.TypeOf<TNewNext>;
261
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
262
- zodValidationSchema: TValidationNext;
239
+ zodNewSchema: z.ZodNumber;
240
+ initialValue: TDefaultNext;
241
+ zodClientSchema: z.ZodNumber;
242
+ zodValidationSchema: z.ZodNumber;
243
+ };
244
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
245
+ sql: z.ZodNumber;
246
+ initialState: z.ZodNumber;
247
+ client: z.ZodNumber;
248
+ }) => TValidationNext)) => {
249
+ config: {
250
+ sql: {
251
+ nullable?: boolean;
252
+ pk?: true;
253
+ field?: string;
254
+ default?: number;
255
+ type: "int";
256
+ };
257
+ zodSqlSchema: z.ZodNumber;
258
+ zodNewSchema: z.ZodNumber;
259
+ initialValue: TDefaultNext;
260
+ zodClientSchema: z.ZodNumber;
261
+ zodValidationSchema: TValidationNext;
262
+ };
263
+ transform: (transforms: {
264
+ toClient: (dbValue: number) => number;
265
+ toDb: (clientValue: number) => number;
266
+ }) => {
267
+ config: {
268
+ sql: {
269
+ nullable?: boolean;
270
+ pk?: true;
271
+ field?: string;
272
+ default?: number;
273
+ type: "int";
274
+ };
275
+ zodSqlSchema: z.ZodNumber;
276
+ zodNewSchema: z.ZodNumber;
277
+ initialValue: TDefaultNext;
278
+ zodClientSchema: z.ZodNumber;
279
+ zodValidationSchema: TValidationNext;
280
+ } & {
281
+ transforms: {
282
+ toClient: (dbValue: number) => number;
283
+ toDb: (clientValue: number) => number;
284
+ };
285
+ };
286
+ };
287
+ };
288
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
289
+ sql: z.ZodNumber;
290
+ initialState: z.ZodNumber;
291
+ }) => TClientNext)) => {
292
+ config: {
293
+ sql: {
294
+ nullable?: boolean;
295
+ pk?: true;
296
+ field?: string;
297
+ default?: number;
298
+ type: "int";
299
+ };
300
+ zodSqlSchema: z.ZodNumber;
301
+ zodNewSchema: z.ZodNumber;
302
+ initialValue: TDefaultNext;
303
+ zodClientSchema: TClientNext;
304
+ zodValidationSchema: TClientNext;
305
+ };
306
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
307
+ sql: z.ZodNumber;
308
+ initialState: z.ZodNumber;
309
+ client: TClientNext;
310
+ }) => TValidationNext)) => {
311
+ config: {
312
+ sql: {
313
+ nullable?: boolean;
314
+ pk?: true;
315
+ field?: string;
316
+ default?: number;
317
+ type: "int";
318
+ };
319
+ zodSqlSchema: z.ZodNumber;
320
+ zodNewSchema: z.ZodNumber;
321
+ initialValue: TDefaultNext;
322
+ zodClientSchema: TClientNext;
323
+ zodValidationSchema: TValidationNext;
324
+ };
325
+ transform: (transforms: {
326
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
327
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
328
+ }) => {
329
+ config: {
330
+ sql: {
331
+ nullable?: boolean;
332
+ pk?: true;
333
+ field?: string;
334
+ default?: number;
335
+ type: "int";
336
+ };
337
+ zodSqlSchema: z.ZodNumber;
338
+ zodNewSchema: z.ZodNumber;
339
+ initialValue: TDefaultNext;
340
+ zodClientSchema: TClientNext;
341
+ zodValidationSchema: TValidationNext;
342
+ } & {
343
+ transforms: {
344
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
345
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
346
+ };
347
+ };
348
+ };
349
+ };
350
+ transform: (transforms: {
351
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
352
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
353
+ }) => {
354
+ config: {
355
+ sql: {
356
+ nullable?: boolean;
357
+ pk?: true;
358
+ field?: string;
359
+ default?: number;
360
+ type: "int";
361
+ };
362
+ zodSqlSchema: z.ZodNumber;
363
+ zodNewSchema: z.ZodNumber;
364
+ initialValue: TDefaultNext;
365
+ zodClientSchema: TClientNext;
366
+ zodValidationSchema: TClientNext;
367
+ } & {
368
+ transforms: {
369
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
370
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
371
+ };
372
+ };
373
+ };
263
374
  };
264
375
  transform: (transforms: {
265
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
266
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
376
+ toClient: (dbValue: number) => number;
377
+ toDb: (clientValue: number) => number;
267
378
  }) => {
268
379
  config: {
269
380
  sql: {
@@ -274,22 +385,21 @@ export declare const shape: {
274
385
  type: "int";
275
386
  };
276
387
  zodSqlSchema: z.ZodNumber;
277
- zodNewSchema: TNewNext;
278
- initialValue: z.TypeOf<TNewNext>;
279
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
280
- zodValidationSchema: TValidationNext;
388
+ zodNewSchema: z.ZodNumber;
389
+ initialValue: TDefaultNext;
390
+ zodClientSchema: z.ZodNumber;
391
+ zodValidationSchema: z.ZodNumber;
281
392
  } & {
282
393
  transforms: {
283
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
284
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
394
+ toClient: (dbValue: number) => number;
395
+ toDb: (clientValue: number) => number;
285
396
  };
286
397
  };
287
398
  };
288
399
  };
289
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
400
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
290
401
  sql: z.ZodNumber;
291
- initialState: TNewNext;
292
- }) => TClientNext)) => {
402
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
293
403
  config: {
294
404
  sql: {
295
405
  nullable?: boolean;
@@ -301,13 +411,13 @@ export declare const shape: {
301
411
  zodSqlSchema: z.ZodNumber;
302
412
  zodNewSchema: TNewNext;
303
413
  initialValue: z.TypeOf<TNewNext>;
304
- zodClientSchema: TClientNext;
305
- zodValidationSchema: TClientNext;
414
+ zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
415
+ zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
306
416
  };
307
417
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
308
418
  sql: z.ZodNumber;
309
419
  initialState: TNewNext;
310
- client: TClientNext;
420
+ client: InferSmartClientType<z.ZodNumber, TNewNext>;
311
421
  }) => TValidationNext)) => {
312
422
  config: {
313
423
  sql: {
@@ -320,9 +430,96 @@ export declare const shape: {
320
430
  zodSqlSchema: z.ZodNumber;
321
431
  zodNewSchema: TNewNext;
322
432
  initialValue: z.TypeOf<TNewNext>;
323
- zodClientSchema: TClientNext;
433
+ zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
324
434
  zodValidationSchema: TValidationNext;
325
435
  };
436
+ transform: (transforms: {
437
+ toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
438
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
439
+ }) => {
440
+ config: {
441
+ sql: {
442
+ nullable?: boolean;
443
+ pk?: true;
444
+ field?: string;
445
+ default?: number;
446
+ type: "int";
447
+ };
448
+ zodSqlSchema: z.ZodNumber;
449
+ zodNewSchema: TNewNext;
450
+ initialValue: z.TypeOf<TNewNext>;
451
+ zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
452
+ zodValidationSchema: TValidationNext;
453
+ } & {
454
+ transforms: {
455
+ toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
456
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
457
+ };
458
+ };
459
+ };
460
+ };
461
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
462
+ sql: z.ZodNumber;
463
+ initialState: TNewNext;
464
+ }) => TClientNext)) => {
465
+ config: {
466
+ sql: {
467
+ nullable?: boolean;
468
+ pk?: true;
469
+ field?: string;
470
+ default?: number;
471
+ type: "int";
472
+ };
473
+ zodSqlSchema: z.ZodNumber;
474
+ zodNewSchema: TNewNext;
475
+ initialValue: z.TypeOf<TNewNext>;
476
+ zodClientSchema: TClientNext;
477
+ zodValidationSchema: TClientNext;
478
+ };
479
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
480
+ sql: z.ZodNumber;
481
+ initialState: TNewNext;
482
+ client: TClientNext;
483
+ }) => TValidationNext)) => {
484
+ config: {
485
+ sql: {
486
+ nullable?: boolean;
487
+ pk?: true;
488
+ field?: string;
489
+ default?: number;
490
+ type: "int";
491
+ };
492
+ zodSqlSchema: z.ZodNumber;
493
+ zodNewSchema: TNewNext;
494
+ initialValue: z.TypeOf<TNewNext>;
495
+ zodClientSchema: TClientNext;
496
+ zodValidationSchema: TValidationNext;
497
+ };
498
+ transform: (transforms: {
499
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
500
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
501
+ }) => {
502
+ config: {
503
+ sql: {
504
+ nullable?: boolean;
505
+ pk?: true;
506
+ field?: string;
507
+ default?: number;
508
+ type: "int";
509
+ };
510
+ zodSqlSchema: z.ZodNumber;
511
+ zodNewSchema: TNewNext;
512
+ initialValue: z.TypeOf<TNewNext>;
513
+ zodClientSchema: TClientNext;
514
+ zodValidationSchema: TValidationNext;
515
+ } & {
516
+ transforms: {
517
+ toClient: (dbValue: number) => z.TypeOf<TClientNext>;
518
+ toDb: (clientValue: z.TypeOf<TClientNext>) => number;
519
+ };
520
+ };
521
+ };
522
+ };
326
523
  transform: (transforms: {
327
524
  toClient: (dbValue: number) => z.TypeOf<TClientNext>;
328
525
  toDb: (clientValue: z.TypeOf<TClientNext>) => number;
@@ -339,7 +536,7 @@ export declare const shape: {
339
536
  zodNewSchema: TNewNext;
340
537
  initialValue: z.TypeOf<TNewNext>;
341
538
  zodClientSchema: TClientNext;
342
- zodValidationSchema: TValidationNext;
539
+ zodValidationSchema: TClientNext;
343
540
  } & {
344
541
  transforms: {
345
542
  toClient: (dbValue: number) => z.TypeOf<TClientNext>;
@@ -349,8 +546,8 @@ export declare const shape: {
349
546
  };
350
547
  };
351
548
  transform: (transforms: {
352
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
353
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
549
+ toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
550
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
354
551
  }) => {
355
552
  config: {
356
553
  sql: {
@@ -363,40 +560,16 @@ export declare const shape: {
363
560
  zodSqlSchema: z.ZodNumber;
364
561
  zodNewSchema: TNewNext;
365
562
  initialValue: z.TypeOf<TNewNext>;
366
- zodClientSchema: TClientNext;
367
- zodValidationSchema: TClientNext;
563
+ zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
564
+ zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
368
565
  } & {
369
566
  transforms: {
370
- toClient: (dbValue: number) => z.TypeOf<TClientNext>;
371
- toDb: (clientValue: z.TypeOf<TClientNext>) => number;
567
+ toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
568
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
372
569
  };
373
570
  };
374
571
  };
375
572
  };
376
- transform: (transforms: {
377
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
378
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
379
- }) => {
380
- config: {
381
- sql: {
382
- nullable?: boolean;
383
- pk?: true;
384
- field?: string;
385
- default?: number;
386
- type: "int";
387
- };
388
- zodSqlSchema: z.ZodNumber;
389
- zodNewSchema: TNewNext;
390
- initialValue: z.TypeOf<TNewNext>;
391
- zodClientSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
392
- zodValidationSchema: InferSmartClientType<z.ZodNumber, TNewNext>;
393
- } & {
394
- transforms: {
395
- toClient: (dbValue: number) => z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>;
396
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodNumber, TNewNext>>) => number;
397
- };
398
- };
399
- };
400
573
  };
401
574
  };
402
575
  varchar: (config?: Omit<StringConfig, "type">) => {
@@ -577,29 +750,8 @@ export declare const shape: {
577
750
  };
578
751
  };
579
752
  };
580
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
581
- sql: z.ZodString;
582
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
583
- config: {
584
- sql: {
585
- pk?: true;
586
- nullable?: boolean;
587
- default?: string;
588
- length?: number;
589
- field?: string;
590
- type: "varchar";
591
- };
592
- zodSqlSchema: z.ZodString;
593
- zodNewSchema: TNewNext;
594
- initialValue: z.TypeOf<TNewNext>;
595
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
596
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
597
- };
598
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
599
- sql: z.ZodString;
600
- initialState: TNewNext;
601
- client: InferSmartClientType<z.ZodString, TNewNext>;
602
- }) => TValidationNext)) => {
753
+ initialState: {
754
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
603
755
  config: {
604
756
  sql: {
605
757
  pk?: true;
@@ -610,15 +762,16 @@ export declare const shape: {
610
762
  type: "varchar";
611
763
  };
612
764
  zodSqlSchema: z.ZodString;
613
- zodNewSchema: TNewNext;
614
- initialValue: z.TypeOf<TNewNext>;
615
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
616
- zodValidationSchema: TValidationNext;
765
+ zodNewSchema: z.ZodString;
766
+ initialValue: TDefaultNext;
767
+ zodClientSchema: z.ZodString;
768
+ zodValidationSchema: z.ZodString;
617
769
  };
618
- transform: (transforms: {
619
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
620
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
621
- }) => {
770
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
771
+ sql: z.ZodString;
772
+ initialState: z.ZodString;
773
+ client: z.ZodString;
774
+ }) => TValidationNext)) => {
622
775
  config: {
623
776
  sql: {
624
777
  pk?: true;
@@ -629,22 +782,157 @@ export declare const shape: {
629
782
  type: "varchar";
630
783
  };
631
784
  zodSqlSchema: z.ZodString;
632
- zodNewSchema: TNewNext;
633
- initialValue: z.TypeOf<TNewNext>;
634
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
785
+ zodNewSchema: z.ZodString;
786
+ initialValue: TDefaultNext;
787
+ zodClientSchema: z.ZodString;
635
788
  zodValidationSchema: TValidationNext;
636
- } & {
637
- transforms: {
638
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
639
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
640
- };
641
789
  };
642
- };
643
- };
644
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
645
- sql: z.ZodString;
646
- initialState: TNewNext;
647
- }) => TClientNext)) => {
790
+ transform: (transforms: {
791
+ toClient: (dbValue: string) => string;
792
+ toDb: (clientValue: string) => string;
793
+ }) => {
794
+ config: {
795
+ sql: {
796
+ pk?: true;
797
+ nullable?: boolean;
798
+ default?: string;
799
+ length?: number;
800
+ field?: string;
801
+ type: "varchar";
802
+ };
803
+ zodSqlSchema: z.ZodString;
804
+ zodNewSchema: z.ZodString;
805
+ initialValue: TDefaultNext;
806
+ zodClientSchema: z.ZodString;
807
+ zodValidationSchema: TValidationNext;
808
+ } & {
809
+ transforms: {
810
+ toClient: (dbValue: string) => string;
811
+ toDb: (clientValue: string) => string;
812
+ };
813
+ };
814
+ };
815
+ };
816
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
817
+ sql: z.ZodString;
818
+ initialState: z.ZodString;
819
+ }) => TClientNext)) => {
820
+ config: {
821
+ sql: {
822
+ pk?: true;
823
+ nullable?: boolean;
824
+ default?: string;
825
+ length?: number;
826
+ field?: string;
827
+ type: "varchar";
828
+ };
829
+ zodSqlSchema: z.ZodString;
830
+ zodNewSchema: z.ZodString;
831
+ initialValue: TDefaultNext;
832
+ zodClientSchema: TClientNext;
833
+ zodValidationSchema: TClientNext;
834
+ };
835
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
836
+ sql: z.ZodString;
837
+ initialState: z.ZodString;
838
+ client: TClientNext;
839
+ }) => TValidationNext)) => {
840
+ config: {
841
+ sql: {
842
+ pk?: true;
843
+ nullable?: boolean;
844
+ default?: string;
845
+ length?: number;
846
+ field?: string;
847
+ type: "varchar";
848
+ };
849
+ zodSqlSchema: z.ZodString;
850
+ zodNewSchema: z.ZodString;
851
+ initialValue: TDefaultNext;
852
+ zodClientSchema: TClientNext;
853
+ zodValidationSchema: TValidationNext;
854
+ };
855
+ transform: (transforms: {
856
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
857
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
858
+ }) => {
859
+ config: {
860
+ sql: {
861
+ pk?: true;
862
+ nullable?: boolean;
863
+ default?: string;
864
+ length?: number;
865
+ field?: string;
866
+ type: "varchar";
867
+ };
868
+ zodSqlSchema: z.ZodString;
869
+ zodNewSchema: z.ZodString;
870
+ initialValue: TDefaultNext;
871
+ zodClientSchema: TClientNext;
872
+ zodValidationSchema: TValidationNext;
873
+ } & {
874
+ transforms: {
875
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
876
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
877
+ };
878
+ };
879
+ };
880
+ };
881
+ transform: (transforms: {
882
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
883
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
884
+ }) => {
885
+ config: {
886
+ sql: {
887
+ pk?: true;
888
+ nullable?: boolean;
889
+ default?: string;
890
+ length?: number;
891
+ field?: string;
892
+ type: "varchar";
893
+ };
894
+ zodSqlSchema: z.ZodString;
895
+ zodNewSchema: z.ZodString;
896
+ initialValue: TDefaultNext;
897
+ zodClientSchema: TClientNext;
898
+ zodValidationSchema: TClientNext;
899
+ } & {
900
+ transforms: {
901
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
902
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
903
+ };
904
+ };
905
+ };
906
+ };
907
+ transform: (transforms: {
908
+ toClient: (dbValue: string) => string;
909
+ toDb: (clientValue: string) => string;
910
+ }) => {
911
+ config: {
912
+ sql: {
913
+ pk?: true;
914
+ nullable?: boolean;
915
+ default?: string;
916
+ length?: number;
917
+ field?: string;
918
+ type: "varchar";
919
+ };
920
+ zodSqlSchema: z.ZodString;
921
+ zodNewSchema: z.ZodString;
922
+ initialValue: TDefaultNext;
923
+ zodClientSchema: z.ZodString;
924
+ zodValidationSchema: z.ZodString;
925
+ } & {
926
+ transforms: {
927
+ toClient: (dbValue: string) => string;
928
+ toDb: (clientValue: string) => string;
929
+ };
930
+ };
931
+ };
932
+ };
933
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
934
+ sql: z.ZodString;
935
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
648
936
  config: {
649
937
  sql: {
650
938
  pk?: true;
@@ -657,13 +945,13 @@ export declare const shape: {
657
945
  zodSqlSchema: z.ZodString;
658
946
  zodNewSchema: TNewNext;
659
947
  initialValue: z.TypeOf<TNewNext>;
660
- zodClientSchema: TClientNext;
661
- zodValidationSchema: TClientNext;
948
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
949
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
662
950
  };
663
951
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
664
952
  sql: z.ZodString;
665
953
  initialState: TNewNext;
666
- client: TClientNext;
954
+ client: InferSmartClientType<z.ZodString, TNewNext>;
667
955
  }) => TValidationNext)) => {
668
956
  config: {
669
957
  sql: {
@@ -677,9 +965,100 @@ export declare const shape: {
677
965
  zodSqlSchema: z.ZodString;
678
966
  zodNewSchema: TNewNext;
679
967
  initialValue: z.TypeOf<TNewNext>;
680
- zodClientSchema: TClientNext;
968
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
681
969
  zodValidationSchema: TValidationNext;
682
970
  };
971
+ transform: (transforms: {
972
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
973
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
974
+ }) => {
975
+ config: {
976
+ sql: {
977
+ pk?: true;
978
+ nullable?: boolean;
979
+ default?: string;
980
+ length?: number;
981
+ field?: string;
982
+ type: "varchar";
983
+ };
984
+ zodSqlSchema: z.ZodString;
985
+ zodNewSchema: TNewNext;
986
+ initialValue: z.TypeOf<TNewNext>;
987
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
988
+ zodValidationSchema: TValidationNext;
989
+ } & {
990
+ transforms: {
991
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
992
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
993
+ };
994
+ };
995
+ };
996
+ };
997
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
998
+ sql: z.ZodString;
999
+ initialState: TNewNext;
1000
+ }) => TClientNext)) => {
1001
+ config: {
1002
+ sql: {
1003
+ pk?: true;
1004
+ nullable?: boolean;
1005
+ default?: string;
1006
+ length?: number;
1007
+ field?: string;
1008
+ type: "varchar";
1009
+ };
1010
+ zodSqlSchema: z.ZodString;
1011
+ zodNewSchema: TNewNext;
1012
+ initialValue: z.TypeOf<TNewNext>;
1013
+ zodClientSchema: TClientNext;
1014
+ zodValidationSchema: TClientNext;
1015
+ };
1016
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1017
+ sql: z.ZodString;
1018
+ initialState: TNewNext;
1019
+ client: TClientNext;
1020
+ }) => TValidationNext)) => {
1021
+ config: {
1022
+ sql: {
1023
+ pk?: true;
1024
+ nullable?: boolean;
1025
+ default?: string;
1026
+ length?: number;
1027
+ field?: string;
1028
+ type: "varchar";
1029
+ };
1030
+ zodSqlSchema: z.ZodString;
1031
+ zodNewSchema: TNewNext;
1032
+ initialValue: z.TypeOf<TNewNext>;
1033
+ zodClientSchema: TClientNext;
1034
+ zodValidationSchema: TValidationNext;
1035
+ };
1036
+ transform: (transforms: {
1037
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1038
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1039
+ }) => {
1040
+ config: {
1041
+ sql: {
1042
+ pk?: true;
1043
+ nullable?: boolean;
1044
+ default?: string;
1045
+ length?: number;
1046
+ field?: string;
1047
+ type: "varchar";
1048
+ };
1049
+ zodSqlSchema: z.ZodString;
1050
+ zodNewSchema: TNewNext;
1051
+ initialValue: z.TypeOf<TNewNext>;
1052
+ zodClientSchema: TClientNext;
1053
+ zodValidationSchema: TValidationNext;
1054
+ } & {
1055
+ transforms: {
1056
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1057
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1058
+ };
1059
+ };
1060
+ };
1061
+ };
683
1062
  transform: (transforms: {
684
1063
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
685
1064
  toDb: (clientValue: z.TypeOf<TClientNext>) => string;
@@ -697,7 +1076,7 @@ export declare const shape: {
697
1076
  zodNewSchema: TNewNext;
698
1077
  initialValue: z.TypeOf<TNewNext>;
699
1078
  zodClientSchema: TClientNext;
700
- zodValidationSchema: TValidationNext;
1079
+ zodValidationSchema: TClientNext;
701
1080
  } & {
702
1081
  transforms: {
703
1082
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
@@ -707,8 +1086,8 @@ export declare const shape: {
707
1086
  };
708
1087
  };
709
1088
  transform: (transforms: {
710
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
711
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1089
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1090
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
712
1091
  }) => {
713
1092
  config: {
714
1093
  sql: {
@@ -722,41 +1101,16 @@ export declare const shape: {
722
1101
  zodSqlSchema: z.ZodString;
723
1102
  zodNewSchema: TNewNext;
724
1103
  initialValue: z.TypeOf<TNewNext>;
725
- zodClientSchema: TClientNext;
726
- zodValidationSchema: TClientNext;
1104
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1105
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
727
1106
  } & {
728
1107
  transforms: {
729
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
730
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1108
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1109
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
731
1110
  };
732
1111
  };
733
1112
  };
734
1113
  };
735
- transform: (transforms: {
736
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
737
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
738
- }) => {
739
- config: {
740
- sql: {
741
- pk?: true;
742
- nullable?: boolean;
743
- default?: string;
744
- length?: number;
745
- field?: string;
746
- type: "varchar";
747
- };
748
- zodSqlSchema: z.ZodString;
749
- zodNewSchema: TNewNext;
750
- initialValue: z.TypeOf<TNewNext>;
751
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
752
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
753
- } & {
754
- transforms: {
755
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
756
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
757
- };
758
- };
759
- };
760
1114
  };
761
1115
  };
762
1116
  char: (config?: Omit<StringConfig, "type">) => {
@@ -937,29 +1291,8 @@ export declare const shape: {
937
1291
  };
938
1292
  };
939
1293
  };
940
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
941
- sql: z.ZodString;
942
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
943
- config: {
944
- sql: {
945
- pk?: true;
946
- nullable?: boolean;
947
- default?: string;
948
- length?: number;
949
- field?: string;
950
- type: "char";
951
- };
952
- zodSqlSchema: z.ZodString;
953
- zodNewSchema: TNewNext;
954
- initialValue: z.TypeOf<TNewNext>;
955
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
956
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
957
- };
958
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
959
- sql: z.ZodString;
960
- initialState: TNewNext;
961
- client: InferSmartClientType<z.ZodString, TNewNext>;
962
- }) => TValidationNext)) => {
1294
+ initialState: {
1295
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
963
1296
  config: {
964
1297
  sql: {
965
1298
  pk?: true;
@@ -970,15 +1303,16 @@ export declare const shape: {
970
1303
  type: "char";
971
1304
  };
972
1305
  zodSqlSchema: z.ZodString;
973
- zodNewSchema: TNewNext;
974
- initialValue: z.TypeOf<TNewNext>;
975
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
976
- zodValidationSchema: TValidationNext;
1306
+ zodNewSchema: z.ZodString;
1307
+ initialValue: TDefaultNext;
1308
+ zodClientSchema: z.ZodString;
1309
+ zodValidationSchema: z.ZodString;
977
1310
  };
978
- transform: (transforms: {
979
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
980
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
981
- }) => {
1311
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1312
+ sql: z.ZodString;
1313
+ initialState: z.ZodString;
1314
+ client: z.ZodString;
1315
+ }) => TValidationNext)) => {
982
1316
  config: {
983
1317
  sql: {
984
1318
  pk?: true;
@@ -989,22 +1323,157 @@ export declare const shape: {
989
1323
  type: "char";
990
1324
  };
991
1325
  zodSqlSchema: z.ZodString;
992
- zodNewSchema: TNewNext;
993
- initialValue: z.TypeOf<TNewNext>;
994
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1326
+ zodNewSchema: z.ZodString;
1327
+ initialValue: TDefaultNext;
1328
+ zodClientSchema: z.ZodString;
995
1329
  zodValidationSchema: TValidationNext;
996
- } & {
997
- transforms: {
998
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
999
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1330
+ };
1331
+ transform: (transforms: {
1332
+ toClient: (dbValue: string) => string;
1333
+ toDb: (clientValue: string) => string;
1334
+ }) => {
1335
+ config: {
1336
+ sql: {
1337
+ pk?: true;
1338
+ nullable?: boolean;
1339
+ default?: string;
1340
+ length?: number;
1341
+ field?: string;
1342
+ type: "char";
1343
+ };
1344
+ zodSqlSchema: z.ZodString;
1345
+ zodNewSchema: z.ZodString;
1346
+ initialValue: TDefaultNext;
1347
+ zodClientSchema: z.ZodString;
1348
+ zodValidationSchema: TValidationNext;
1349
+ } & {
1350
+ transforms: {
1351
+ toClient: (dbValue: string) => string;
1352
+ toDb: (clientValue: string) => string;
1353
+ };
1000
1354
  };
1001
1355
  };
1002
1356
  };
1003
- };
1004
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1357
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1358
+ sql: z.ZodString;
1359
+ initialState: z.ZodString;
1360
+ }) => TClientNext)) => {
1361
+ config: {
1362
+ sql: {
1363
+ pk?: true;
1364
+ nullable?: boolean;
1365
+ default?: string;
1366
+ length?: number;
1367
+ field?: string;
1368
+ type: "char";
1369
+ };
1370
+ zodSqlSchema: z.ZodString;
1371
+ zodNewSchema: z.ZodString;
1372
+ initialValue: TDefaultNext;
1373
+ zodClientSchema: TClientNext;
1374
+ zodValidationSchema: TClientNext;
1375
+ };
1376
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1377
+ sql: z.ZodString;
1378
+ initialState: z.ZodString;
1379
+ client: TClientNext;
1380
+ }) => TValidationNext)) => {
1381
+ config: {
1382
+ sql: {
1383
+ pk?: true;
1384
+ nullable?: boolean;
1385
+ default?: string;
1386
+ length?: number;
1387
+ field?: string;
1388
+ type: "char";
1389
+ };
1390
+ zodSqlSchema: z.ZodString;
1391
+ zodNewSchema: z.ZodString;
1392
+ initialValue: TDefaultNext;
1393
+ zodClientSchema: TClientNext;
1394
+ zodValidationSchema: TValidationNext;
1395
+ };
1396
+ transform: (transforms: {
1397
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1398
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1399
+ }) => {
1400
+ config: {
1401
+ sql: {
1402
+ pk?: true;
1403
+ nullable?: boolean;
1404
+ default?: string;
1405
+ length?: number;
1406
+ field?: string;
1407
+ type: "char";
1408
+ };
1409
+ zodSqlSchema: z.ZodString;
1410
+ zodNewSchema: z.ZodString;
1411
+ initialValue: TDefaultNext;
1412
+ zodClientSchema: TClientNext;
1413
+ zodValidationSchema: TValidationNext;
1414
+ } & {
1415
+ transforms: {
1416
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1417
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1418
+ };
1419
+ };
1420
+ };
1421
+ };
1422
+ transform: (transforms: {
1423
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1424
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1425
+ }) => {
1426
+ config: {
1427
+ sql: {
1428
+ pk?: true;
1429
+ nullable?: boolean;
1430
+ default?: string;
1431
+ length?: number;
1432
+ field?: string;
1433
+ type: "char";
1434
+ };
1435
+ zodSqlSchema: z.ZodString;
1436
+ zodNewSchema: z.ZodString;
1437
+ initialValue: TDefaultNext;
1438
+ zodClientSchema: TClientNext;
1439
+ zodValidationSchema: TClientNext;
1440
+ } & {
1441
+ transforms: {
1442
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1443
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1444
+ };
1445
+ };
1446
+ };
1447
+ };
1448
+ transform: (transforms: {
1449
+ toClient: (dbValue: string) => string;
1450
+ toDb: (clientValue: string) => string;
1451
+ }) => {
1452
+ config: {
1453
+ sql: {
1454
+ pk?: true;
1455
+ nullable?: boolean;
1456
+ default?: string;
1457
+ length?: number;
1458
+ field?: string;
1459
+ type: "char";
1460
+ };
1461
+ zodSqlSchema: z.ZodString;
1462
+ zodNewSchema: z.ZodString;
1463
+ initialValue: TDefaultNext;
1464
+ zodClientSchema: z.ZodString;
1465
+ zodValidationSchema: z.ZodString;
1466
+ } & {
1467
+ transforms: {
1468
+ toClient: (dbValue: string) => string;
1469
+ toDb: (clientValue: string) => string;
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1005
1475
  sql: z.ZodString;
1006
- initialState: TNewNext;
1007
- }) => TClientNext)) => {
1476
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
1008
1477
  config: {
1009
1478
  sql: {
1010
1479
  pk?: true;
@@ -1017,13 +1486,13 @@ export declare const shape: {
1017
1486
  zodSqlSchema: z.ZodString;
1018
1487
  zodNewSchema: TNewNext;
1019
1488
  initialValue: z.TypeOf<TNewNext>;
1020
- zodClientSchema: TClientNext;
1021
- zodValidationSchema: TClientNext;
1489
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1490
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1022
1491
  };
1023
1492
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1024
1493
  sql: z.ZodString;
1025
1494
  initialState: TNewNext;
1026
- client: TClientNext;
1495
+ client: InferSmartClientType<z.ZodString, TNewNext>;
1027
1496
  }) => TValidationNext)) => {
1028
1497
  config: {
1029
1498
  sql: {
@@ -1037,9 +1506,100 @@ export declare const shape: {
1037
1506
  zodSqlSchema: z.ZodString;
1038
1507
  zodNewSchema: TNewNext;
1039
1508
  initialValue: z.TypeOf<TNewNext>;
1040
- zodClientSchema: TClientNext;
1509
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1041
1510
  zodValidationSchema: TValidationNext;
1042
1511
  };
1512
+ transform: (transforms: {
1513
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1514
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1515
+ }) => {
1516
+ config: {
1517
+ sql: {
1518
+ pk?: true;
1519
+ nullable?: boolean;
1520
+ default?: string;
1521
+ length?: number;
1522
+ field?: string;
1523
+ type: "char";
1524
+ };
1525
+ zodSqlSchema: z.ZodString;
1526
+ zodNewSchema: TNewNext;
1527
+ initialValue: z.TypeOf<TNewNext>;
1528
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1529
+ zodValidationSchema: TValidationNext;
1530
+ } & {
1531
+ transforms: {
1532
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1533
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1534
+ };
1535
+ };
1536
+ };
1537
+ };
1538
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1539
+ sql: z.ZodString;
1540
+ initialState: TNewNext;
1541
+ }) => TClientNext)) => {
1542
+ config: {
1543
+ sql: {
1544
+ pk?: true;
1545
+ nullable?: boolean;
1546
+ default?: string;
1547
+ length?: number;
1548
+ field?: string;
1549
+ type: "char";
1550
+ };
1551
+ zodSqlSchema: z.ZodString;
1552
+ zodNewSchema: TNewNext;
1553
+ initialValue: z.TypeOf<TNewNext>;
1554
+ zodClientSchema: TClientNext;
1555
+ zodValidationSchema: TClientNext;
1556
+ };
1557
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1558
+ sql: z.ZodString;
1559
+ initialState: TNewNext;
1560
+ client: TClientNext;
1561
+ }) => TValidationNext)) => {
1562
+ config: {
1563
+ sql: {
1564
+ pk?: true;
1565
+ nullable?: boolean;
1566
+ default?: string;
1567
+ length?: number;
1568
+ field?: string;
1569
+ type: "char";
1570
+ };
1571
+ zodSqlSchema: z.ZodString;
1572
+ zodNewSchema: TNewNext;
1573
+ initialValue: z.TypeOf<TNewNext>;
1574
+ zodClientSchema: TClientNext;
1575
+ zodValidationSchema: TValidationNext;
1576
+ };
1577
+ transform: (transforms: {
1578
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1579
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1580
+ }) => {
1581
+ config: {
1582
+ sql: {
1583
+ pk?: true;
1584
+ nullable?: boolean;
1585
+ default?: string;
1586
+ length?: number;
1587
+ field?: string;
1588
+ type: "char";
1589
+ };
1590
+ zodSqlSchema: z.ZodString;
1591
+ zodNewSchema: TNewNext;
1592
+ initialValue: z.TypeOf<TNewNext>;
1593
+ zodClientSchema: TClientNext;
1594
+ zodValidationSchema: TValidationNext;
1595
+ } & {
1596
+ transforms: {
1597
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1598
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1599
+ };
1600
+ };
1601
+ };
1602
+ };
1043
1603
  transform: (transforms: {
1044
1604
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1045
1605
  toDb: (clientValue: z.TypeOf<TClientNext>) => string;
@@ -1057,7 +1617,7 @@ export declare const shape: {
1057
1617
  zodNewSchema: TNewNext;
1058
1618
  initialValue: z.TypeOf<TNewNext>;
1059
1619
  zodClientSchema: TClientNext;
1060
- zodValidationSchema: TValidationNext;
1620
+ zodValidationSchema: TClientNext;
1061
1621
  } & {
1062
1622
  transforms: {
1063
1623
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
@@ -1067,8 +1627,8 @@ export declare const shape: {
1067
1627
  };
1068
1628
  };
1069
1629
  transform: (transforms: {
1070
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1071
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1630
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1631
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1072
1632
  }) => {
1073
1633
  config: {
1074
1634
  sql: {
@@ -1082,41 +1642,16 @@ export declare const shape: {
1082
1642
  zodSqlSchema: z.ZodString;
1083
1643
  zodNewSchema: TNewNext;
1084
1644
  initialValue: z.TypeOf<TNewNext>;
1085
- zodClientSchema: TClientNext;
1086
- zodValidationSchema: TClientNext;
1645
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1646
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1087
1647
  } & {
1088
1648
  transforms: {
1089
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1090
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1649
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1650
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1091
1651
  };
1092
1652
  };
1093
1653
  };
1094
1654
  };
1095
- transform: (transforms: {
1096
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1097
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1098
- }) => {
1099
- config: {
1100
- sql: {
1101
- pk?: true;
1102
- nullable?: boolean;
1103
- default?: string;
1104
- length?: number;
1105
- field?: string;
1106
- type: "char";
1107
- };
1108
- zodSqlSchema: z.ZodString;
1109
- zodNewSchema: TNewNext;
1110
- initialValue: z.TypeOf<TNewNext>;
1111
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1112
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1113
- } & {
1114
- transforms: {
1115
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1116
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1117
- };
1118
- };
1119
- };
1120
1655
  };
1121
1656
  };
1122
1657
  text: (config?: Omit<StringConfig, "type" | "length">) => {
@@ -1289,28 +1824,8 @@ export declare const shape: {
1289
1824
  };
1290
1825
  };
1291
1826
  };
1292
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1293
- sql: z.ZodString;
1294
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
1295
- config: {
1296
- sql: {
1297
- pk?: true;
1298
- nullable?: boolean;
1299
- default?: string;
1300
- field?: string;
1301
- type: "text";
1302
- };
1303
- zodSqlSchema: z.ZodString;
1304
- zodNewSchema: TNewNext;
1305
- initialValue: z.TypeOf<TNewNext>;
1306
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1307
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1308
- };
1309
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1310
- sql: z.ZodString;
1311
- initialState: TNewNext;
1312
- client: InferSmartClientType<z.ZodString, TNewNext>;
1313
- }) => TValidationNext)) => {
1827
+ initialState: {
1828
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
1314
1829
  config: {
1315
1830
  sql: {
1316
1831
  pk?: true;
@@ -1320,58 +1835,15 @@ export declare const shape: {
1320
1835
  type: "text";
1321
1836
  };
1322
1837
  zodSqlSchema: z.ZodString;
1323
- zodNewSchema: TNewNext;
1324
- initialValue: z.TypeOf<TNewNext>;
1325
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1326
- zodValidationSchema: TValidationNext;
1327
- };
1328
- transform: (transforms: {
1329
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1330
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1331
- }) => {
1332
- config: {
1333
- sql: {
1334
- pk?: true;
1335
- nullable?: boolean;
1336
- default?: string;
1337
- field?: string;
1338
- type: "text";
1339
- };
1340
- zodSqlSchema: z.ZodString;
1341
- zodNewSchema: TNewNext;
1342
- initialValue: z.TypeOf<TNewNext>;
1343
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1344
- zodValidationSchema: TValidationNext;
1345
- } & {
1346
- transforms: {
1347
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1348
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1349
- };
1350
- };
1351
- };
1352
- };
1353
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1354
- sql: z.ZodString;
1355
- initialState: TNewNext;
1356
- }) => TClientNext)) => {
1357
- config: {
1358
- sql: {
1359
- pk?: true;
1360
- nullable?: boolean;
1361
- default?: string;
1362
- field?: string;
1363
- type: "text";
1364
- };
1365
- zodSqlSchema: z.ZodString;
1366
- zodNewSchema: TNewNext;
1367
- initialValue: z.TypeOf<TNewNext>;
1368
- zodClientSchema: TClientNext;
1369
- zodValidationSchema: TClientNext;
1838
+ zodNewSchema: z.ZodString;
1839
+ initialValue: TDefaultNext;
1840
+ zodClientSchema: z.ZodString;
1841
+ zodValidationSchema: z.ZodString;
1370
1842
  };
1371
1843
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1372
1844
  sql: z.ZodString;
1373
- initialState: TNewNext;
1374
- client: TClientNext;
1845
+ initialState: z.ZodString;
1846
+ client: z.ZodString;
1375
1847
  }) => TValidationNext)) => {
1376
1848
  config: {
1377
1849
  sql: {
@@ -1382,14 +1854,14 @@ export declare const shape: {
1382
1854
  type: "text";
1383
1855
  };
1384
1856
  zodSqlSchema: z.ZodString;
1385
- zodNewSchema: TNewNext;
1386
- initialValue: z.TypeOf<TNewNext>;
1387
- zodClientSchema: TClientNext;
1857
+ zodNewSchema: z.ZodString;
1858
+ initialValue: TDefaultNext;
1859
+ zodClientSchema: z.ZodString;
1388
1860
  zodValidationSchema: TValidationNext;
1389
1861
  };
1390
1862
  transform: (transforms: {
1391
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1392
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1863
+ toClient: (dbValue: string) => string;
1864
+ toDb: (clientValue: string) => string;
1393
1865
  }) => {
1394
1866
  config: {
1395
1867
  sql: {
@@ -1400,22 +1872,22 @@ export declare const shape: {
1400
1872
  type: "text";
1401
1873
  };
1402
1874
  zodSqlSchema: z.ZodString;
1403
- zodNewSchema: TNewNext;
1404
- initialValue: z.TypeOf<TNewNext>;
1405
- zodClientSchema: TClientNext;
1875
+ zodNewSchema: z.ZodString;
1876
+ initialValue: TDefaultNext;
1877
+ zodClientSchema: z.ZodString;
1406
1878
  zodValidationSchema: TValidationNext;
1407
1879
  } & {
1408
1880
  transforms: {
1409
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1410
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1881
+ toClient: (dbValue: string) => string;
1882
+ toDb: (clientValue: string) => string;
1411
1883
  };
1412
1884
  };
1413
1885
  };
1414
1886
  };
1415
- transform: (transforms: {
1416
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1417
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1418
- }) => {
1887
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
1888
+ sql: z.ZodString;
1889
+ initialState: z.ZodString;
1890
+ }) => TClientNext)) => {
1419
1891
  config: {
1420
1892
  sql: {
1421
1893
  pk?: true;
@@ -1425,22 +1897,108 @@ export declare const shape: {
1425
1897
  type: "text";
1426
1898
  };
1427
1899
  zodSqlSchema: z.ZodString;
1428
- zodNewSchema: TNewNext;
1429
- initialValue: z.TypeOf<TNewNext>;
1900
+ zodNewSchema: z.ZodString;
1901
+ initialValue: TDefaultNext;
1430
1902
  zodClientSchema: TClientNext;
1431
1903
  zodValidationSchema: TClientNext;
1432
- } & {
1433
- transforms: {
1904
+ };
1905
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1906
+ sql: z.ZodString;
1907
+ initialState: z.ZodString;
1908
+ client: TClientNext;
1909
+ }) => TValidationNext)) => {
1910
+ config: {
1911
+ sql: {
1912
+ pk?: true;
1913
+ nullable?: boolean;
1914
+ default?: string;
1915
+ field?: string;
1916
+ type: "text";
1917
+ };
1918
+ zodSqlSchema: z.ZodString;
1919
+ zodNewSchema: z.ZodString;
1920
+ initialValue: TDefaultNext;
1921
+ zodClientSchema: TClientNext;
1922
+ zodValidationSchema: TValidationNext;
1923
+ };
1924
+ transform: (transforms: {
1434
1925
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1435
1926
  toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1927
+ }) => {
1928
+ config: {
1929
+ sql: {
1930
+ pk?: true;
1931
+ nullable?: boolean;
1932
+ default?: string;
1933
+ field?: string;
1934
+ type: "text";
1935
+ };
1936
+ zodSqlSchema: z.ZodString;
1937
+ zodNewSchema: z.ZodString;
1938
+ initialValue: TDefaultNext;
1939
+ zodClientSchema: TClientNext;
1940
+ zodValidationSchema: TValidationNext;
1941
+ } & {
1942
+ transforms: {
1943
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1944
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1945
+ };
1946
+ };
1947
+ };
1948
+ };
1949
+ transform: (transforms: {
1950
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1951
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1952
+ }) => {
1953
+ config: {
1954
+ sql: {
1955
+ pk?: true;
1956
+ nullable?: boolean;
1957
+ default?: string;
1958
+ field?: string;
1959
+ type: "text";
1960
+ };
1961
+ zodSqlSchema: z.ZodString;
1962
+ zodNewSchema: z.ZodString;
1963
+ initialValue: TDefaultNext;
1964
+ zodClientSchema: TClientNext;
1965
+ zodValidationSchema: TClientNext;
1966
+ } & {
1967
+ transforms: {
1968
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1969
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
1970
+ };
1971
+ };
1972
+ };
1973
+ };
1974
+ transform: (transforms: {
1975
+ toClient: (dbValue: string) => string;
1976
+ toDb: (clientValue: string) => string;
1977
+ }) => {
1978
+ config: {
1979
+ sql: {
1980
+ pk?: true;
1981
+ nullable?: boolean;
1982
+ default?: string;
1983
+ field?: string;
1984
+ type: "text";
1985
+ };
1986
+ zodSqlSchema: z.ZodString;
1987
+ zodNewSchema: z.ZodString;
1988
+ initialValue: TDefaultNext;
1989
+ zodClientSchema: z.ZodString;
1990
+ zodValidationSchema: z.ZodString;
1991
+ } & {
1992
+ transforms: {
1993
+ toClient: (dbValue: string) => string;
1994
+ toDb: (clientValue: string) => string;
1436
1995
  };
1437
1996
  };
1438
1997
  };
1439
1998
  };
1440
- transform: (transforms: {
1441
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1442
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1443
- }) => {
1999
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2000
+ sql: z.ZodString;
2001
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
1444
2002
  config: {
1445
2003
  sql: {
1446
2004
  pk?: true;
@@ -1454,10 +2012,160 @@ export declare const shape: {
1454
2012
  initialValue: z.TypeOf<TNewNext>;
1455
2013
  zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1456
2014
  zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1457
- } & {
1458
- transforms: {
2015
+ };
2016
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2017
+ sql: z.ZodString;
2018
+ initialState: TNewNext;
2019
+ client: InferSmartClientType<z.ZodString, TNewNext>;
2020
+ }) => TValidationNext)) => {
2021
+ config: {
2022
+ sql: {
2023
+ pk?: true;
2024
+ nullable?: boolean;
2025
+ default?: string;
2026
+ field?: string;
2027
+ type: "text";
2028
+ };
2029
+ zodSqlSchema: z.ZodString;
2030
+ zodNewSchema: TNewNext;
2031
+ initialValue: z.TypeOf<TNewNext>;
2032
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2033
+ zodValidationSchema: TValidationNext;
2034
+ };
2035
+ transform: (transforms: {
1459
2036
  toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1460
2037
  toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2038
+ }) => {
2039
+ config: {
2040
+ sql: {
2041
+ pk?: true;
2042
+ nullable?: boolean;
2043
+ default?: string;
2044
+ field?: string;
2045
+ type: "text";
2046
+ };
2047
+ zodSqlSchema: z.ZodString;
2048
+ zodNewSchema: TNewNext;
2049
+ initialValue: z.TypeOf<TNewNext>;
2050
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2051
+ zodValidationSchema: TValidationNext;
2052
+ } & {
2053
+ transforms: {
2054
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2055
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2056
+ };
2057
+ };
2058
+ };
2059
+ };
2060
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2061
+ sql: z.ZodString;
2062
+ initialState: TNewNext;
2063
+ }) => TClientNext)) => {
2064
+ config: {
2065
+ sql: {
2066
+ pk?: true;
2067
+ nullable?: boolean;
2068
+ default?: string;
2069
+ field?: string;
2070
+ type: "text";
2071
+ };
2072
+ zodSqlSchema: z.ZodString;
2073
+ zodNewSchema: TNewNext;
2074
+ initialValue: z.TypeOf<TNewNext>;
2075
+ zodClientSchema: TClientNext;
2076
+ zodValidationSchema: TClientNext;
2077
+ };
2078
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2079
+ sql: z.ZodString;
2080
+ initialState: TNewNext;
2081
+ client: TClientNext;
2082
+ }) => TValidationNext)) => {
2083
+ config: {
2084
+ sql: {
2085
+ pk?: true;
2086
+ nullable?: boolean;
2087
+ default?: string;
2088
+ field?: string;
2089
+ type: "text";
2090
+ };
2091
+ zodSqlSchema: z.ZodString;
2092
+ zodNewSchema: TNewNext;
2093
+ initialValue: z.TypeOf<TNewNext>;
2094
+ zodClientSchema: TClientNext;
2095
+ zodValidationSchema: TValidationNext;
2096
+ };
2097
+ transform: (transforms: {
2098
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2099
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2100
+ }) => {
2101
+ config: {
2102
+ sql: {
2103
+ pk?: true;
2104
+ nullable?: boolean;
2105
+ default?: string;
2106
+ field?: string;
2107
+ type: "text";
2108
+ };
2109
+ zodSqlSchema: z.ZodString;
2110
+ zodNewSchema: TNewNext;
2111
+ initialValue: z.TypeOf<TNewNext>;
2112
+ zodClientSchema: TClientNext;
2113
+ zodValidationSchema: TValidationNext;
2114
+ } & {
2115
+ transforms: {
2116
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2117
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2118
+ };
2119
+ };
2120
+ };
2121
+ };
2122
+ transform: (transforms: {
2123
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2124
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2125
+ }) => {
2126
+ config: {
2127
+ sql: {
2128
+ pk?: true;
2129
+ nullable?: boolean;
2130
+ default?: string;
2131
+ field?: string;
2132
+ type: "text";
2133
+ };
2134
+ zodSqlSchema: z.ZodString;
2135
+ zodNewSchema: TNewNext;
2136
+ initialValue: z.TypeOf<TNewNext>;
2137
+ zodClientSchema: TClientNext;
2138
+ zodValidationSchema: TClientNext;
2139
+ } & {
2140
+ transforms: {
2141
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2142
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2143
+ };
2144
+ };
2145
+ };
2146
+ };
2147
+ transform: (transforms: {
2148
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2149
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2150
+ }) => {
2151
+ config: {
2152
+ sql: {
2153
+ pk?: true;
2154
+ nullable?: boolean;
2155
+ default?: string;
2156
+ field?: string;
2157
+ type: "text";
2158
+ };
2159
+ zodSqlSchema: z.ZodString;
2160
+ zodNewSchema: TNewNext;
2161
+ initialValue: z.TypeOf<TNewNext>;
2162
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2163
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
2164
+ } & {
2165
+ transforms: {
2166
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2167
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2168
+ };
1461
2169
  };
1462
2170
  };
1463
2171
  };
@@ -1633,28 +2341,8 @@ export declare const shape: {
1633
2341
  };
1634
2342
  };
1635
2343
  };
1636
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1637
- sql: z.ZodString;
1638
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
1639
- config: {
1640
- sql: {
1641
- pk?: true;
1642
- nullable?: boolean;
1643
- default?: string;
1644
- field?: string;
1645
- type: "longtext";
1646
- };
1647
- zodSqlSchema: z.ZodString;
1648
- zodNewSchema: TNewNext;
1649
- initialValue: z.TypeOf<TNewNext>;
1650
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1651
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1652
- };
1653
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1654
- sql: z.ZodString;
1655
- initialState: TNewNext;
1656
- client: InferSmartClientType<z.ZodString, TNewNext>;
1657
- }) => TValidationNext)) => {
2344
+ initialState: {
2345
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
1658
2346
  config: {
1659
2347
  sql: {
1660
2348
  pk?: true;
@@ -1664,14 +2352,145 @@ export declare const shape: {
1664
2352
  type: "longtext";
1665
2353
  };
1666
2354
  zodSqlSchema: z.ZodString;
1667
- zodNewSchema: TNewNext;
1668
- initialValue: z.TypeOf<TNewNext>;
1669
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1670
- zodValidationSchema: TValidationNext;
2355
+ zodNewSchema: z.ZodString;
2356
+ initialValue: TDefaultNext;
2357
+ zodClientSchema: z.ZodString;
2358
+ zodValidationSchema: z.ZodString;
2359
+ };
2360
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2361
+ sql: z.ZodString;
2362
+ initialState: z.ZodString;
2363
+ client: z.ZodString;
2364
+ }) => TValidationNext)) => {
2365
+ config: {
2366
+ sql: {
2367
+ pk?: true;
2368
+ nullable?: boolean;
2369
+ default?: string;
2370
+ field?: string;
2371
+ type: "longtext";
2372
+ };
2373
+ zodSqlSchema: z.ZodString;
2374
+ zodNewSchema: z.ZodString;
2375
+ initialValue: TDefaultNext;
2376
+ zodClientSchema: z.ZodString;
2377
+ zodValidationSchema: TValidationNext;
2378
+ };
2379
+ transform: (transforms: {
2380
+ toClient: (dbValue: string) => string;
2381
+ toDb: (clientValue: string) => string;
2382
+ }) => {
2383
+ config: {
2384
+ sql: {
2385
+ pk?: true;
2386
+ nullable?: boolean;
2387
+ default?: string;
2388
+ field?: string;
2389
+ type: "longtext";
2390
+ };
2391
+ zodSqlSchema: z.ZodString;
2392
+ zodNewSchema: z.ZodString;
2393
+ initialValue: TDefaultNext;
2394
+ zodClientSchema: z.ZodString;
2395
+ zodValidationSchema: TValidationNext;
2396
+ } & {
2397
+ transforms: {
2398
+ toClient: (dbValue: string) => string;
2399
+ toDb: (clientValue: string) => string;
2400
+ };
2401
+ };
2402
+ };
2403
+ };
2404
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2405
+ sql: z.ZodString;
2406
+ initialState: z.ZodString;
2407
+ }) => TClientNext)) => {
2408
+ config: {
2409
+ sql: {
2410
+ pk?: true;
2411
+ nullable?: boolean;
2412
+ default?: string;
2413
+ field?: string;
2414
+ type: "longtext";
2415
+ };
2416
+ zodSqlSchema: z.ZodString;
2417
+ zodNewSchema: z.ZodString;
2418
+ initialValue: TDefaultNext;
2419
+ zodClientSchema: TClientNext;
2420
+ zodValidationSchema: TClientNext;
2421
+ };
2422
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2423
+ sql: z.ZodString;
2424
+ initialState: z.ZodString;
2425
+ client: TClientNext;
2426
+ }) => TValidationNext)) => {
2427
+ config: {
2428
+ sql: {
2429
+ pk?: true;
2430
+ nullable?: boolean;
2431
+ default?: string;
2432
+ field?: string;
2433
+ type: "longtext";
2434
+ };
2435
+ zodSqlSchema: z.ZodString;
2436
+ zodNewSchema: z.ZodString;
2437
+ initialValue: TDefaultNext;
2438
+ zodClientSchema: TClientNext;
2439
+ zodValidationSchema: TValidationNext;
2440
+ };
2441
+ transform: (transforms: {
2442
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2443
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2444
+ }) => {
2445
+ config: {
2446
+ sql: {
2447
+ pk?: true;
2448
+ nullable?: boolean;
2449
+ default?: string;
2450
+ field?: string;
2451
+ type: "longtext";
2452
+ };
2453
+ zodSqlSchema: z.ZodString;
2454
+ zodNewSchema: z.ZodString;
2455
+ initialValue: TDefaultNext;
2456
+ zodClientSchema: TClientNext;
2457
+ zodValidationSchema: TValidationNext;
2458
+ } & {
2459
+ transforms: {
2460
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2461
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2462
+ };
2463
+ };
2464
+ };
2465
+ };
2466
+ transform: (transforms: {
2467
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2468
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2469
+ }) => {
2470
+ config: {
2471
+ sql: {
2472
+ pk?: true;
2473
+ nullable?: boolean;
2474
+ default?: string;
2475
+ field?: string;
2476
+ type: "longtext";
2477
+ };
2478
+ zodSqlSchema: z.ZodString;
2479
+ zodNewSchema: z.ZodString;
2480
+ initialValue: TDefaultNext;
2481
+ zodClientSchema: TClientNext;
2482
+ zodValidationSchema: TClientNext;
2483
+ } & {
2484
+ transforms: {
2485
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2486
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2487
+ };
2488
+ };
2489
+ };
1671
2490
  };
1672
2491
  transform: (transforms: {
1673
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1674
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2492
+ toClient: (dbValue: string) => string;
2493
+ toDb: (clientValue: string) => string;
1675
2494
  }) => {
1676
2495
  config: {
1677
2496
  sql: {
@@ -1682,22 +2501,21 @@ export declare const shape: {
1682
2501
  type: "longtext";
1683
2502
  };
1684
2503
  zodSqlSchema: z.ZodString;
1685
- zodNewSchema: TNewNext;
1686
- initialValue: z.TypeOf<TNewNext>;
1687
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1688
- zodValidationSchema: TValidationNext;
2504
+ zodNewSchema: z.ZodString;
2505
+ initialValue: TDefaultNext;
2506
+ zodClientSchema: z.ZodString;
2507
+ zodValidationSchema: z.ZodString;
1689
2508
  } & {
1690
2509
  transforms: {
1691
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1692
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2510
+ toClient: (dbValue: string) => string;
2511
+ toDb: (clientValue: string) => string;
1693
2512
  };
1694
2513
  };
1695
2514
  };
1696
2515
  };
1697
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2516
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1698
2517
  sql: z.ZodString;
1699
- initialState: TNewNext;
1700
- }) => TClientNext)) => {
2518
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
1701
2519
  config: {
1702
2520
  sql: {
1703
2521
  pk?: true;
@@ -1709,13 +2527,13 @@ export declare const shape: {
1709
2527
  zodSqlSchema: z.ZodString;
1710
2528
  zodNewSchema: TNewNext;
1711
2529
  initialValue: z.TypeOf<TNewNext>;
1712
- zodClientSchema: TClientNext;
1713
- zodValidationSchema: TClientNext;
2530
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2531
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1714
2532
  };
1715
2533
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1716
2534
  sql: z.ZodString;
1717
2535
  initialState: TNewNext;
1718
- client: TClientNext;
2536
+ client: InferSmartClientType<z.ZodString, TNewNext>;
1719
2537
  }) => TValidationNext)) => {
1720
2538
  config: {
1721
2539
  sql: {
@@ -1728,9 +2546,96 @@ export declare const shape: {
1728
2546
  zodSqlSchema: z.ZodString;
1729
2547
  zodNewSchema: TNewNext;
1730
2548
  initialValue: z.TypeOf<TNewNext>;
1731
- zodClientSchema: TClientNext;
2549
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1732
2550
  zodValidationSchema: TValidationNext;
1733
2551
  };
2552
+ transform: (transforms: {
2553
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2554
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2555
+ }) => {
2556
+ config: {
2557
+ sql: {
2558
+ pk?: true;
2559
+ nullable?: boolean;
2560
+ default?: string;
2561
+ field?: string;
2562
+ type: "longtext";
2563
+ };
2564
+ zodSqlSchema: z.ZodString;
2565
+ zodNewSchema: TNewNext;
2566
+ initialValue: z.TypeOf<TNewNext>;
2567
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2568
+ zodValidationSchema: TValidationNext;
2569
+ } & {
2570
+ transforms: {
2571
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2572
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
2573
+ };
2574
+ };
2575
+ };
2576
+ };
2577
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2578
+ sql: z.ZodString;
2579
+ initialState: TNewNext;
2580
+ }) => TClientNext)) => {
2581
+ config: {
2582
+ sql: {
2583
+ pk?: true;
2584
+ nullable?: boolean;
2585
+ default?: string;
2586
+ field?: string;
2587
+ type: "longtext";
2588
+ };
2589
+ zodSqlSchema: z.ZodString;
2590
+ zodNewSchema: TNewNext;
2591
+ initialValue: z.TypeOf<TNewNext>;
2592
+ zodClientSchema: TClientNext;
2593
+ zodValidationSchema: TClientNext;
2594
+ };
2595
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2596
+ sql: z.ZodString;
2597
+ initialState: TNewNext;
2598
+ client: TClientNext;
2599
+ }) => TValidationNext)) => {
2600
+ config: {
2601
+ sql: {
2602
+ pk?: true;
2603
+ nullable?: boolean;
2604
+ default?: string;
2605
+ field?: string;
2606
+ type: "longtext";
2607
+ };
2608
+ zodSqlSchema: z.ZodString;
2609
+ zodNewSchema: TNewNext;
2610
+ initialValue: z.TypeOf<TNewNext>;
2611
+ zodClientSchema: TClientNext;
2612
+ zodValidationSchema: TValidationNext;
2613
+ };
2614
+ transform: (transforms: {
2615
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2616
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2617
+ }) => {
2618
+ config: {
2619
+ sql: {
2620
+ pk?: true;
2621
+ nullable?: boolean;
2622
+ default?: string;
2623
+ field?: string;
2624
+ type: "longtext";
2625
+ };
2626
+ zodSqlSchema: z.ZodString;
2627
+ zodNewSchema: TNewNext;
2628
+ initialValue: z.TypeOf<TNewNext>;
2629
+ zodClientSchema: TClientNext;
2630
+ zodValidationSchema: TValidationNext;
2631
+ } & {
2632
+ transforms: {
2633
+ toClient: (dbValue: string) => z.TypeOf<TClientNext>;
2634
+ toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2635
+ };
2636
+ };
2637
+ };
2638
+ };
1734
2639
  transform: (transforms: {
1735
2640
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1736
2641
  toDb: (clientValue: z.TypeOf<TClientNext>) => string;
@@ -1747,7 +2652,7 @@ export declare const shape: {
1747
2652
  zodNewSchema: TNewNext;
1748
2653
  initialValue: z.TypeOf<TNewNext>;
1749
2654
  zodClientSchema: TClientNext;
1750
- zodValidationSchema: TValidationNext;
2655
+ zodValidationSchema: TClientNext;
1751
2656
  } & {
1752
2657
  transforms: {
1753
2658
  toClient: (dbValue: string) => z.TypeOf<TClientNext>;
@@ -1757,8 +2662,8 @@ export declare const shape: {
1757
2662
  };
1758
2663
  };
1759
2664
  transform: (transforms: {
1760
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1761
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2665
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2666
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1762
2667
  }) => {
1763
2668
  config: {
1764
2669
  sql: {
@@ -1771,40 +2676,16 @@ export declare const shape: {
1771
2676
  zodSqlSchema: z.ZodString;
1772
2677
  zodNewSchema: TNewNext;
1773
2678
  initialValue: z.TypeOf<TNewNext>;
1774
- zodClientSchema: TClientNext;
1775
- zodValidationSchema: TClientNext;
2679
+ zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
2680
+ zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1776
2681
  } & {
1777
2682
  transforms: {
1778
- toClient: (dbValue: string) => z.TypeOf<TClientNext>;
1779
- toDb: (clientValue: z.TypeOf<TClientNext>) => string;
2683
+ toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
2684
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1780
2685
  };
1781
2686
  };
1782
2687
  };
1783
2688
  };
1784
- transform: (transforms: {
1785
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1786
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1787
- }) => {
1788
- config: {
1789
- sql: {
1790
- pk?: true;
1791
- nullable?: boolean;
1792
- default?: string;
1793
- field?: string;
1794
- type: "longtext";
1795
- };
1796
- zodSqlSchema: z.ZodString;
1797
- zodNewSchema: TNewNext;
1798
- initialValue: z.TypeOf<TNewNext>;
1799
- zodClientSchema: InferSmartClientType<z.ZodString, TNewNext>;
1800
- zodValidationSchema: InferSmartClientType<z.ZodString, TNewNext>;
1801
- } & {
1802
- transforms: {
1803
- toClient: (dbValue: string) => z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>;
1804
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodString, TNewNext>>) => string;
1805
- };
1806
- };
1807
- };
1808
2689
  };
1809
2690
  };
1810
2691
  boolean: (config?: BooleanConfig) => {
@@ -1977,28 +2858,8 @@ export declare const shape: {
1977
2858
  };
1978
2859
  };
1979
2860
  };
1980
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
1981
- sql: z.ZodBoolean;
1982
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
1983
- config: {
1984
- sql: {
1985
- nullable?: boolean;
1986
- pk?: true;
1987
- field?: string;
1988
- default?: boolean;
1989
- type: "boolean";
1990
- };
1991
- zodSqlSchema: z.ZodBoolean;
1992
- zodNewSchema: TNewNext;
1993
- initialValue: z.TypeOf<TNewNext>;
1994
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
1995
- zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
1996
- };
1997
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
1998
- sql: z.ZodBoolean;
1999
- initialState: TNewNext;
2000
- client: InferSmartClientType<z.ZodBoolean, TNewNext>;
2001
- }) => TValidationNext)) => {
2861
+ initialState: {
2862
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
2002
2863
  config: {
2003
2864
  sql: {
2004
2865
  nullable?: boolean;
@@ -2007,15 +2868,146 @@ export declare const shape: {
2007
2868
  default?: boolean;
2008
2869
  type: "boolean";
2009
2870
  };
2010
- zodSqlSchema: z.ZodBoolean;
2011
- zodNewSchema: TNewNext;
2012
- initialValue: z.TypeOf<TNewNext>;
2013
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2014
- zodValidationSchema: TValidationNext;
2871
+ zodSqlSchema: z.ZodBoolean;
2872
+ zodNewSchema: z.ZodBoolean;
2873
+ initialValue: TDefaultNext;
2874
+ zodClientSchema: z.ZodBoolean;
2875
+ zodValidationSchema: z.ZodBoolean;
2876
+ };
2877
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2878
+ sql: z.ZodBoolean;
2879
+ initialState: z.ZodBoolean;
2880
+ client: z.ZodBoolean;
2881
+ }) => TValidationNext)) => {
2882
+ config: {
2883
+ sql: {
2884
+ nullable?: boolean;
2885
+ pk?: true;
2886
+ field?: string;
2887
+ default?: boolean;
2888
+ type: "boolean";
2889
+ };
2890
+ zodSqlSchema: z.ZodBoolean;
2891
+ zodNewSchema: z.ZodBoolean;
2892
+ initialValue: TDefaultNext;
2893
+ zodClientSchema: z.ZodBoolean;
2894
+ zodValidationSchema: TValidationNext;
2895
+ };
2896
+ transform: (transforms: {
2897
+ toClient: (dbValue: boolean) => boolean;
2898
+ toDb: (clientValue: boolean) => boolean;
2899
+ }) => {
2900
+ config: {
2901
+ sql: {
2902
+ nullable?: boolean;
2903
+ pk?: true;
2904
+ field?: string;
2905
+ default?: boolean;
2906
+ type: "boolean";
2907
+ };
2908
+ zodSqlSchema: z.ZodBoolean;
2909
+ zodNewSchema: z.ZodBoolean;
2910
+ initialValue: TDefaultNext;
2911
+ zodClientSchema: z.ZodBoolean;
2912
+ zodValidationSchema: TValidationNext;
2913
+ } & {
2914
+ transforms: {
2915
+ toClient: (dbValue: boolean) => boolean;
2916
+ toDb: (clientValue: boolean) => boolean;
2917
+ };
2918
+ };
2919
+ };
2920
+ };
2921
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2922
+ sql: z.ZodBoolean;
2923
+ initialState: z.ZodBoolean;
2924
+ }) => TClientNext)) => {
2925
+ config: {
2926
+ sql: {
2927
+ nullable?: boolean;
2928
+ pk?: true;
2929
+ field?: string;
2930
+ default?: boolean;
2931
+ type: "boolean";
2932
+ };
2933
+ zodSqlSchema: z.ZodBoolean;
2934
+ zodNewSchema: z.ZodBoolean;
2935
+ initialValue: TDefaultNext;
2936
+ zodClientSchema: TClientNext;
2937
+ zodValidationSchema: TClientNext;
2938
+ };
2939
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2940
+ sql: z.ZodBoolean;
2941
+ initialState: z.ZodBoolean;
2942
+ client: TClientNext;
2943
+ }) => TValidationNext)) => {
2944
+ config: {
2945
+ sql: {
2946
+ nullable?: boolean;
2947
+ pk?: true;
2948
+ field?: string;
2949
+ default?: boolean;
2950
+ type: "boolean";
2951
+ };
2952
+ zodSqlSchema: z.ZodBoolean;
2953
+ zodNewSchema: z.ZodBoolean;
2954
+ initialValue: TDefaultNext;
2955
+ zodClientSchema: TClientNext;
2956
+ zodValidationSchema: TValidationNext;
2957
+ };
2958
+ transform: (transforms: {
2959
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2960
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2961
+ }) => {
2962
+ config: {
2963
+ sql: {
2964
+ nullable?: boolean;
2965
+ pk?: true;
2966
+ field?: string;
2967
+ default?: boolean;
2968
+ type: "boolean";
2969
+ };
2970
+ zodSqlSchema: z.ZodBoolean;
2971
+ zodNewSchema: z.ZodBoolean;
2972
+ initialValue: TDefaultNext;
2973
+ zodClientSchema: TClientNext;
2974
+ zodValidationSchema: TValidationNext;
2975
+ } & {
2976
+ transforms: {
2977
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2978
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2979
+ };
2980
+ };
2981
+ };
2982
+ };
2983
+ transform: (transforms: {
2984
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2985
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
2986
+ }) => {
2987
+ config: {
2988
+ sql: {
2989
+ nullable?: boolean;
2990
+ pk?: true;
2991
+ field?: string;
2992
+ default?: boolean;
2993
+ type: "boolean";
2994
+ };
2995
+ zodSqlSchema: z.ZodBoolean;
2996
+ zodNewSchema: z.ZodBoolean;
2997
+ initialValue: TDefaultNext;
2998
+ zodClientSchema: TClientNext;
2999
+ zodValidationSchema: TClientNext;
3000
+ } & {
3001
+ transforms: {
3002
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3003
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3004
+ };
3005
+ };
3006
+ };
2015
3007
  };
2016
3008
  transform: (transforms: {
2017
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
2018
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3009
+ toClient: (dbValue: boolean) => boolean;
3010
+ toDb: (clientValue: boolean) => boolean;
2019
3011
  }) => {
2020
3012
  config: {
2021
3013
  sql: {
@@ -2026,22 +3018,21 @@ export declare const shape: {
2026
3018
  type: "boolean";
2027
3019
  };
2028
3020
  zodSqlSchema: z.ZodBoolean;
2029
- zodNewSchema: TNewNext;
2030
- initialValue: z.TypeOf<TNewNext>;
2031
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2032
- zodValidationSchema: TValidationNext;
3021
+ zodNewSchema: z.ZodBoolean;
3022
+ initialValue: TDefaultNext;
3023
+ zodClientSchema: z.ZodBoolean;
3024
+ zodValidationSchema: z.ZodBoolean;
2033
3025
  } & {
2034
3026
  transforms: {
2035
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
2036
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3027
+ toClient: (dbValue: boolean) => boolean;
3028
+ toDb: (clientValue: boolean) => boolean;
2037
3029
  };
2038
3030
  };
2039
3031
  };
2040
3032
  };
2041
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3033
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2042
3034
  sql: z.ZodBoolean;
2043
- initialState: TNewNext;
2044
- }) => TClientNext)) => {
3035
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
2045
3036
  config: {
2046
3037
  sql: {
2047
3038
  nullable?: boolean;
@@ -2053,13 +3044,13 @@ export declare const shape: {
2053
3044
  zodSqlSchema: z.ZodBoolean;
2054
3045
  zodNewSchema: TNewNext;
2055
3046
  initialValue: z.TypeOf<TNewNext>;
2056
- zodClientSchema: TClientNext;
2057
- zodValidationSchema: TClientNext;
3047
+ zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3048
+ zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2058
3049
  };
2059
3050
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2060
3051
  sql: z.ZodBoolean;
2061
3052
  initialState: TNewNext;
2062
- client: TClientNext;
3053
+ client: InferSmartClientType<z.ZodBoolean, TNewNext>;
2063
3054
  }) => TValidationNext)) => {
2064
3055
  config: {
2065
3056
  sql: {
@@ -2072,9 +3063,96 @@ export declare const shape: {
2072
3063
  zodSqlSchema: z.ZodBoolean;
2073
3064
  zodNewSchema: TNewNext;
2074
3065
  initialValue: z.TypeOf<TNewNext>;
2075
- zodClientSchema: TClientNext;
3066
+ zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2076
3067
  zodValidationSchema: TValidationNext;
2077
3068
  };
3069
+ transform: (transforms: {
3070
+ toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3071
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3072
+ }) => {
3073
+ config: {
3074
+ sql: {
3075
+ nullable?: boolean;
3076
+ pk?: true;
3077
+ field?: string;
3078
+ default?: boolean;
3079
+ type: "boolean";
3080
+ };
3081
+ zodSqlSchema: z.ZodBoolean;
3082
+ zodNewSchema: TNewNext;
3083
+ initialValue: z.TypeOf<TNewNext>;
3084
+ zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3085
+ zodValidationSchema: TValidationNext;
3086
+ } & {
3087
+ transforms: {
3088
+ toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3089
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
3090
+ };
3091
+ };
3092
+ };
3093
+ };
3094
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3095
+ sql: z.ZodBoolean;
3096
+ initialState: TNewNext;
3097
+ }) => TClientNext)) => {
3098
+ config: {
3099
+ sql: {
3100
+ nullable?: boolean;
3101
+ pk?: true;
3102
+ field?: string;
3103
+ default?: boolean;
3104
+ type: "boolean";
3105
+ };
3106
+ zodSqlSchema: z.ZodBoolean;
3107
+ zodNewSchema: TNewNext;
3108
+ initialValue: z.TypeOf<TNewNext>;
3109
+ zodClientSchema: TClientNext;
3110
+ zodValidationSchema: TClientNext;
3111
+ };
3112
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3113
+ sql: z.ZodBoolean;
3114
+ initialState: TNewNext;
3115
+ client: TClientNext;
3116
+ }) => TValidationNext)) => {
3117
+ config: {
3118
+ sql: {
3119
+ nullable?: boolean;
3120
+ pk?: true;
3121
+ field?: string;
3122
+ default?: boolean;
3123
+ type: "boolean";
3124
+ };
3125
+ zodSqlSchema: z.ZodBoolean;
3126
+ zodNewSchema: TNewNext;
3127
+ initialValue: z.TypeOf<TNewNext>;
3128
+ zodClientSchema: TClientNext;
3129
+ zodValidationSchema: TValidationNext;
3130
+ };
3131
+ transform: (transforms: {
3132
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3133
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3134
+ }) => {
3135
+ config: {
3136
+ sql: {
3137
+ nullable?: boolean;
3138
+ pk?: true;
3139
+ field?: string;
3140
+ default?: boolean;
3141
+ type: "boolean";
3142
+ };
3143
+ zodSqlSchema: z.ZodBoolean;
3144
+ zodNewSchema: TNewNext;
3145
+ initialValue: z.TypeOf<TNewNext>;
3146
+ zodClientSchema: TClientNext;
3147
+ zodValidationSchema: TValidationNext;
3148
+ } & {
3149
+ transforms: {
3150
+ toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
3151
+ toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3152
+ };
3153
+ };
3154
+ };
3155
+ };
2078
3156
  transform: (transforms: {
2079
3157
  toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2080
3158
  toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
@@ -2091,7 +3169,7 @@ export declare const shape: {
2091
3169
  zodNewSchema: TNewNext;
2092
3170
  initialValue: z.TypeOf<TNewNext>;
2093
3171
  zodClientSchema: TClientNext;
2094
- zodValidationSchema: TValidationNext;
3172
+ zodValidationSchema: TClientNext;
2095
3173
  } & {
2096
3174
  transforms: {
2097
3175
  toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
@@ -2101,8 +3179,8 @@ export declare const shape: {
2101
3179
  };
2102
3180
  };
2103
3181
  transform: (transforms: {
2104
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2105
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3182
+ toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3183
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
2106
3184
  }) => {
2107
3185
  config: {
2108
3186
  sql: {
@@ -2115,40 +3193,16 @@ export declare const shape: {
2115
3193
  zodSqlSchema: z.ZodBoolean;
2116
3194
  zodNewSchema: TNewNext;
2117
3195
  initialValue: z.TypeOf<TNewNext>;
2118
- zodClientSchema: TClientNext;
2119
- zodValidationSchema: TClientNext;
3196
+ zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
3197
+ zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2120
3198
  } & {
2121
3199
  transforms: {
2122
- toClient: (dbValue: boolean) => z.TypeOf<TClientNext>;
2123
- toDb: (clientValue: z.TypeOf<TClientNext>) => boolean;
3200
+ toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
3201
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
2124
3202
  };
2125
3203
  };
2126
3204
  };
2127
3205
  };
2128
- transform: (transforms: {
2129
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
2130
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
2131
- }) => {
2132
- config: {
2133
- sql: {
2134
- nullable?: boolean;
2135
- pk?: true;
2136
- field?: string;
2137
- default?: boolean;
2138
- type: "boolean";
2139
- };
2140
- zodSqlSchema: z.ZodBoolean;
2141
- zodNewSchema: TNewNext;
2142
- initialValue: z.TypeOf<TNewNext>;
2143
- zodClientSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2144
- zodValidationSchema: InferSmartClientType<z.ZodBoolean, TNewNext>;
2145
- } & {
2146
- transforms: {
2147
- toClient: (dbValue: boolean) => z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>;
2148
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodBoolean, TNewNext>>) => boolean;
2149
- };
2150
- };
2151
- };
2152
3206
  };
2153
3207
  };
2154
3208
  date: (config?: Omit<DateConfig, "type">) => {
@@ -2321,28 +3375,8 @@ export declare const shape: {
2321
3375
  };
2322
3376
  };
2323
3377
  };
2324
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2325
- sql: z.ZodDate;
2326
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
2327
- config: {
2328
- sql: {
2329
- pk?: true;
2330
- nullable?: boolean;
2331
- default?: Date;
2332
- field?: string;
2333
- type: "date";
2334
- };
2335
- zodSqlSchema: z.ZodDate;
2336
- zodNewSchema: TNewNext;
2337
- initialValue: z.TypeOf<TNewNext>;
2338
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2339
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2340
- };
2341
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2342
- sql: z.ZodDate;
2343
- initialState: TNewNext;
2344
- client: InferSmartClientType<z.ZodDate, TNewNext>;
2345
- }) => TValidationNext)) => {
3378
+ initialState: {
3379
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
2346
3380
  config: {
2347
3381
  sql: {
2348
3382
  pk?: true;
@@ -2352,14 +3386,145 @@ export declare const shape: {
2352
3386
  type: "date";
2353
3387
  };
2354
3388
  zodSqlSchema: z.ZodDate;
2355
- zodNewSchema: TNewNext;
2356
- initialValue: z.TypeOf<TNewNext>;
2357
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2358
- zodValidationSchema: TValidationNext;
3389
+ zodNewSchema: z.ZodDate;
3390
+ initialValue: TDefaultNext;
3391
+ zodClientSchema: z.ZodDate;
3392
+ zodValidationSchema: z.ZodDate;
3393
+ };
3394
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3395
+ sql: z.ZodDate;
3396
+ initialState: z.ZodDate;
3397
+ client: z.ZodDate;
3398
+ }) => TValidationNext)) => {
3399
+ config: {
3400
+ sql: {
3401
+ pk?: true;
3402
+ nullable?: boolean;
3403
+ default?: Date;
3404
+ field?: string;
3405
+ type: "date";
3406
+ };
3407
+ zodSqlSchema: z.ZodDate;
3408
+ zodNewSchema: z.ZodDate;
3409
+ initialValue: TDefaultNext;
3410
+ zodClientSchema: z.ZodDate;
3411
+ zodValidationSchema: TValidationNext;
3412
+ };
3413
+ transform: (transforms: {
3414
+ toClient: (dbValue: Date) => Date;
3415
+ toDb: (clientValue: Date) => Date;
3416
+ }) => {
3417
+ config: {
3418
+ sql: {
3419
+ pk?: true;
3420
+ nullable?: boolean;
3421
+ default?: Date;
3422
+ field?: string;
3423
+ type: "date";
3424
+ };
3425
+ zodSqlSchema: z.ZodDate;
3426
+ zodNewSchema: z.ZodDate;
3427
+ initialValue: TDefaultNext;
3428
+ zodClientSchema: z.ZodDate;
3429
+ zodValidationSchema: TValidationNext;
3430
+ } & {
3431
+ transforms: {
3432
+ toClient: (dbValue: Date) => Date;
3433
+ toDb: (clientValue: Date) => Date;
3434
+ };
3435
+ };
3436
+ };
3437
+ };
3438
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3439
+ sql: z.ZodDate;
3440
+ initialState: z.ZodDate;
3441
+ }) => TClientNext)) => {
3442
+ config: {
3443
+ sql: {
3444
+ pk?: true;
3445
+ nullable?: boolean;
3446
+ default?: Date;
3447
+ field?: string;
3448
+ type: "date";
3449
+ };
3450
+ zodSqlSchema: z.ZodDate;
3451
+ zodNewSchema: z.ZodDate;
3452
+ initialValue: TDefaultNext;
3453
+ zodClientSchema: TClientNext;
3454
+ zodValidationSchema: TClientNext;
3455
+ };
3456
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3457
+ sql: z.ZodDate;
3458
+ initialState: z.ZodDate;
3459
+ client: TClientNext;
3460
+ }) => TValidationNext)) => {
3461
+ config: {
3462
+ sql: {
3463
+ pk?: true;
3464
+ nullable?: boolean;
3465
+ default?: Date;
3466
+ field?: string;
3467
+ type: "date";
3468
+ };
3469
+ zodSqlSchema: z.ZodDate;
3470
+ zodNewSchema: z.ZodDate;
3471
+ initialValue: TDefaultNext;
3472
+ zodClientSchema: TClientNext;
3473
+ zodValidationSchema: TValidationNext;
3474
+ };
3475
+ transform: (transforms: {
3476
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3477
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3478
+ }) => {
3479
+ config: {
3480
+ sql: {
3481
+ pk?: true;
3482
+ nullable?: boolean;
3483
+ default?: Date;
3484
+ field?: string;
3485
+ type: "date";
3486
+ };
3487
+ zodSqlSchema: z.ZodDate;
3488
+ zodNewSchema: z.ZodDate;
3489
+ initialValue: TDefaultNext;
3490
+ zodClientSchema: TClientNext;
3491
+ zodValidationSchema: TValidationNext;
3492
+ } & {
3493
+ transforms: {
3494
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3495
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3496
+ };
3497
+ };
3498
+ };
3499
+ };
3500
+ transform: (transforms: {
3501
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3502
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3503
+ }) => {
3504
+ config: {
3505
+ sql: {
3506
+ pk?: true;
3507
+ nullable?: boolean;
3508
+ default?: Date;
3509
+ field?: string;
3510
+ type: "date";
3511
+ };
3512
+ zodSqlSchema: z.ZodDate;
3513
+ zodNewSchema: z.ZodDate;
3514
+ initialValue: TDefaultNext;
3515
+ zodClientSchema: TClientNext;
3516
+ zodValidationSchema: TClientNext;
3517
+ } & {
3518
+ transforms: {
3519
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3520
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3521
+ };
3522
+ };
3523
+ };
2359
3524
  };
2360
3525
  transform: (transforms: {
2361
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2362
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3526
+ toClient: (dbValue: Date) => Date;
3527
+ toDb: (clientValue: Date) => Date;
2363
3528
  }) => {
2364
3529
  config: {
2365
3530
  sql: {
@@ -2370,22 +3535,21 @@ export declare const shape: {
2370
3535
  type: "date";
2371
3536
  };
2372
3537
  zodSqlSchema: z.ZodDate;
2373
- zodNewSchema: TNewNext;
2374
- initialValue: z.TypeOf<TNewNext>;
2375
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2376
- zodValidationSchema: TValidationNext;
3538
+ zodNewSchema: z.ZodDate;
3539
+ initialValue: TDefaultNext;
3540
+ zodClientSchema: z.ZodDate;
3541
+ zodValidationSchema: z.ZodDate;
2377
3542
  } & {
2378
3543
  transforms: {
2379
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2380
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3544
+ toClient: (dbValue: Date) => Date;
3545
+ toDb: (clientValue: Date) => Date;
2381
3546
  };
2382
3547
  };
2383
3548
  };
2384
3549
  };
2385
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3550
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2386
3551
  sql: z.ZodDate;
2387
- initialState: TNewNext;
2388
- }) => TClientNext)) => {
3552
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
2389
3553
  config: {
2390
3554
  sql: {
2391
3555
  pk?: true;
@@ -2397,13 +3561,13 @@ export declare const shape: {
2397
3561
  zodSqlSchema: z.ZodDate;
2398
3562
  zodNewSchema: TNewNext;
2399
3563
  initialValue: z.TypeOf<TNewNext>;
2400
- zodClientSchema: TClientNext;
2401
- zodValidationSchema: TClientNext;
3564
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3565
+ zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2402
3566
  };
2403
3567
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2404
3568
  sql: z.ZodDate;
2405
3569
  initialState: TNewNext;
2406
- client: TClientNext;
3570
+ client: InferSmartClientType<z.ZodDate, TNewNext>;
2407
3571
  }) => TValidationNext)) => {
2408
3572
  config: {
2409
3573
  sql: {
@@ -2416,9 +3580,96 @@ export declare const shape: {
2416
3580
  zodSqlSchema: z.ZodDate;
2417
3581
  zodNewSchema: TNewNext;
2418
3582
  initialValue: z.TypeOf<TNewNext>;
2419
- zodClientSchema: TClientNext;
3583
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2420
3584
  zodValidationSchema: TValidationNext;
2421
3585
  };
3586
+ transform: (transforms: {
3587
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3588
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3589
+ }) => {
3590
+ config: {
3591
+ sql: {
3592
+ pk?: true;
3593
+ nullable?: boolean;
3594
+ default?: Date;
3595
+ field?: string;
3596
+ type: "date";
3597
+ };
3598
+ zodSqlSchema: z.ZodDate;
3599
+ zodNewSchema: TNewNext;
3600
+ initialValue: z.TypeOf<TNewNext>;
3601
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3602
+ zodValidationSchema: TValidationNext;
3603
+ } & {
3604
+ transforms: {
3605
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3606
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
3607
+ };
3608
+ };
3609
+ };
3610
+ };
3611
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3612
+ sql: z.ZodDate;
3613
+ initialState: TNewNext;
3614
+ }) => TClientNext)) => {
3615
+ config: {
3616
+ sql: {
3617
+ pk?: true;
3618
+ nullable?: boolean;
3619
+ default?: Date;
3620
+ field?: string;
3621
+ type: "date";
3622
+ };
3623
+ zodSqlSchema: z.ZodDate;
3624
+ zodNewSchema: TNewNext;
3625
+ initialValue: z.TypeOf<TNewNext>;
3626
+ zodClientSchema: TClientNext;
3627
+ zodValidationSchema: TClientNext;
3628
+ };
3629
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3630
+ sql: z.ZodDate;
3631
+ initialState: TNewNext;
3632
+ client: TClientNext;
3633
+ }) => TValidationNext)) => {
3634
+ config: {
3635
+ sql: {
3636
+ pk?: true;
3637
+ nullable?: boolean;
3638
+ default?: Date;
3639
+ field?: string;
3640
+ type: "date";
3641
+ };
3642
+ zodSqlSchema: z.ZodDate;
3643
+ zodNewSchema: TNewNext;
3644
+ initialValue: z.TypeOf<TNewNext>;
3645
+ zodClientSchema: TClientNext;
3646
+ zodValidationSchema: TValidationNext;
3647
+ };
3648
+ transform: (transforms: {
3649
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3650
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3651
+ }) => {
3652
+ config: {
3653
+ sql: {
3654
+ pk?: true;
3655
+ nullable?: boolean;
3656
+ default?: Date;
3657
+ field?: string;
3658
+ type: "date";
3659
+ };
3660
+ zodSqlSchema: z.ZodDate;
3661
+ zodNewSchema: TNewNext;
3662
+ initialValue: z.TypeOf<TNewNext>;
3663
+ zodClientSchema: TClientNext;
3664
+ zodValidationSchema: TValidationNext;
3665
+ } & {
3666
+ transforms: {
3667
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3668
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3669
+ };
3670
+ };
3671
+ };
3672
+ };
2422
3673
  transform: (transforms: {
2423
3674
  toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
2424
3675
  toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
@@ -2435,7 +3686,7 @@ export declare const shape: {
2435
3686
  zodNewSchema: TNewNext;
2436
3687
  initialValue: z.TypeOf<TNewNext>;
2437
3688
  zodClientSchema: TClientNext;
2438
- zodValidationSchema: TValidationNext;
3689
+ zodValidationSchema: TClientNext;
2439
3690
  } & {
2440
3691
  transforms: {
2441
3692
  toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
@@ -2445,8 +3696,8 @@ export declare const shape: {
2445
3696
  };
2446
3697
  };
2447
3698
  transform: (transforms: {
2448
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
2449
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3699
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3700
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2450
3701
  }) => {
2451
3702
  config: {
2452
3703
  sql: {
@@ -2459,40 +3710,16 @@ export declare const shape: {
2459
3710
  zodSqlSchema: z.ZodDate;
2460
3711
  zodNewSchema: TNewNext;
2461
3712
  initialValue: z.TypeOf<TNewNext>;
2462
- zodClientSchema: TClientNext;
2463
- zodValidationSchema: TClientNext;
3713
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
3714
+ zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2464
3715
  } & {
2465
3716
  transforms: {
2466
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
2467
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3717
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
3718
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2468
3719
  };
2469
3720
  };
2470
3721
  };
2471
3722
  };
2472
- transform: (transforms: {
2473
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2474
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2475
- }) => {
2476
- config: {
2477
- sql: {
2478
- pk?: true;
2479
- nullable?: boolean;
2480
- default?: Date;
2481
- field?: string;
2482
- type: "date";
2483
- };
2484
- zodSqlSchema: z.ZodDate;
2485
- zodNewSchema: TNewNext;
2486
- initialValue: z.TypeOf<TNewNext>;
2487
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2488
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2489
- } & {
2490
- transforms: {
2491
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2492
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2493
- };
2494
- };
2495
- };
2496
3723
  };
2497
3724
  };
2498
3725
  datetime: (config?: Omit<DateConfig, "type">) => {
@@ -2665,28 +3892,181 @@ export declare const shape: {
2665
3892
  };
2666
3893
  };
2667
3894
  };
2668
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2669
- sql: z.ZodDate;
2670
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
2671
- config: {
2672
- sql: {
2673
- pk?: true;
2674
- nullable?: boolean;
2675
- default?: Date;
2676
- field?: string;
2677
- type: "datetime";
3895
+ initialState: {
3896
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
3897
+ config: {
3898
+ sql: {
3899
+ pk?: true;
3900
+ nullable?: boolean;
3901
+ default?: Date;
3902
+ field?: string;
3903
+ type: "datetime";
3904
+ };
3905
+ zodSqlSchema: z.ZodDate;
3906
+ zodNewSchema: z.ZodDate;
3907
+ initialValue: TDefaultNext;
3908
+ zodClientSchema: z.ZodDate;
3909
+ zodValidationSchema: z.ZodDate;
3910
+ };
3911
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3912
+ sql: z.ZodDate;
3913
+ initialState: z.ZodDate;
3914
+ client: z.ZodDate;
3915
+ }) => TValidationNext)) => {
3916
+ config: {
3917
+ sql: {
3918
+ pk?: true;
3919
+ nullable?: boolean;
3920
+ default?: Date;
3921
+ field?: string;
3922
+ type: "datetime";
3923
+ };
3924
+ zodSqlSchema: z.ZodDate;
3925
+ zodNewSchema: z.ZodDate;
3926
+ initialValue: TDefaultNext;
3927
+ zodClientSchema: z.ZodDate;
3928
+ zodValidationSchema: TValidationNext;
3929
+ };
3930
+ transform: (transforms: {
3931
+ toClient: (dbValue: Date) => Date;
3932
+ toDb: (clientValue: Date) => Date;
3933
+ }) => {
3934
+ config: {
3935
+ sql: {
3936
+ pk?: true;
3937
+ nullable?: boolean;
3938
+ default?: Date;
3939
+ field?: string;
3940
+ type: "datetime";
3941
+ };
3942
+ zodSqlSchema: z.ZodDate;
3943
+ zodNewSchema: z.ZodDate;
3944
+ initialValue: TDefaultNext;
3945
+ zodClientSchema: z.ZodDate;
3946
+ zodValidationSchema: TValidationNext;
3947
+ } & {
3948
+ transforms: {
3949
+ toClient: (dbValue: Date) => Date;
3950
+ toDb: (clientValue: Date) => Date;
3951
+ };
3952
+ };
3953
+ };
3954
+ };
3955
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
3956
+ sql: z.ZodDate;
3957
+ initialState: z.ZodDate;
3958
+ }) => TClientNext)) => {
3959
+ config: {
3960
+ sql: {
3961
+ pk?: true;
3962
+ nullable?: boolean;
3963
+ default?: Date;
3964
+ field?: string;
3965
+ type: "datetime";
3966
+ };
3967
+ zodSqlSchema: z.ZodDate;
3968
+ zodNewSchema: z.ZodDate;
3969
+ initialValue: TDefaultNext;
3970
+ zodClientSchema: TClientNext;
3971
+ zodValidationSchema: TClientNext;
3972
+ };
3973
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3974
+ sql: z.ZodDate;
3975
+ initialState: z.ZodDate;
3976
+ client: TClientNext;
3977
+ }) => TValidationNext)) => {
3978
+ config: {
3979
+ sql: {
3980
+ pk?: true;
3981
+ nullable?: boolean;
3982
+ default?: Date;
3983
+ field?: string;
3984
+ type: "datetime";
3985
+ };
3986
+ zodSqlSchema: z.ZodDate;
3987
+ zodNewSchema: z.ZodDate;
3988
+ initialValue: TDefaultNext;
3989
+ zodClientSchema: TClientNext;
3990
+ zodValidationSchema: TValidationNext;
3991
+ };
3992
+ transform: (transforms: {
3993
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
3994
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
3995
+ }) => {
3996
+ config: {
3997
+ sql: {
3998
+ pk?: true;
3999
+ nullable?: boolean;
4000
+ default?: Date;
4001
+ field?: string;
4002
+ type: "datetime";
4003
+ };
4004
+ zodSqlSchema: z.ZodDate;
4005
+ zodNewSchema: z.ZodDate;
4006
+ initialValue: TDefaultNext;
4007
+ zodClientSchema: TClientNext;
4008
+ zodValidationSchema: TValidationNext;
4009
+ } & {
4010
+ transforms: {
4011
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4012
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4013
+ };
4014
+ };
4015
+ };
4016
+ };
4017
+ transform: (transforms: {
4018
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4019
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4020
+ }) => {
4021
+ config: {
4022
+ sql: {
4023
+ pk?: true;
4024
+ nullable?: boolean;
4025
+ default?: Date;
4026
+ field?: string;
4027
+ type: "datetime";
4028
+ };
4029
+ zodSqlSchema: z.ZodDate;
4030
+ zodNewSchema: z.ZodDate;
4031
+ initialValue: TDefaultNext;
4032
+ zodClientSchema: TClientNext;
4033
+ zodValidationSchema: TClientNext;
4034
+ } & {
4035
+ transforms: {
4036
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4037
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4038
+ };
4039
+ };
4040
+ };
4041
+ };
4042
+ transform: (transforms: {
4043
+ toClient: (dbValue: Date) => Date;
4044
+ toDb: (clientValue: Date) => Date;
4045
+ }) => {
4046
+ config: {
4047
+ sql: {
4048
+ pk?: true;
4049
+ nullable?: boolean;
4050
+ default?: Date;
4051
+ field?: string;
4052
+ type: "datetime";
4053
+ };
4054
+ zodSqlSchema: z.ZodDate;
4055
+ zodNewSchema: z.ZodDate;
4056
+ initialValue: TDefaultNext;
4057
+ zodClientSchema: z.ZodDate;
4058
+ zodValidationSchema: z.ZodDate;
4059
+ } & {
4060
+ transforms: {
4061
+ toClient: (dbValue: Date) => Date;
4062
+ toDb: (clientValue: Date) => Date;
4063
+ };
4064
+ };
2678
4065
  };
2679
- zodSqlSchema: z.ZodDate;
2680
- zodNewSchema: TNewNext;
2681
- initialValue: z.TypeOf<TNewNext>;
2682
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2683
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2684
4066
  };
2685
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4067
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2686
4068
  sql: z.ZodDate;
2687
- initialState: TNewNext;
2688
- client: InferSmartClientType<z.ZodDate, TNewNext>;
2689
- }) => TValidationNext)) => {
4069
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
2690
4070
  config: {
2691
4071
  sql: {
2692
4072
  pk?: true;
@@ -2699,12 +4079,13 @@ export declare const shape: {
2699
4079
  zodNewSchema: TNewNext;
2700
4080
  initialValue: z.TypeOf<TNewNext>;
2701
4081
  zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2702
- zodValidationSchema: TValidationNext;
4082
+ zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2703
4083
  };
2704
- transform: (transforms: {
2705
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2706
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2707
- }) => {
4084
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4085
+ sql: z.ZodDate;
4086
+ initialState: TNewNext;
4087
+ client: InferSmartClientType<z.ZodDate, TNewNext>;
4088
+ }) => TValidationNext)) => {
2708
4089
  config: {
2709
4090
  sql: {
2710
4091
  pk?: true;
@@ -2718,37 +4099,36 @@ export declare const shape: {
2718
4099
  initialValue: z.TypeOf<TNewNext>;
2719
4100
  zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2720
4101
  zodValidationSchema: TValidationNext;
2721
- } & {
2722
- transforms: {
2723
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2724
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4102
+ };
4103
+ transform: (transforms: {
4104
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4105
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4106
+ }) => {
4107
+ config: {
4108
+ sql: {
4109
+ pk?: true;
4110
+ nullable?: boolean;
4111
+ default?: Date;
4112
+ field?: string;
4113
+ type: "datetime";
4114
+ };
4115
+ zodSqlSchema: z.ZodDate;
4116
+ zodNewSchema: TNewNext;
4117
+ initialValue: z.TypeOf<TNewNext>;
4118
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4119
+ zodValidationSchema: TValidationNext;
4120
+ } & {
4121
+ transforms: {
4122
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4123
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
4124
+ };
2725
4125
  };
2726
4126
  };
2727
4127
  };
2728
- };
2729
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2730
- sql: z.ZodDate;
2731
- initialState: TNewNext;
2732
- }) => TClientNext)) => {
2733
- config: {
2734
- sql: {
2735
- pk?: true;
2736
- nullable?: boolean;
2737
- default?: Date;
2738
- field?: string;
2739
- type: "datetime";
2740
- };
2741
- zodSqlSchema: z.ZodDate;
2742
- zodNewSchema: TNewNext;
2743
- initialValue: z.TypeOf<TNewNext>;
2744
- zodClientSchema: TClientNext;
2745
- zodValidationSchema: TClientNext;
2746
- };
2747
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4128
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
2748
4129
  sql: z.ZodDate;
2749
4130
  initialState: TNewNext;
2750
- client: TClientNext;
2751
- }) => TValidationNext)) => {
4131
+ }) => TClientNext)) => {
2752
4132
  config: {
2753
4133
  sql: {
2754
4134
  pk?: true;
@@ -2761,7 +4141,51 @@ export declare const shape: {
2761
4141
  zodNewSchema: TNewNext;
2762
4142
  initialValue: z.TypeOf<TNewNext>;
2763
4143
  zodClientSchema: TClientNext;
2764
- zodValidationSchema: TValidationNext;
4144
+ zodValidationSchema: TClientNext;
4145
+ };
4146
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4147
+ sql: z.ZodDate;
4148
+ initialState: TNewNext;
4149
+ client: TClientNext;
4150
+ }) => TValidationNext)) => {
4151
+ config: {
4152
+ sql: {
4153
+ pk?: true;
4154
+ nullable?: boolean;
4155
+ default?: Date;
4156
+ field?: string;
4157
+ type: "datetime";
4158
+ };
4159
+ zodSqlSchema: z.ZodDate;
4160
+ zodNewSchema: TNewNext;
4161
+ initialValue: z.TypeOf<TNewNext>;
4162
+ zodClientSchema: TClientNext;
4163
+ zodValidationSchema: TValidationNext;
4164
+ };
4165
+ transform: (transforms: {
4166
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4167
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4168
+ }) => {
4169
+ config: {
4170
+ sql: {
4171
+ pk?: true;
4172
+ nullable?: boolean;
4173
+ default?: Date;
4174
+ field?: string;
4175
+ type: "datetime";
4176
+ };
4177
+ zodSqlSchema: z.ZodDate;
4178
+ zodNewSchema: TNewNext;
4179
+ initialValue: z.TypeOf<TNewNext>;
4180
+ zodClientSchema: TClientNext;
4181
+ zodValidationSchema: TValidationNext;
4182
+ } & {
4183
+ transforms: {
4184
+ toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
4185
+ toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4186
+ };
4187
+ };
4188
+ };
2765
4189
  };
2766
4190
  transform: (transforms: {
2767
4191
  toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
@@ -2779,7 +4203,7 @@ export declare const shape: {
2779
4203
  zodNewSchema: TNewNext;
2780
4204
  initialValue: z.TypeOf<TNewNext>;
2781
4205
  zodClientSchema: TClientNext;
2782
- zodValidationSchema: TValidationNext;
4206
+ zodValidationSchema: TClientNext;
2783
4207
  } & {
2784
4208
  transforms: {
2785
4209
  toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
@@ -2789,8 +4213,8 @@ export declare const shape: {
2789
4213
  };
2790
4214
  };
2791
4215
  transform: (transforms: {
2792
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
2793
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4216
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4217
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2794
4218
  }) => {
2795
4219
  config: {
2796
4220
  sql: {
@@ -2803,40 +4227,16 @@ export declare const shape: {
2803
4227
  zodSqlSchema: z.ZodDate;
2804
4228
  zodNewSchema: TNewNext;
2805
4229
  initialValue: z.TypeOf<TNewNext>;
2806
- zodClientSchema: TClientNext;
2807
- zodValidationSchema: TClientNext;
4230
+ zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
4231
+ zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2808
4232
  } & {
2809
4233
  transforms: {
2810
- toClient: (dbValue: Date) => z.TypeOf<TClientNext>;
2811
- toDb: (clientValue: z.TypeOf<TClientNext>) => Date;
4234
+ toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
4235
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2812
4236
  };
2813
4237
  };
2814
4238
  };
2815
4239
  };
2816
- transform: (transforms: {
2817
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2818
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2819
- }) => {
2820
- config: {
2821
- sql: {
2822
- pk?: true;
2823
- nullable?: boolean;
2824
- default?: Date;
2825
- field?: string;
2826
- type: "datetime";
2827
- };
2828
- zodSqlSchema: z.ZodDate;
2829
- zodNewSchema: TNewNext;
2830
- initialValue: z.TypeOf<TNewNext>;
2831
- zodClientSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2832
- zodValidationSchema: InferSmartClientType<z.ZodDate, TNewNext>;
2833
- } & {
2834
- transforms: {
2835
- toClient: (dbValue: Date) => z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>;
2836
- toDb: (clientValue: z.TypeOf<InferSmartClientType<z.ZodDate, TNewNext>>) => Date;
2837
- };
2838
- };
2839
- };
2840
4240
  };
2841
4241
  };
2842
4242
  sql: <T extends SQLType>(sqlConfig: T) => {
@@ -2961,74 +4361,217 @@ export declare const shape: {
2961
4361
  };
2962
4362
  };
2963
4363
  };
2964
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
2965
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2966
- }) => TNewNext), defaultValue: () => TDefaultNext) => {
2967
- config: {
2968
- sql: T;
2969
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2970
- zodNewSchema: TNewNext;
2971
- initialValue: z.TypeOf<TNewNext>;
2972
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
2973
- zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
2974
- };
2975
- validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
2976
- sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2977
- initialState: TNewNext;
2978
- client: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
2979
- }) => TValidationNext)) => {
4364
+ initialState: {
4365
+ <TDefaultNext>(defaultValue: () => TDefaultNext): {
2980
4366
  config: {
2981
4367
  sql: T;
2982
4368
  zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2983
- zodNewSchema: TNewNext;
2984
- initialValue: z.TypeOf<TNewNext>;
2985
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
2986
- zodValidationSchema: TValidationNext;
4369
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4370
+ initialValue: TDefaultNext;
4371
+ zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4372
+ zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4373
+ };
4374
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4375
+ sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4376
+ initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4377
+ client: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4378
+ }) => TValidationNext)) => {
4379
+ config: {
4380
+ sql: T;
4381
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4382
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4383
+ initialValue: TDefaultNext;
4384
+ zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4385
+ zodValidationSchema: TValidationNext;
4386
+ };
4387
+ transform: (transforms: {
4388
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4389
+ toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4390
+ }) => {
4391
+ config: {
4392
+ sql: T;
4393
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4394
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4395
+ initialValue: TDefaultNext;
4396
+ zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4397
+ zodValidationSchema: TValidationNext;
4398
+ } & {
4399
+ transforms: {
4400
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4401
+ toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4402
+ };
4403
+ };
4404
+ };
4405
+ };
4406
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4407
+ sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4408
+ initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4409
+ }) => TClientNext)) => {
4410
+ config: {
4411
+ sql: T;
4412
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4413
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4414
+ initialValue: TDefaultNext;
4415
+ zodClientSchema: TClientNext;
4416
+ zodValidationSchema: TClientNext;
4417
+ };
4418
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4419
+ sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4420
+ initialState: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4421
+ client: TClientNext;
4422
+ }) => TValidationNext)) => {
4423
+ config: {
4424
+ sql: T;
4425
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4426
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4427
+ initialValue: TDefaultNext;
4428
+ zodClientSchema: TClientNext;
4429
+ zodValidationSchema: TValidationNext;
4430
+ };
4431
+ transform: (transforms: {
4432
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4433
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4434
+ }) => {
4435
+ config: {
4436
+ sql: T;
4437
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4438
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4439
+ initialValue: TDefaultNext;
4440
+ zodClientSchema: TClientNext;
4441
+ zodValidationSchema: TValidationNext;
4442
+ } & {
4443
+ transforms: {
4444
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4445
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4446
+ };
4447
+ };
4448
+ };
4449
+ };
4450
+ transform: (transforms: {
4451
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4452
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4453
+ }) => {
4454
+ config: {
4455
+ sql: T;
4456
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4457
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4458
+ initialValue: TDefaultNext;
4459
+ zodClientSchema: TClientNext;
4460
+ zodValidationSchema: TClientNext;
4461
+ } & {
4462
+ transforms: {
4463
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4464
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4465
+ };
4466
+ };
4467
+ };
2987
4468
  };
2988
4469
  transform: (transforms: {
2989
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
2990
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4470
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4471
+ toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
2991
4472
  }) => {
2992
4473
  config: {
2993
4474
  sql: T;
2994
4475
  zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2995
- zodNewSchema: TNewNext;
2996
- initialValue: z.TypeOf<TNewNext>;
2997
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
2998
- zodValidationSchema: TValidationNext;
4476
+ zodNewSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4477
+ initialValue: TDefaultNext;
4478
+ zodClientSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4479
+ zodValidationSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
2999
4480
  } & {
3000
4481
  transforms: {
3001
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
3002
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4482
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4483
+ toDb: (clientValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
3003
4484
  };
3004
4485
  };
3005
4486
  };
3006
4487
  };
3007
- client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4488
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: TNewNext | ((tools: {
3008
4489
  sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3009
- initialState: TNewNext;
3010
- }) => TClientNext)) => {
4490
+ }) => TNewNext), defaultValue: () => TDefaultNext): {
3011
4491
  config: {
3012
4492
  sql: T;
3013
4493
  zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3014
4494
  zodNewSchema: TNewNext;
3015
4495
  initialValue: z.TypeOf<TNewNext>;
3016
- zodClientSchema: TClientNext;
3017
- zodValidationSchema: TClientNext;
4496
+ zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4497
+ zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3018
4498
  };
3019
4499
  validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
3020
4500
  sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3021
4501
  initialState: TNewNext;
3022
- client: TClientNext;
4502
+ client: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3023
4503
  }) => TValidationNext)) => {
3024
4504
  config: {
3025
4505
  sql: T;
3026
4506
  zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3027
4507
  zodNewSchema: TNewNext;
3028
4508
  initialValue: z.TypeOf<TNewNext>;
3029
- zodClientSchema: TClientNext;
4509
+ zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3030
4510
  zodValidationSchema: TValidationNext;
3031
4511
  };
4512
+ transform: (transforms: {
4513
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4514
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4515
+ }) => {
4516
+ config: {
4517
+ sql: T;
4518
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4519
+ zodNewSchema: TNewNext;
4520
+ initialValue: z.TypeOf<TNewNext>;
4521
+ zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4522
+ zodValidationSchema: TValidationNext;
4523
+ } & {
4524
+ transforms: {
4525
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4526
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4527
+ };
4528
+ };
4529
+ };
4530
+ };
4531
+ client: <TClientNext extends z.ZodTypeAny>(schema: TClientNext | ((tools: {
4532
+ sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4533
+ initialState: TNewNext;
4534
+ }) => TClientNext)) => {
4535
+ config: {
4536
+ sql: T;
4537
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4538
+ zodNewSchema: TNewNext;
4539
+ initialValue: z.TypeOf<TNewNext>;
4540
+ zodClientSchema: TClientNext;
4541
+ zodValidationSchema: TClientNext;
4542
+ };
4543
+ validation: <TValidationNext extends z.ZodTypeAny>(schema: TValidationNext | ((tools: {
4544
+ sql: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4545
+ initialState: TNewNext;
4546
+ client: TClientNext;
4547
+ }) => TValidationNext)) => {
4548
+ config: {
4549
+ sql: T;
4550
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4551
+ zodNewSchema: TNewNext;
4552
+ initialValue: z.TypeOf<TNewNext>;
4553
+ zodClientSchema: TClientNext;
4554
+ zodValidationSchema: TValidationNext;
4555
+ };
4556
+ transform: (transforms: {
4557
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4558
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4559
+ }) => {
4560
+ config: {
4561
+ sql: T;
4562
+ zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
4563
+ zodNewSchema: TNewNext;
4564
+ initialValue: z.TypeOf<TNewNext>;
4565
+ zodClientSchema: TClientNext;
4566
+ zodValidationSchema: TValidationNext;
4567
+ } & {
4568
+ transforms: {
4569
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
4570
+ toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4571
+ };
4572
+ };
4573
+ };
4574
+ };
3032
4575
  transform: (transforms: {
3033
4576
  toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
3034
4577
  toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
@@ -3039,7 +4582,7 @@ export declare const shape: {
3039
4582
  zodNewSchema: TNewNext;
3040
4583
  initialValue: z.TypeOf<TNewNext>;
3041
4584
  zodClientSchema: TClientNext;
3042
- zodValidationSchema: TValidationNext;
4585
+ zodValidationSchema: TClientNext;
3043
4586
  } & {
3044
4587
  transforms: {
3045
4588
  toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
@@ -3049,42 +4592,24 @@ export declare const shape: {
3049
4592
  };
3050
4593
  };
3051
4594
  transform: (transforms: {
3052
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
3053
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4595
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4596
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
3054
4597
  }) => {
3055
4598
  config: {
3056
4599
  sql: T;
3057
4600
  zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3058
4601
  zodNewSchema: TNewNext;
3059
4602
  initialValue: z.TypeOf<TNewNext>;
3060
- zodClientSchema: TClientNext;
3061
- zodValidationSchema: TClientNext;
4603
+ zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
4604
+ zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3062
4605
  } & {
3063
4606
  transforms: {
3064
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<TClientNext>;
3065
- toDb: (clientValue: z.TypeOf<TClientNext>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
4607
+ toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
4608
+ toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
3066
4609
  };
3067
4610
  };
3068
4611
  };
3069
4612
  };
3070
- transform: (transforms: {
3071
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
3072
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
3073
- }) => {
3074
- config: {
3075
- sql: T;
3076
- zodSqlSchema: SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never;
3077
- zodNewSchema: TNewNext;
3078
- initialValue: z.TypeOf<TNewNext>;
3079
- zodClientSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3080
- zodValidationSchema: InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>;
3081
- } & {
3082
- transforms: {
3083
- toClient: (dbValue: z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>) => z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>;
3084
- toDb: (clientValue: z.TypeOf<InferSmartClientType<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never, TNewNext>>) => z.TypeOf<SQLToZodType<T, false> extends z.ZodTypeAny ? SQLToZodType<T, false> : never>;
3085
- };
3086
- };
3087
- };
3088
4613
  };
3089
4614
  };
3090
4615
  };
@@ -3093,9 +4618,14 @@ interface IBuilderMethods<T extends SQLType, TSql extends z.ZodTypeAny, TNew ext
3093
4618
  * Defines the schema and default value for creating a new item.
3094
4619
  * Moves the builder to the 'new' stage.
3095
4620
  */
3096
- initialState: <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: ((tools: {
3097
- sql: TSql;
3098
- }) => TNewNext) | TNewNext, defaultValue: () => TDefaultNext) => Builder<"new", T, TSql, TNewNext, z.infer<TNewNext>, InferSmartClientType<TSql, TNewNext>, InferSmartClientType<TSql, TNewNext>>;
4621
+ initialState: {
4622
+ <TDefaultNext>(defaultValue: () => TDefaultNext): Prettify<Builder<"new", T, TSql, TSql, // Keep SQL schema
4623
+ TDefaultNext, TSql, // Client stays as SQL
4624
+ TSql>>;
4625
+ <TNewNext extends z.ZodTypeAny, TDefaultNext>(schema: ((tools: {
4626
+ sql: TSql;
4627
+ }) => TNewNext) | TNewNext, defaultValue: () => TDefaultNext): Prettify<Builder<"new", T, TSql, TNewNext, z.infer<TNewNext>, InferSmartClientType<TSql, TNewNext>, InferSmartClientType<TSql, TNewNext>>>;
4628
+ };
3099
4629
  /**
3100
4630
  * Defines the schema for data sent to the client.
3101
4631
  * Moves the builder to the 'client' stage.
@@ -3103,7 +4633,7 @@ interface IBuilderMethods<T extends SQLType, TSql extends z.ZodTypeAny, TNew ext
3103
4633
  client: <TClientNext extends z.ZodTypeAny>(schema: ((tools: {
3104
4634
  sql: TSql;
3105
4635
  initialState: TNew;
3106
- }) => TClientNext) | TClientNext) => Builder<"client", T, TSql, TNew, TInitialValue, TClientNext, TClientNext>;
4636
+ }) => TClientNext) | TClientNext) => Prettify<Builder<"client", T, TSql, TNew, TInitialValue, TClientNext, TClientNext>>;
3107
4637
  /**
3108
4638
  * Defines a validation schema for updates or inputs.
3109
4639
  * Moves the builder to the 'validation' stage.
@@ -3112,7 +4642,7 @@ interface IBuilderMethods<T extends SQLType, TSql extends z.ZodTypeAny, TNew ext
3112
4642
  sql: TSql;
3113
4643
  initialState: TNew;
3114
4644
  client: TClient;
3115
- }) => TValidationNext) | TValidationNext) => Builder<"validation", T, TSql, TNew, TInitialValue, TClient, TValidationNext>;
4645
+ }) => TValidationNext) | TValidationNext) => Prettify<Builder<"validation", T, TSql, TNew, TInitialValue, TClient, TValidationNext>>;
3116
4646
  /**
3117
4647
  * Finalizes the builder by providing data transformation functions.
3118
4648
  * This is the terminal step.
@@ -3204,9 +4734,8 @@ type BaseSchemaField<T extends SQLType = SQLType> = {
3204
4734
  };
3205
4735
  type AnyFieldDefinition = ReturnType<typeof shape.sql>;
3206
4736
  type ReferenceField<TField extends AnyFieldDefinition> = {
3207
- field: TField;
3208
4737
  type: "reference";
3209
- to: () => any;
4738
+ to: () => TField;
3210
4739
  };
3211
4740
  type SchemaField<T extends SQLType = SQLType> = BaseSchemaField<T> | ReferenceField<AnyFieldDefinition>;
3212
4741
  export type Schema<T extends Record<string, SchemaField | (() => Relation<any>)>> = {
@@ -3250,61 +4779,38 @@ export type InferDBSchema<T> = {
3250
4779
  } ? DbType : never;
3251
4780
  }> : never;
3252
4781
  };
3253
- export declare function reference<TField extends object, Zod extends z.ZodTypeAny>(config: {
3254
- to: TField;
3255
- field: Zod;
3256
- }): {
3257
- field: Zod;
4782
+ export declare function reference<TField extends object>(config: TField): {
3258
4783
  type: "reference";
3259
- to: () => TField;
4784
+ to: TField;
3260
4785
  };
3261
4786
  export declare function createMixedValidationSchema<T extends Schema<any>>(schema: T, clientSchema?: z.ZodObject<any>, dbSchema?: z.ZodObject<any>): z.ZodObject<any>;
3262
4787
  type SchemaDefinition = {
3263
4788
  _tableName: string;
3264
4789
  [key: string]: any;
3265
4790
  };
3266
- type InferSqlSchema<T> = {
4791
+ type InferSchemaByKey<T, Key extends "zodSqlSchema" | "zodClientSchema" | "zodValidationSchema"> = {
3267
4792
  [K in keyof T as K extends "_tableName" ? never : K]: T[K] extends {
3268
4793
  config: {
3269
- zodSqlSchema: infer S extends z.ZodTypeAny;
4794
+ [P in Key]: infer S extends z.ZodTypeAny;
3270
4795
  };
3271
4796
  } ? S : T[K] extends {
3272
4797
  type: "reference";
3273
- field: infer F extends z.ZodTypeAny;
3274
- } ? F : T[K] extends () => {
3275
- type: "hasMany" | "manyToMany";
3276
- schema: infer S extends SchemaDefinition;
3277
- } ? z.ZodArray<z.ZodObject<Prettify<InferSqlSchema<S>>>> : T[K] extends () => {
3278
- type: "hasOne" | "belongsTo";
3279
- schema: infer S extends SchemaDefinition;
3280
- } ? z.ZodObject<Prettify<InferSqlSchema<S>>> : never;
3281
- };
3282
- type InferClientSchema<T> = {
3283
- [K in keyof T as K extends "_tableName" ? never : K]: T[K] extends {
3284
- config: {
3285
- zodClientSchema: infer C extends z.ZodTypeAny;
3286
- };
3287
- } ? C : T[K] extends () => {
3288
- type: "hasMany" | "manyToMany";
3289
- schema: infer S extends SchemaDefinition;
3290
- } ? z.ZodArray<z.ZodObject<Prettify<InferClientSchema<S>>>> : T[K] extends () => {
3291
- type: "hasOne" | "belongsTo";
3292
- schema: infer S extends SchemaDefinition;
3293
- } ? z.ZodObject<Prettify<InferClientSchema<S>>> : never;
3294
- };
3295
- type InferValidationSchema<T> = {
3296
- [K in keyof T as K extends "_tableName" ? never : K]: T[K] extends {
3297
- config: {
3298
- zodValidationSchema: infer V extends z.ZodTypeAny;
4798
+ to: () => {
4799
+ config: {
4800
+ [P in Key]: infer S extends z.ZodTypeAny;
4801
+ };
3299
4802
  };
3300
- } ? V : T[K] extends () => {
4803
+ } ? S : T[K] extends () => {
3301
4804
  type: "hasMany" | "manyToMany";
3302
4805
  schema: infer S extends SchemaDefinition;
3303
- } ? z.ZodArray<z.ZodObject<Prettify<InferValidationSchema<S>>>> : T[K] extends () => {
4806
+ } ? z.ZodArray<z.ZodObject<Prettify<InferSchemaByKey<S, Key>>>> : T[K] extends () => {
3304
4807
  type: "hasOne" | "belongsTo";
3305
4808
  schema: infer S extends SchemaDefinition;
3306
- } ? z.ZodObject<Prettify<InferValidationSchema<S>>> : never;
4809
+ } ? z.ZodObject<Prettify<InferSchemaByKey<S, Key>>> : never;
3307
4810
  };
4811
+ type InferSqlSchema<T> = InferSchemaByKey<T, "zodSqlSchema">;
4812
+ type InferClientSchema<T> = InferSchemaByKey<T, "zodClientSchema">;
4813
+ type InferValidationSchema<T> = InferSchemaByKey<T, "zodValidationSchema">;
3308
4814
  type InferDefaultValues2<T> = {
3309
4815
  [K in keyof T as K extends "_tableName" ? never : K]: T[K] extends {
3310
4816
  config: {