@netwo/devkit 0.0.0-stage → 1.1.0

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.
@@ -0,0 +1,516 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnDestroy, DoCheck, Signal, PipeTransform, ValueEqualityFn, Injector, InjectOptions } from '@angular/core';
3
+ import * as rxjs from 'rxjs';
4
+ import { Observable } from 'rxjs';
5
+ import * as _angular_forms from '@angular/forms';
6
+ import { ControlValueAccessor, NgControl, AbstractControl, ValidationErrors, ValidatorFn, FormControl, FormArray, FormGroup, FormControlStatus } from '@angular/forms';
7
+ import { BinaryComparer, Nullable, MinMaxRange, DataVolume, Octet, DateRange, RequireAtLeastOne, Into } from '@netwo/devkit';
8
+ import * as i1 from '@netwo/devkit/angular';
9
+ import { PathKind, LogicFn, SchemaPath, SchemaPathRules, ValidationError } from '@angular/forms/signals';
10
+ import { PhoneNumber } from 'google-libphonenumber';
11
+
12
+ declare function injectCva<T = unknown>(): CvaDirective<T>;
13
+ type Source = 'user' | 'program-control' | 'program-accessor';
14
+ interface WriteValueEvent {
15
+ readonly type: 'writeValue';
16
+ readonly source: Source;
17
+ readonly emitEvent: boolean;
18
+ }
19
+ declare function isWriteValueEvent(value: StateChangesKind): value is WriteValueEvent;
20
+ type StateChangesKind = 'setDisabledState' | 'setRequiredState' | 'updateErrorState' | 'unknown' | WriteValueEvent;
21
+ interface ToCvaOptions<T> {
22
+ readonly equal?: BinaryComparer<T>;
23
+ readonly initialValue?: T;
24
+ }
25
+ declare function toCvaValue<T>(cva: CvaDirective<T>, options: ToCvaOptions<T> & {
26
+ readonly initialValue: T;
27
+ }): Signal<NonNullable<T>>;
28
+ declare function toCvaValue<T>(cva: CvaDirective<T>, options?: ToCvaOptions<T>): Signal<Nullable<T>>;
29
+ /**
30
+ * Control value accessor host directive
31
+ * Enable the ability to use the ReactiveForm directive on the host component
32
+ */
33
+ declare class CvaDirective<T = unknown> implements ControlValueAccessor, OnDestroy, DoCheck {
34
+ set ngControl(ngControl: NgControl | null);
35
+ get ngControl(): NgControl | null;
36
+ private _explicitNgControl;
37
+ readonly _implicitNgControl: NgControl | null;
38
+ private readonly _cdr;
39
+ private readonly _destroyRef;
40
+ private readonly _disabledState;
41
+ private readonly _requiredState;
42
+ private readonly _valueSignal;
43
+ readonly valueSignal: Signal<T>;
44
+ set value(value: T);
45
+ get value(): T;
46
+ get hasValue(): boolean;
47
+ get hasNoValue(): boolean;
48
+ set disabled(value: boolean);
49
+ get disabled(): boolean;
50
+ set required(value: boolean);
51
+ get required(): boolean;
52
+ get errorState(): boolean;
53
+ private _errorState;
54
+ private readonly _stateChanges$;
55
+ readonly stateChanges$: rxjs.Observable<StateChangesKind>;
56
+ readonly valueChanges$: rxjs.Observable<T>;
57
+ readonly compareWithInput: _angular_core.InputSignal<BinaryComparer<T>>;
58
+ readonly _compareWith: _angular_core.WritableSignal<BinaryComparer<T>>;
59
+ readonly valueChange: _angular_core.OutputRef<T>;
60
+ readonly requiredChanges$: rxjs.Observable<boolean>;
61
+ readonly disabledChanges$: rxjs.Observable<boolean>;
62
+ readonly errorStateChanges$: rxjs.Observable<boolean>;
63
+ onChange: (value: unknown) => void;
64
+ onTouched: () => void;
65
+ constructor();
66
+ ngDoCheck(): void;
67
+ ngOnDestroy(): void;
68
+ writeValue(value: T): void;
69
+ registerOnChange(fn: (value: unknown) => void): void;
70
+ registerOnTouched(fn: () => void): void;
71
+ setDisabledState(isDisabled: boolean): void;
72
+ setRequiredState(isRequired: boolean): void;
73
+ /**
74
+ * Need re-validates errors on every CD iteration to make sure we are also
75
+ * covering non-control errors, errors that happens outside of this control
76
+ */
77
+ updateErrorState(): void;
78
+ /**
79
+ * Used to change the value of a control.
80
+ * @param value the value to be applied
81
+ * @param notifyAccessor @default true whether to emit "onChange" event.
82
+ * @param notifyControl @default true trigger "valueChanges" stream.
83
+ * Should be "false", if the change is made programmatically (internally) by the control, "true" otherwise
84
+ */
85
+ setValue(value: T, options: {
86
+ notifyAccessor?: boolean;
87
+ notifyControl?: boolean;
88
+ source: Exclude<Source, 'program-accessor'>;
89
+ }): void;
90
+ private _setValue;
91
+ markAsTouched(): void;
92
+ _stateChange(kind?: StateChangesKind): void;
93
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CvaDirective<any>, never>;
94
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CvaDirective<any>, never, never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "compareWithInput": { "alias": "compareWith"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, [{ directive: typeof i1.DisabledStateDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.RequiredStateDirective; inputs: {}; outputs: {}; }]>;
95
+ static ngAcceptInputType_disabled: unknown;
96
+ static ngAcceptInputType_required: unknown;
97
+ }
98
+
99
+ interface ObjectFormError {
100
+ error: string;
101
+ [key: string]: unknown;
102
+ }
103
+ type FormError = string | ObjectFormError;
104
+ type FormErrors = Record<string, FormError>;
105
+ type FormValidatorFn<T, E = FormErrors> = (control: AbstractControl<T>) => E | null;
106
+ type FormAsyncValidatorFn<T, E = FormErrors> = (control: AbstractControl<T>) => Promise<E | null> | Observable<E | null>;
107
+ declare const EMPTY_ERROR: "";
108
+ declare function getFormErrorMessage(error: unknown): string | undefined;
109
+ declare function genericFormErrorMessage(errors: ValidationErrors): string | undefined;
110
+ declare class GenericFormErrorMessagePipe implements PipeTransform {
111
+ transform(errors: ValidationErrors): string | undefined;
112
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GenericFormErrorMessagePipe, never>;
113
+ static ɵpipe: _angular_core.ɵɵPipeDeclaration<GenericFormErrorMessagePipe, "genericFormErrorMessage", true>;
114
+ }
115
+
116
+ interface CreateGroupValidatorOptions {
117
+ errorConflict: 'overwrite' | 'append' | 'skip';
118
+ }
119
+ declare function createGroupValidator<T extends object, ErrorKey extends string>(targetControlName: string | string[], errorKey: ErrorKey, validateFn: (control: AbstractControl<T>) => Record<ErrorKey, FormError> | null, options?: Partial<CreateGroupValidatorOptions>): ValidatorFn;
120
+
121
+ type AsFormControl<T> = {
122
+ [P in keyof T]: FormControl<T[P]>;
123
+ };
124
+ type AsNullableFormControl<T> = {
125
+ [P in keyof T]: FormControl<T[P] | null>;
126
+ };
127
+ type ControlRawValue<TCtrl extends AbstractControl> = ReturnType<TCtrl['getRawValue']>;
128
+ type FormGroupValue<TControl extends {
129
+ [K in keyof TControl]: AbstractControl<any>;
130
+ } = any> = ReturnType<FormGroup<TControl>['getRawValue']>;
131
+ type FormArrayValue<TControl extends AbstractControl<any> = any> = ReturnType<FormArray<TControl>['getRawValue']>;
132
+
133
+ /**
134
+ * @important
135
+ * If the control value is updated using `setValue` or `patchValue`
136
+ * with `{ emitEvent: false }`, the underlying observable will not emit.
137
+ * As a result, this signal will NOT be updated and may become out of sync
138
+ * with the actual control value.
139
+ *
140
+ * Always ensure `emitEvent` is not set to `false`, or manually trigger
141
+ * a synchronization if you intentionally suppress events.
142
+ */
143
+ declare function controlSignal<TCtrl extends AbstractControl>(control: TCtrl, options?: {
144
+ equal?: ValueEqualityFn<ControlRawValue<TCtrl>>;
145
+ injector?: Injector;
146
+ }): Signal<ControlRawValue<TCtrl>>;
147
+
148
+ declare const NSCE_LENGTH$1 = 13;
149
+ declare const SIRET_LENGTH$1 = 14;
150
+ declare const URL_REGEX$1: RegExp;
151
+ type SignalValidatorPath<TValue, TPathKind extends PathKind = PathKind.Root> = SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>;
152
+ type SignalValidationError = ValidationError.WithoutFieldTree & Record<string, unknown>;
153
+ interface SignalValidatorConfig<TValue, TPathKind extends PathKind = PathKind.Root> {
154
+ readonly when?: LogicFn<TValue, boolean, TPathKind>;
155
+ }
156
+ interface SignalUniqueValidatorConfig<TValue, TPathKind extends PathKind = PathKind.Root> extends SignalValidatorConfig<TValue, TPathKind> {
157
+ readonly message?: string;
158
+ }
159
+ declare function validationError(kind: string, message: string, data?: Record<string, unknown>): SignalValidationError;
160
+ declare const customFileTypes$1: readonly ["csv", "xlsx"];
161
+ type FileType$1 = (typeof customFileTypes$1)[number] | (string & {});
162
+ type FileTypeOrConfig<TPathKind extends PathKind> = FileType$1 | SignalValidatorConfig<Nullable<File>, TPathKind>;
163
+ type BooleanOrConfig<TValue, TPathKind extends PathKind> = boolean | SignalValidatorConfig<TValue, TPathKind>;
164
+ declare function validatorDataVolumeRange$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<number | null | undefined, TPathKind>, min: DataVolume<Octet>, max: DataVolume<Octet>, config?: SignalValidatorConfig<number | null | undefined, TPathKind>): void;
165
+ declare function validatorDateRange$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<Date | null | undefined, TPathKind>, range: DateRange, useTimeOrConfig?: BooleanOrConfig<Date | null | undefined, TPathKind>, config?: SignalValidatorConfig<Date | null | undefined, TPathKind>): void;
166
+ declare function validatorDifferentDate$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<Date | null | undefined, TPathKind>, date: Date, config?: SignalValidatorConfig<Date | null | undefined, TPathKind>): void;
167
+ declare function validatorEmail$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
168
+ declare function validatorEsignatureSignerField$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
169
+ declare function validatorFileType$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<Nullable<File>, TPathKind>, ...fileTypesOrConfig: FileTypeOrConfig<TPathKind>[]): void;
170
+ declare function validatorFrenchPhoneNumber$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
171
+ declare function validatorLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<unknown[] | Set<unknown> | null | undefined, TPathKind>, requiredLength: number, config?: SignalValidatorConfig<unknown[] | Set<unknown> | null | undefined, TPathKind>): void;
172
+ declare function validatorLengthRange$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<unknown, TPathKind>, range: RequireAtLeastOne<{
173
+ min: number;
174
+ max: number;
175
+ }>, config?: SignalValidatorConfig<unknown, TPathKind>): void;
176
+ declare function validatorMax$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<number | null | undefined, TPathKind>, max: number, config?: SignalValidatorConfig<number | null | undefined, TPathKind>): void;
177
+ declare function validatorMaxLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<unknown[] | Set<unknown> | null | undefined, TPathKind>, maxLength: number, config?: SignalValidatorConfig<unknown[] | Set<unknown> | null | undefined, TPathKind>): void;
178
+ declare function validatorMaxFileSize$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<Nullable<File>, TPathKind>, maxFileSize: number, config?: SignalValidatorConfig<Nullable<File>, TPathKind>): void;
179
+ declare function validatorMaxTextLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, maxTextLength: number, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
180
+ declare function validatorMin$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<number | null | undefined, TPathKind>, min: number, config?: SignalValidatorConfig<number | null | undefined, TPathKind>): void;
181
+ declare function validatorMinLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<unknown[] | Set<unknown> | null | undefined, TPathKind>, minLength: number, config?: SignalValidatorConfig<unknown[] | Set<unknown> | null | undefined, TPathKind>): void;
182
+ declare function validatorMinTextLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, minTextLength: number, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
183
+ declare function validatorMobilePhoneNumber$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<PhoneNumber | null | undefined, TPathKind>, config?: SignalValidatorConfig<PhoneNumber | null | undefined, TPathKind>): void;
184
+ declare function validatorPortableApnfNumber$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
185
+ declare function validatorRange$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<number | null | undefined, TPathKind>, min: number, max: number, config?: SignalValidatorConfig<number | null | undefined, TPathKind>): void;
186
+ declare function validatorRequired$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<unknown, TPathKind>, config?: SignalValidatorConfig<unknown, TPathKind>): void;
187
+ declare function validatorRequiredTrue$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<boolean | null | undefined, TPathKind>, config?: SignalValidatorConfig<boolean | null | undefined, TPathKind>): void;
188
+ declare function validatorTextLength$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, requiredLength: number, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
189
+ declare function validatorTextLengthRange$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, minTextLength: number, maxTextLength: number, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
190
+ declare function validatorUnique$1<T, TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<T | T[] | null | undefined, TPathKind>, comparedValues?: T[] | Signal<T[]>, config?: SignalUniqueValidatorConfig<T | T[] | null | undefined, TPathKind>): void;
191
+ declare function validatorUrl$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
192
+ declare function validatorArcepSlicePrefix$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
193
+ declare function validatorCompanyType$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
194
+ type AuthorizedMask$1 = number | number[] | MinMaxRange;
195
+ declare const MAX_MASK$1 = 32;
196
+ declare const MIN_MASK$1 = 0;
197
+ declare function validatorIpv4WithMask$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | string[] | null | undefined, TPathKind>, authorizedMasks?: AuthorizedMask$1, config?: SignalValidatorConfig<string | string[] | null | undefined, TPathKind>): void;
198
+ declare function validatorIpv4WithoutMask$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
199
+ declare function validatorCidrIsNetworkAddress$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | string[] | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | string[] | null | undefined, TPathKind>): void;
200
+ declare function validatorKvk$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
201
+ declare function validatorNafApe$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
202
+ declare function validatorPortabilityPrefix$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
203
+ declare function validatorRio$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
204
+ declare function validatorSimNumber$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, nsceEnabledOrConfig?: BooleanOrConfig<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
205
+ declare function validatorSiren$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
206
+ declare function validatorSiret$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, omitSirenOrConfig?: BooleanOrConfig<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
207
+ declare function validatorVatNl$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
208
+ declare function validatorVatFr$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
209
+ declare function validatorAlphaNumeric$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<string | null | undefined, TPathKind>, config?: SignalValidatorConfig<string | null | undefined, TPathKind>): void;
210
+ declare function groupValidatorLegalIdentifierRcs$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<{
211
+ legalIdentifier: Nullable<string>;
212
+ rcs: string;
213
+ }, TPathKind>, config?: SignalValidatorConfig<{
214
+ legalIdentifier: Nullable<string>;
215
+ rcs: string;
216
+ }, TPathKind>): void;
217
+ declare function groupValidatorLegalIdentifierVatFr$1<TPathKind extends PathKind = PathKind.Root>(path: SignalValidatorPath<{
218
+ legalIdentifier: Nullable<string>;
219
+ vatNumber: string;
220
+ }, TPathKind>, config?: SignalValidatorConfig<{
221
+ legalIdentifier: Nullable<string>;
222
+ vatNumber: string;
223
+ }, TPathKind>): void;
224
+ declare const validators: {
225
+ readonly alphaNumeric: typeof validatorAlphaNumeric$1;
226
+ readonly arcepSlicePrefix: typeof validatorArcepSlicePrefix$1;
227
+ readonly cidrIsNetworkAddress: typeof validatorCidrIsNetworkAddress$1;
228
+ readonly companyType: typeof validatorCompanyType$1;
229
+ readonly dataVolumeRange: typeof validatorDataVolumeRange$1;
230
+ readonly dateRange: typeof validatorDateRange$1;
231
+ readonly differentDate: typeof validatorDifferentDate$1;
232
+ readonly email: typeof validatorEmail$1;
233
+ readonly esignatureSignerField: typeof validatorEsignatureSignerField$1;
234
+ readonly fileType: typeof validatorFileType$1;
235
+ readonly frenchPhoneNumber: typeof validatorFrenchPhoneNumber$1;
236
+ readonly ipv4WithMask: typeof validatorIpv4WithMask$1;
237
+ readonly ipv4WithoutMask: typeof validatorIpv4WithoutMask$1;
238
+ readonly kvk: typeof validatorKvk$1;
239
+ readonly legalIdentifierRcs: typeof groupValidatorLegalIdentifierRcs$1;
240
+ readonly legalIdentifierVatFr: typeof groupValidatorLegalIdentifierVatFr$1;
241
+ readonly length: typeof validatorLength$1;
242
+ readonly lengthRange: typeof validatorLengthRange$1;
243
+ readonly max: typeof validatorMax$1;
244
+ readonly maxFileSize: typeof validatorMaxFileSize$1;
245
+ readonly maxLength: typeof validatorMaxLength$1;
246
+ readonly maxTextLength: typeof validatorMaxTextLength$1;
247
+ readonly min: typeof validatorMin$1;
248
+ readonly minLength: typeof validatorMinLength$1;
249
+ readonly minTextLength: typeof validatorMinTextLength$1;
250
+ readonly mobilePhoneNumber: typeof validatorMobilePhoneNumber$1;
251
+ readonly nafApe: typeof validatorNafApe$1;
252
+ readonly portabilityPrefix: typeof validatorPortabilityPrefix$1;
253
+ readonly portableApnfNumber: typeof validatorPortableApnfNumber$1;
254
+ readonly range: typeof validatorRange$1;
255
+ readonly required: typeof validatorRequired$1;
256
+ readonly requiredTrue: typeof validatorRequiredTrue$1;
257
+ readonly rio: typeof validatorRio$1;
258
+ readonly simNumber: typeof validatorSimNumber$1;
259
+ readonly siren: typeof validatorSiren$1;
260
+ readonly siret: typeof validatorSiret$1;
261
+ readonly textLength: typeof validatorTextLength$1;
262
+ readonly textLengthRange: typeof validatorTextLengthRange$1;
263
+ readonly unique: typeof validatorUnique$1;
264
+ readonly url: typeof validatorUrl$1;
265
+ readonly vatFr: typeof validatorVatFr$1;
266
+ readonly vatNl: typeof validatorVatNl$1;
267
+ };
268
+
269
+ type signalValidators_d_SignalUniqueValidatorConfig<TValue, TPathKind extends PathKind = PathKind.Root> = SignalUniqueValidatorConfig<TValue, TPathKind>;
270
+ type signalValidators_d_SignalValidatorConfig<TValue, TPathKind extends PathKind = PathKind.Root> = SignalValidatorConfig<TValue, TPathKind>;
271
+ declare const signalValidators_d_validationError: typeof validationError;
272
+ declare const signalValidators_d_validators: typeof validators;
273
+ declare namespace signalValidators_d {
274
+ export { MAX_MASK$1 as MAX_MASK, MIN_MASK$1 as MIN_MASK, NSCE_LENGTH$1 as NSCE_LENGTH, SIRET_LENGTH$1 as SIRET_LENGTH, URL_REGEX$1 as URL_REGEX, customFileTypes$1 as customFileTypes, groupValidatorLegalIdentifierRcs$1 as groupValidatorLegalIdentifierRcs, groupValidatorLegalIdentifierVatFr$1 as groupValidatorLegalIdentifierVatFr, signalValidators_d_validationError as validationError, validatorAlphaNumeric$1 as validatorAlphaNumeric, validatorArcepSlicePrefix$1 as validatorArcepSlicePrefix, validatorCidrIsNetworkAddress$1 as validatorCidrIsNetworkAddress, validatorCompanyType$1 as validatorCompanyType, validatorDataVolumeRange$1 as validatorDataVolumeRange, validatorDateRange$1 as validatorDateRange, validatorDifferentDate$1 as validatorDifferentDate, validatorEmail$1 as validatorEmail, validatorEsignatureSignerField$1 as validatorEsignatureSignerField, validatorFileType$1 as validatorFileType, validatorFrenchPhoneNumber$1 as validatorFrenchPhoneNumber, validatorIpv4WithMask$1 as validatorIpv4WithMask, validatorIpv4WithoutMask$1 as validatorIpv4WithoutMask, validatorKvk$1 as validatorKvk, validatorLength$1 as validatorLength, validatorLengthRange$1 as validatorLengthRange, validatorMax$1 as validatorMax, validatorMaxFileSize$1 as validatorMaxFileSize, validatorMaxLength$1 as validatorMaxLength, validatorMaxTextLength$1 as validatorMaxTextLength, validatorMin$1 as validatorMin, validatorMinLength$1 as validatorMinLength, validatorMinTextLength$1 as validatorMinTextLength, validatorMobilePhoneNumber$1 as validatorMobilePhoneNumber, validatorNafApe$1 as validatorNafApe, validatorPortabilityPrefix$1 as validatorPortabilityPrefix, validatorPortableApnfNumber$1 as validatorPortableApnfNumber, validatorRange$1 as validatorRange, validatorRequired$1 as validatorRequired, validatorRequiredTrue$1 as validatorRequiredTrue, validatorRio$1 as validatorRio, validatorSimNumber$1 as validatorSimNumber, validatorSiren$1 as validatorSiren, validatorSiret$1 as validatorSiret, validatorTextLength$1 as validatorTextLength, validatorTextLengthRange$1 as validatorTextLengthRange, validatorUnique$1 as validatorUnique, validatorUrl$1 as validatorUrl, validatorVatFr$1 as validatorVatFr, validatorVatNl$1 as validatorVatNl, signalValidators_d_validators as validators };
275
+ export type { AuthorizedMask$1 as AuthorizedMask, FileType$1 as FileType, signalValidators_d_SignalUniqueValidatorConfig as SignalUniqueValidatorConfig, signalValidators_d_SignalValidatorConfig as SignalValidatorConfig };
276
+ }
277
+
278
+ /**
279
+ * Typed contract for every validator error message.
280
+ *
281
+ * Each entry is either:
282
+ * - a static `string` message, or
283
+ * - a factory `(params) => string` when the message needs interpolated values.
284
+ *
285
+ * The devkit only declares the contract (no localized text). The actual
286
+ * messages are provided by the consuming application through
287
+ * {@link provideValidatorMessagesToken}.
288
+ */
289
+ interface ValidatorMessages {
290
+ readonly alphaNumeric: string;
291
+ readonly arcepSlicePrefix: string;
292
+ readonly companyType: string;
293
+ readonly dataVolumeRangeInteger: string;
294
+ readonly differentDate: string;
295
+ readonly email: string;
296
+ readonly esignatureField: string;
297
+ readonly fileType: string;
298
+ readonly frenchPhoneNumber: string;
299
+ readonly ipv4: string;
300
+ readonly ipv4WithoutMask: string;
301
+ readonly kvk: string;
302
+ readonly legalIdentifierRcs: string;
303
+ readonly legalIdentifierVatFr: string;
304
+ readonly mobilePhoneNumber: string;
305
+ readonly nafApe: string;
306
+ readonly portabilityPrefix: string;
307
+ readonly portableApnfNumber: string;
308
+ readonly required: string;
309
+ readonly requiredTrue: string;
310
+ readonly rio: string;
311
+ readonly siren: string;
312
+ readonly siret: string;
313
+ readonly unique: string;
314
+ readonly url: string;
315
+ readonly vatFr: string;
316
+ readonly vatNl: string;
317
+ readonly cidrIsNetworkAddress: (params: {
318
+ invalidNetworks: string[];
319
+ }) => string;
320
+ readonly dataVolumeRange: (params: {
321
+ minVolume: DataVolume<Octet>;
322
+ maxVolume: DataVolume<Octet>;
323
+ }) => string;
324
+ readonly dateRange: (params: {
325
+ startDate?: Date;
326
+ endDate?: Date;
327
+ useTime: boolean;
328
+ }) => string;
329
+ readonly length: (params: {
330
+ requiredLength: number;
331
+ }) => string;
332
+ readonly lengthRange: (params: {
333
+ min: number;
334
+ max: number;
335
+ }) => string;
336
+ readonly max: (params: {
337
+ max: number;
338
+ }) => string;
339
+ readonly maxFileSize: (params: {
340
+ size: number;
341
+ }) => string;
342
+ readonly maxLength: (params: {
343
+ maxLength: number;
344
+ }) => string;
345
+ readonly maxTextLength: (params: {
346
+ maxTextLength: number;
347
+ }) => string;
348
+ readonly min: (params: {
349
+ min: number;
350
+ }) => string;
351
+ readonly minLength: (params: {
352
+ minLength: number;
353
+ }) => string;
354
+ readonly minTextLength: (params: {
355
+ minTextLength: number;
356
+ }) => string;
357
+ readonly range: (params: {
358
+ min: number;
359
+ max: number;
360
+ }) => string;
361
+ readonly simNumber: (params: {
362
+ nsceEnabled: boolean;
363
+ }) => string;
364
+ readonly textLength: (params: {
365
+ requiredLength: number;
366
+ }) => string;
367
+ readonly textLengthRange: (params: {
368
+ min: number;
369
+ max: number;
370
+ }) => string;
371
+ }
372
+ /**
373
+ * Default, empty message catalog.
374
+ *
375
+ * Used as a fallback when no messages are provided (e.g. isolated devkit unit
376
+ * tests) so that validators never crash. Applications are expected to override
377
+ * it via {@link provideValidatorMessagesToken}.
378
+ */
379
+ declare const DEFAULT_VALIDATOR_MESSAGES: ValidatorMessages;
380
+ declare const injectValidatorMessages: {
381
+ (): ValidatorMessages;
382
+ (injectOptions: _angular_core.InjectOptions & {
383
+ optional?: false;
384
+ } & {
385
+ injector?: _angular_core.Injector;
386
+ }): ValidatorMessages;
387
+ (injectOptions: _angular_core.InjectOptions & {
388
+ injector?: _angular_core.Injector;
389
+ }): ValidatorMessages | null;
390
+ };
391
+ declare const provideValidatorMessagesToken: (() => _angular_core.Provider) & ((value: ValidatorMessages | (() => ValidatorMessages)) => _angular_core.Provider);
392
+ declare const VALIDATOR_MESSAGES: _angular_core.InjectionToken<ValidatorMessages>;
393
+ /**
394
+ * Resolves the validator messages outside of an Angular injection context.
395
+ *
396
+ * Validators are called eagerly (e.g. during class-field initialization or
397
+ * `fb.control(...)`) so they cannot rely on `inject()`. This helper reads the
398
+ * token from the root injector, mirroring how `LOCALE_ID` is resolved.
399
+ *
400
+ * Falls back to {@link DEFAULT_VALIDATOR_MESSAGES} if the root injector is not
401
+ * set yet or the token is not provided.
402
+ */
403
+ declare function getValidatorMessages(): ValidatorMessages;
404
+
405
+ declare const NSCE_LENGTH = 13;
406
+ declare const SIRET_LENGTH = 14;
407
+ declare const URL_REGEX: RegExp;
408
+ declare const customFileTypes: readonly ["csv", "xlsx"];
409
+ type FileType = (typeof customFileTypes)[number] | (string & {});
410
+ declare function validatorDataVolumeRange(min: DataVolume<Octet>, max: DataVolume<Octet>): FormValidatorFn<number>;
411
+ declare function validatorDateRange(range: DateRange, useTime?: boolean): FormValidatorFn<Date | null>;
412
+ declare function validatorDifferentDate(date: Date): FormValidatorFn<Date | null>;
413
+ declare function validatorEmail(control: AbstractControl<string>): FormErrors | null;
414
+ declare function validatorFileType(...fileTypes: FileType[]): FormValidatorFn<Nullable<File>>;
415
+ declare function validatorFrenchPhoneNumber({ value, }: AbstractControl<string>): FormErrors | null;
416
+ declare function validatorLength(requiredLength: number): FormValidatorFn<unknown[] | Set<unknown>>;
417
+ declare function validatorLengthRange(range: RequireAtLeastOne<{
418
+ min: number;
419
+ max: number;
420
+ }>): FormValidatorFn<unknown>;
421
+ declare function validatorMax(max: number): FormValidatorFn<number>;
422
+ declare function validatorMaxLength(maxLength: number): FormValidatorFn<unknown[] | Set<unknown>>;
423
+ declare function validatorMaxFileSize(maxFileSize: number): FormValidatorFn<Nullable<File>>;
424
+ declare function validatorMaxTextLength(maxTextLength: number): FormValidatorFn<string>;
425
+ declare function validatorMin(min: number): FormValidatorFn<number>;
426
+ declare function validatorMinLength(minLength: number): FormValidatorFn<unknown[] | Set<unknown>>;
427
+ declare function validatorMinTextLength(minTextLength: number): FormValidatorFn<string>;
428
+ declare function validatorMobilePhoneNumber({ value, }: AbstractControl<PhoneNumber>): FormErrors | null;
429
+ /**
430
+ * Validate that the provided number start by "01", "02", "03", "04", "05" ou "09".
431
+ * "06" and "07" are Mobile specific, and "08" are custom number excluded from our portability flow.
432
+ * @param value French phone number to validate
433
+ * @returns `null` if valid, or a `FormErrors` object with a `frenchPhoneNumber` key if invalid
434
+ */
435
+ declare function validatorPortableApnfNumber({ value, }: AbstractControl<string>): FormErrors | null;
436
+ declare function validatorRange(min: number, max: number): FormValidatorFn<number>;
437
+ declare const validatorRequired: (control: AbstractControl<unknown>) => FormErrors | null;
438
+ declare function validatorRequiredTrue(control: AbstractControl<boolean>): FormErrors | null;
439
+ declare function validatorTextLength(requiredLength: number): FormValidatorFn<string>;
440
+ declare function validatorTextLengthRange(minTextLength: number, maxTextLength: number): FormValidatorFn<string>;
441
+ declare function validatorUnique<T>(comparedValues?: T[] | Signal<T[]>, config?: {
442
+ message?: string;
443
+ }): FormValidatorFn<T | T[]>;
444
+ declare function validatorUrl(control: AbstractControl<string>): FormErrors | null;
445
+ declare function validatorArcepSlicePrefix(control: AbstractControl<string>): FormErrors | null;
446
+ declare function validatorCompanyType({ value, }: AbstractControl<string>): FormErrors | null;
447
+ type AuthorizedMask = number | number[] | MinMaxRange;
448
+ declare const MAX_MASK = 32;
449
+ declare const MIN_MASK = 0;
450
+ declare function validatorIpv4WithMask(authorizedMasks?: AuthorizedMask): FormValidatorFn<string | string[]>;
451
+ declare function validatorIpv4WithoutMask(control: AbstractControl<string>): FormErrors | null;
452
+ declare function validatorCidrIsNetworkAddress({ value, }: AbstractControl<string | string[]>): FormErrors | null;
453
+ declare function validatorKvk(control: AbstractControl<string>): FormErrors | null;
454
+ declare function validatorNafApe(control: AbstractControl<string>): FormErrors | null;
455
+ declare function validatorPortabilityPrefix(control: AbstractControl<string>): FormErrors | null;
456
+ declare function validatorEsignatureSignerField(control: AbstractControl<string>): FormErrors | null;
457
+ declare function validatorRio(control: AbstractControl<string>): FormErrors | null;
458
+ declare function validatorSimNumber(nsceEnabled?: boolean): FormValidatorFn<string>;
459
+ declare function validatorSiren(control: AbstractControl<string>): FormErrors | null;
460
+ declare function validatorSiret(omitSiren?: boolean): FormValidatorFn<string>;
461
+ declare function validatorVatNl(control: AbstractControl<string>): FormErrors | null;
462
+ declare function validatorVatFr(control: AbstractControl<string>): FormErrors | null;
463
+ declare function validatorAlphaNumeric(control: AbstractControl<string>): FormErrors | null;
464
+ declare const groupValidatorLegalIdentifierRcs: _angular_forms.ValidatorFn;
465
+ declare const groupValidatorLegalIdentifierVatFr: _angular_forms.ValidatorFn;
466
+
467
+ declare function assertIsFormControl<T>(control: AbstractControl<T>): asserts control is FormControl<T>;
468
+
469
+ declare const INVALID_FORM_KEY = "invalidForm";
470
+ interface Mapper<TModel, TView> {
471
+ readonly modelToView: NoInfer<Into<NonNullable<TModel>, TView>>;
472
+ readonly notifyModel?: (value: NoInfer<TModel>) => void;
473
+ readonly notifyView?: (value: NoInfer<TView>, options?: {
474
+ emitEvent: boolean;
475
+ }) => void;
476
+ readonly viewToModel: NoInfer<Into<TView, TModel>>;
477
+ }
478
+ interface Options {
479
+ injector?: Injector;
480
+ immediate?: boolean;
481
+ }
482
+ /**
483
+ * connect an abstract control to the control value accessor directive
484
+ */
485
+ declare function connectCtrlToCva<TModel>(cva: CvaDirective<TModel>, control: AbstractControl<unknown, TModel>, options?: Options): void;
486
+ declare function connectCtrlToCva<TModel, TCtrl extends AbstractControl>(cva: CvaDirective<TModel>, control: TCtrl, mapper: Mapper<TModel, ControlRawValue<TCtrl>>, options?: Options): void;
487
+
488
+ declare function isFormGroup(value: unknown): value is FormGroup;
489
+ declare function isFormArray(value: unknown): value is FormArray;
490
+
491
+ declare function injectNgControl(options: InjectOptions & {
492
+ optional?: false;
493
+ }): NgControl;
494
+ declare function injectNgControl(options: InjectOptions): NgControl | null;
495
+ /**
496
+ * Ensures that injected NgControl instances expose the Reactive Forms APIs
497
+ * commonly expected by third-party libraries.
498
+ *
499
+ * Standard Reactive Forms controls are returned unchanged.
500
+ * Signal Forms interop controls are wrapped in an adapter providing
501
+ * observable-based APIs such as valueChanges, statusChanges and events.
502
+ */
503
+ declare function patchNgControl(ngControl: NgControl, injector: Injector): NgControl;
504
+
505
+ declare class ReplayControlStatusObservable extends Observable<FormControlStatus> {
506
+ private constructor();
507
+ static of<TCtrl extends AbstractControl>(input: TCtrl): ReplayControlStatusObservable;
508
+ }
509
+
510
+ declare class ReplayControlValueObservable<TCtrl extends AbstractControl> extends Observable<ControlRawValue<TCtrl>> {
511
+ constructor(input: TCtrl);
512
+ static of<TCtrl extends AbstractControl>(input: TCtrl): ReplayControlValueObservable<TCtrl>;
513
+ }
514
+
515
+ export { CvaDirective, DEFAULT_VALIDATOR_MESSAGES, EMPTY_ERROR, GenericFormErrorMessagePipe, INVALID_FORM_KEY, MAX_MASK, MIN_MASK, NSCE_LENGTH, ReplayControlStatusObservable, ReplayControlValueObservable, SIRET_LENGTH, URL_REGEX, VALIDATOR_MESSAGES, assertIsFormControl, connectCtrlToCva, controlSignal, createGroupValidator, customFileTypes, genericFormErrorMessage, getFormErrorMessage, getValidatorMessages, groupValidatorLegalIdentifierRcs, groupValidatorLegalIdentifierVatFr, injectCva, injectNgControl, injectValidatorMessages, isFormArray, isFormGroup, isWriteValueEvent, patchNgControl, provideValidatorMessagesToken, signalValidators_d as signalValidators, toCvaValue, validationError, validatorAlphaNumeric, validatorArcepSlicePrefix, validatorCidrIsNetworkAddress, validatorCompanyType, validatorDataVolumeRange, validatorDateRange, validatorDifferentDate, validatorEmail, validatorEsignatureSignerField, validatorFileType, validatorFrenchPhoneNumber, validatorIpv4WithMask, validatorIpv4WithoutMask, validatorKvk, validatorLength, validatorLengthRange, validatorMax, validatorMaxFileSize, validatorMaxLength, validatorMaxTextLength, validatorMin, validatorMinLength, validatorMinTextLength, validatorMobilePhoneNumber, validatorNafApe, validatorPortabilityPrefix, validatorPortableApnfNumber, validatorRange, validatorRequired, validatorRequiredTrue, validatorRio, validatorSimNumber, validatorSiren, validatorSiret, validatorTextLength, validatorTextLengthRange, validatorUnique, validatorUrl, validatorVatFr, validatorVatNl, validators };
516
+ export type { AsFormControl, AsNullableFormControl, AuthorizedMask, ControlRawValue, CreateGroupValidatorOptions, FileType, FormArrayValue, FormAsyncValidatorFn, FormError, FormErrors, FormGroupValue, FormValidatorFn, ObjectFormError, ValidatorMessages };