@advidi-network/zod-to-reactive-form
Advanced tools
Comparing version 1.2.2 to 1.2.3
import { z } from 'zod'; | ||
import { FieldOptions, ZodControl, ZodFormArray } from '../types'; | ||
import { FieldOptions, GeneratorOptions, ZodControl, ZodFormArray } from '../types'; | ||
import { AbstractControlOptions } from '@angular/forms'; | ||
export type FormArrayOverrides<TSchema> = TSchema extends z.ZodArray<infer TArray> ? Array<ZodControl<TArray> | FieldOptions<z.infer<TArray>>> : never; | ||
export declare function createFormArray<TSchema extends z.ZodArray<z.ZodTypeAny>>(schema: TSchema, overrides?: FormArrayOverrides<TSchema>, options?: AbstractControlOptions): ZodFormArray<TSchema>; | ||
export declare function createFormArray<TSchema extends z.ZodArray<z.ZodTypeAny>>(schema: TSchema, overrides?: FormArrayOverrides<TSchema>, options?: AbstractControlOptions, generatorOptions?: GeneratorOptions): ZodFormArray<TSchema>; |
@@ -1,4 +0,4 @@ | ||
import { FieldOptions, GuardUndefined } from '../types'; | ||
import { FieldOptions } from '../types'; | ||
import { z } from 'zod'; | ||
import { AbstractControlOptions, FormControl } from '@angular/forms'; | ||
export declare function createFormControl<TSchema extends z.ZodType>(schema: TSchema, overrides?: FieldOptions<z.infer<TSchema>> & AbstractControlOptions): FormControl<GuardUndefined<z.infer<TSchema>>>; | ||
import { FormControl } from '@angular/forms'; | ||
export declare function createFormControl<TSchema extends z.ZodType>(schema: TSchema, overrides?: FieldOptions<z.infer<TSchema>>): FormControl<z.infer<TSchema>>; |
import { z } from 'zod'; | ||
import { AbstractControlOptions, FormControl } from '@angular/forms'; | ||
import { FieldOptions, GuardUndefined, UnwrapLazyType, ZodControl, ZodFormGroup } from '../types'; | ||
import { FieldOptions, GeneratorOptions, UnwrapLazyType, ZodControl, ZodFormGroup } from '../types'; | ||
export type FormGroupOverrides<TSchema> = TSchema extends z.ZodObject<infer TObjectType> ? { | ||
[K in keyof TObjectType]?: FieldOptions<z.infer<TObjectType[K]>> | ZodControl<UnwrapLazyType<TObjectType[K]>> | FormControl<GuardUndefined<z.infer<TObjectType[K]>>>; | ||
[K in keyof TObjectType]?: FieldOptions<z.infer<TObjectType[K]>> | ZodControl<UnwrapLazyType<TObjectType[K]>> | FormControl<z.infer<TObjectType[K]>>; | ||
} : never; | ||
export declare function createFormGroup<TSchema extends z.SomeZodObject>(schema: TSchema, overrides?: FormGroupOverrides<TSchema>, options?: AbstractControlOptions): ZodFormGroup<TSchema>; | ||
export declare function createFormGroup<TSchema extends z.SomeZodObject>(schema: TSchema, overrides?: FormGroupOverrides<TSchema>, options?: AbstractControlOptions, generatorOptions?: GeneratorOptions): ZodFormGroup<TSchema>; |
import { z } from "zod"; | ||
import { FormControl } from "@angular/forms"; | ||
import { FieldOptions, GuardUndefined, ZodFormArray, ZodFormGroup } from "../types"; | ||
import { FieldOptions, ZodFormArray, ZodFormGroup } from "../types"; | ||
export declare function createZodControl<T extends z.SomeZodObject>(schema: T, options?: FieldOptions<z.infer<T>>): ZodFormGroup<T>; | ||
export declare function createZodControl<T extends z.ZodArray<any>>(schema: T, options?: FieldOptions<z.infer<T>>): ZodFormArray<T>; | ||
export declare function createZodControl<T extends z.ZodFirstPartySchemaTypes>(schema: T, options?: FieldOptions<z.infer<T>>): FormControl<GuardUndefined<z.infer<T>>>; | ||
export declare function createZodControl<T extends z.ZodFirstPartySchemaTypes>(schema: T, options?: FieldOptions<z.infer<T>>): FormControl<z.infer<T>>; |
export * from './create-form-array'; | ||
export * from './create-form-group'; | ||
export * from './create-form-control'; | ||
export * from './is-zod-schema-required'; |
import { AsyncValidatorFn, ValidatorFn } from "@angular/forms"; | ||
import { GuardUndefined } from "./undefined-guard"; | ||
export interface FieldOptions<T> { | ||
value?: GuardUndefined<T>; | ||
import { GeneratorOptions } from "./generator-options"; | ||
export interface FieldOptions<T> extends GeneratorOptions { | ||
value?: T; | ||
disabled?: boolean; | ||
@@ -6,0 +6,0 @@ validators?: ValidatorFn | ValidatorFn[] | null; |
export * from './field-options'; | ||
export * from './generator-options'; | ||
export * from './unwrap-lazy'; | ||
export * from './zod-control'; | ||
export * from './non-undefinable'; | ||
export * from './undefined-guard'; |
@@ -1,2 +0,1 @@ | ||
import { GuardUndefined } from './undefined-guard'; | ||
import { z } from 'zod'; | ||
@@ -7,4 +6,4 @@ import { FormArray, FormControl, FormGroup } from '@angular/forms'; | ||
[K in keyof TObjectType]: ZodControl<UnwrapLazyType<TObjectType[K]>>; | ||
}> : T extends z.ZodFirstPartySchemaTypes ? T extends z.ZodType<infer Output> ? FormControl<GuardUndefined<Output>> : never : never; | ||
}> : T extends z.ZodFirstPartySchemaTypes ? T extends z.ZodType<infer Output> ? FormControl<Output> : never : never; | ||
export type ZodFormGroup<T> = T extends z.ZodObject<infer TObjectType> ? ZodControl<T> : never; | ||
export type ZodFormArray<T> = T extends z.ZodArray<infer TObjectType> ? ZodControl<T> : never; |
{ | ||
"name": "@advidi-network/zod-to-reactive-form", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31049
27
169