@alextheman/utility 5.13.0 → 5.14.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import z$1, { ZodError, ZodType, z } from "zod";
1
+ import z$1, { ZodCoercedDate, ZodCoercedNumber, ZodError, ZodType, z } from "zod";
2
2
  import { DotenvParseOutput } from "dotenv";
3
3
 
4
4
  //#region src/root/constants/FILE_PATH_REGEX.d.ts
@@ -16,6 +16,74 @@ declare const UUID_REGEX: RegExp;
16
16
  declare const VERSION_NUMBER_PATTERN: string;
17
17
  declare const VERSION_NUMBER_REGEX: RegExp;
18
18
  //#endregion
19
+ //#region src/root/deprecated/DataError.d.ts
20
+ interface ExpectErrorOptions$2 {
21
+ expectedCode?: string;
22
+ }
23
+ /**
24
+ * Represents errors you may get that may've been caused by a specific piece of data.
25
+ *
26
+ * @category Types
27
+ *
28
+ * @deprecated Please use `DataError` from `@alextheman/utility/v6` instead.
29
+ *
30
+ * @template DataType - The type of the data that caused the error.
31
+ */
32
+ declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> extends Error {
33
+ code: string;
34
+ data: DataType;
35
+ /**
36
+ * @param data - The data that caused the error.
37
+ * @param code - A standardised code (e.g. UNEXPECTED_DATA).
38
+ * @param message - A human-readable error message (e.g. The data provided is invalid).
39
+ * @param options - Extra options to pass to super Error constructor.
40
+ */
41
+ constructor(data: DataType, code?: string, message?: string, options?: ErrorOptions);
42
+ private static checkCaughtError;
43
+ /**
44
+ * Checks whether the given input may have been caused by a DataError.
45
+ *
46
+ * @param input - The input to check.
47
+ *
48
+ * @returns `true` if the input is a DataError, and `false` otherwise. The type of the input will also be narrowed down to DataError if `true`.
49
+ */
50
+ static check<DataType extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>>(input: unknown): input is DataError<DataType>;
51
+ /**
52
+ * Gets the thrown `DataError` from a given function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
53
+ *
54
+ * @param errorFunction - The function expected to throw the error.
55
+ * @param options - Extra options to apply.
56
+ *
57
+ * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `DataError`.
58
+ * @throws {Error} If no `DataError` was thrown by the `errorFunction`
59
+ *
60
+ * @returns The `DataError` that was thrown by the `errorFunction`
61
+ */
62
+ static expectError(errorFunction: () => unknown, options?: ExpectErrorOptions$2): DataError;
63
+ /**
64
+ * Gets the thrown `DataError` from a given asynchronous function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
65
+ *
66
+ * @param errorFunction - The function expected to throw the error.
67
+ * @param options - Extra options to apply.
68
+ *
69
+ * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `DataError`.
70
+ * @throws {Error} If no `DataError` was thrown by the `errorFunction`
71
+ *
72
+ * @returns The `DataError` that was thrown by the `errorFunction`
73
+ */
74
+ static expectErrorAsync(errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions$2): Promise<DataError>;
75
+ }
76
+ //#endregion
77
+ //#region src/root/deprecated/RecordKey.d.ts
78
+ /**
79
+ * Represents the native Record's possible key type.
80
+ *
81
+ * @category Types
82
+ *
83
+ * @deprecated Please use the native `PropertyKey` type instead.
84
+ */
85
+ type RecordKey = string | number | symbol;
86
+ //#endregion
19
87
  //#region src/root/functions/arrayHelpers/fillArray.d.ts
20
88
  /**
21
89
  * Creates a new array where each element is the resolved result of the provided asynchronous callback.
@@ -738,159 +806,6 @@ type VersionType = CreateEnumType<typeof VersionType>;
738
806
  */
739
807
  declare function parseVersionType(input: unknown): VersionType;
740
808
  //#endregion
741
- //#region src/v6/CodeError.d.ts
742
- interface ExpectErrorOptions$2<ErrorCode extends string = string> {
743
- expectedCode?: ErrorCode;
744
- }
745
- /**
746
- * Represents errors that can be described using a standardised error code, and a human-readable error message.
747
- *
748
- * @category Types
749
- *
750
- * @template ErrorCode The type of the standardised error code.
751
- */
752
- declare class CodeError<ErrorCode extends string = string> extends Error {
753
- code: ErrorCode;
754
- /**
755
- * @param code - A standardised code (e.g. UNEXPECTED_DATA).
756
- * @param message - A human-readable error message (e.g. The data provided is invalid).
757
- * @param options - Extra options to pass to super Error constructor.
758
- */
759
- constructor(code: ErrorCode, message?: string, options?: ErrorOptions);
760
- /**
761
- * Checks whether the given input may have been caused by a CodeError.
762
- *
763
- * @param input - The input to check.
764
- *
765
- * @returns `true` if the input is a CodeError, and `false` otherwise. The type of the input will also be narrowed down to CodeError if `true`.
766
- */
767
- static check(input: unknown): input is CodeError<string>;
768
- protected static checkCaughtError<ErrorCode extends string = string>(this: typeof CodeError, error: unknown, options?: ExpectErrorOptions$2<ErrorCode>): CodeError;
769
- /**
770
- * Gets the thrown `CodeError` from a given function if one was thrown, and re-throws any other errors, or throws a default `CodeError` if no error thrown.
771
- *
772
- * @param errorFunction - The function expected to throw the error.
773
- * @param options - Extra options to apply.
774
- *
775
- * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `CodeError`.
776
- * @throws {Error} If no `CodeError` was thrown by the `errorFunction`
777
- *
778
- * @returns The `CodeError` that was thrown by the `errorFunction`
779
- */
780
- static expectError<ErrorCode extends string = string>(this: typeof CodeError, errorFunction: () => unknown, options?: ExpectErrorOptions$2<ErrorCode>): CodeError;
781
- /**
782
- * Gets the thrown `CodeError` from a given asynchronous function if one was thrown, and re-throws any other errors, or throws a default `CodeError` if no error thrown.
783
- *
784
- * @param errorFunction - The function expected to throw the error.
785
- * @param options - Extra options to apply.
786
- *
787
- * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `CodeError`.
788
- * @throws {Error} If no `CodeError` was thrown by the `errorFunction`
789
- *
790
- * @returns The `CodeError` that was thrown by the `errorFunction`
791
- */
792
- static expectErrorAsync<ErrorCode extends string = string>(this: typeof CodeError, errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions$2<ErrorCode>): Promise<CodeError>;
793
- }
794
- //#endregion
795
- //#region src/v6/DataError.d.ts
796
- type DefaultDataErrorCode = "INVALID_DATA";
797
- interface ExpectErrorOptions$1<ErrorCode extends string = DefaultDataErrorCode> {
798
- expectedCode?: ErrorCode | DefaultDataErrorCode;
799
- }
800
- declare const DataErrorCode: {
801
- readonly INVALID_DATA: "INVALID_DATA";
802
- };
803
- type DataErrorCode = CreateEnumType<typeof DataErrorCode>;
804
- /**
805
- * Represents errors you may get that may've been caused by a specific piece of data.
806
- *
807
- * @category Types
808
- *
809
- * @template DataType - The type of the data that caused the error.
810
- */
811
- declare class DataError$1<DataType extends object = Record<PropertyKey, unknown>, ErrorCode extends string = DataErrorCode> extends CodeError<ErrorCode | DataErrorCode> {
812
- data: DataType;
813
- /**
814
- * @param data - The data that caused the error.
815
- * @param code - A standardised code (e.g. UNEXPECTED_DATA).
816
- * @param message - A human-readable error message (e.g. The data provided is invalid).
817
- * @param options - Extra options to pass to super Error constructor.
818
- */
819
- constructor(data: DataType, code?: ErrorCode | DefaultDataErrorCode, message?: string, options?: ErrorOptions);
820
- /**
821
- * Checks whether the given input may have been caused by a DataError.
822
- *
823
- * @param input - The input to check.
824
- *
825
- * @returns `true` if the input is a DataError, and `false` otherwise. The type of the input will also be narrowed down to DataError if `true`.
826
- */
827
- static check<DataType extends object = Record<PropertyKey, unknown>, ErrorCode extends string = DataErrorCode>(input: unknown): input is DataError$1<DataType, ErrorCode>;
828
- /**
829
- * Gets the thrown `DataError` from a given function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
830
- *
831
- * @param errorFunction - The function expected to throw the error.
832
- * @param options - Extra options to apply.
833
- *
834
- * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `DataError`.
835
- * @throws {Error} If no `DataError` was thrown by the `errorFunction`
836
- *
837
- * @returns The `DataError` that was thrown by the `errorFunction`
838
- */
839
- static expectError<DataType extends Record<PropertyKey, unknown>, ErrorCode extends string = DefaultDataErrorCode>(errorFunction: () => unknown, options?: ExpectErrorOptions$1<ErrorCode>): DataError$1<DataType, ErrorCode>;
840
- /**
841
- * Gets the thrown `DataError` from a given asynchronous function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
842
- *
843
- * @param errorFunction - The function expected to throw the error.
844
- * @param options - Extra options to apply.
845
- *
846
- * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `DataError`.
847
- * @throws {Error} If no `DataError` was thrown by the `errorFunction`
848
- *
849
- * @returns The `DataError` that was thrown by the `errorFunction`
850
- */
851
- static expectErrorAsync<DataType extends Record<PropertyKey, unknown>, ErrorCode extends string = DefaultDataErrorCode>(errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions$1<ErrorCode>): Promise<DataError$1<DataType, ErrorCode>>;
852
- }
853
- //#endregion
854
- //#region src/root/functions/parsers/zod/parseZodSchema.d.ts
855
- /**
856
- * An alternative function to zodSchema.parse() that can be used to strictly parse Zod schemas.
857
- *
858
- * NOTE: Use `parseZodSchemaAsync` if your schema includes an asynchronous function.
859
- *
860
- * @category Parsers
861
- *
862
- * @template SchemaType - The Zod schema type.
863
- * @template ErrorType - The type of error to throw on invalid data.
864
- *
865
- * @param schema - The Zod schema to use in parsing.
866
- * @param input - The data to parse.
867
- * @param onError - A custom error to throw on invalid data (defaults to `DataError`). May either be the error itself, or a function that returns the error or nothing. If nothing is returned, the default error is thrown instead.
868
- *
869
- * @throws {DataErrorCode} If the given data cannot be parsed according to the schema.
870
- *
871
- * @returns The parsed data from the Zod schema.
872
- */
873
- declare function parseZodSchema<SchemaType extends ZodType, ErrorType extends Error = DataError$1>(schema: SchemaType, input: unknown, onError?: ErrorType | ((zodError: ZodError) => ErrorType | void)): z.infer<SchemaType>;
874
- //#endregion
875
- //#region src/root/functions/parsers/zod/parseZodSchemaAsync.d.ts
876
- /**
877
- * An alternative function to zodSchema.parseAsync() that can be used to strictly parse asynchronous Zod schemas.
878
- *
879
- * @category Parsers
880
- *
881
- * @template SchemaType - The Zod schema type.
882
- * @template ErrorType - The type of error to throw on invalid data.
883
- *
884
- * @param schema - The Zod schema to use in parsing.
885
- * @param input - The data to parse.
886
- * @param onError - A custom error to throw on invalid data (defaults to `DataError`). May either be the error itself, or a function that returns the error or nothing. If nothing is returned, the default error is thrown instead.
887
- *
888
- * @throws {DataError} If the given data cannot be parsed according to the schema.
889
- *
890
- * @returns The parsed data from the Zod schema.
891
- */
892
- declare function parseZodSchemaAsync<SchemaType extends ZodType, ErrorType extends Error = DataError$1>(schema: SchemaType, input: unknown, onError?: ErrorType | ((zodError: ZodError) => ErrorType | void)): Promise<z.infer<SchemaType>>;
893
- //#endregion
894
809
  //#region src/root/functions/recursive/deepCopy.d.ts
895
810
  /**
896
811
  * Deeply copies an object or array such that all child objects/arrays are also copied.
@@ -1196,21 +1111,77 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
1196
1111
  */
1197
1112
  declare const normalizeIndents: typeof normaliseIndents;
1198
1113
  //#endregion
1199
- //#region src/root/deprecated/DataError.d.ts
1200
- interface ExpectErrorOptions {
1201
- expectedCode?: string;
1114
+ //#region src/v6/CodeError.d.ts
1115
+ interface ExpectErrorOptions$1<ErrorCode extends string = string> {
1116
+ expectedCode?: ErrorCode;
1202
1117
  }
1203
1118
  /**
1204
- * Represents errors you may get that may've been caused by a specific piece of data.
1119
+ * Represents errors that can be described using a standardised error code, and a human-readable error message.
1205
1120
  *
1206
1121
  * @category Types
1207
1122
  *
1208
- * @deprecated Please use `DataError` from `@alextheman/utility/v6` instead.
1123
+ * @template ErrorCode The type of the standardised error code.
1124
+ */
1125
+ declare class CodeError<ErrorCode extends string = string> extends Error {
1126
+ code: ErrorCode;
1127
+ /**
1128
+ * @param code - A standardised code (e.g. UNEXPECTED_DATA).
1129
+ * @param message - A human-readable error message (e.g. The data provided is invalid).
1130
+ * @param options - Extra options to pass to super Error constructor.
1131
+ */
1132
+ constructor(code: ErrorCode, message?: string, options?: ErrorOptions);
1133
+ /**
1134
+ * Checks whether the given input may have been caused by a CodeError.
1135
+ *
1136
+ * @param input - The input to check.
1137
+ *
1138
+ * @returns `true` if the input is a CodeError, and `false` otherwise. The type of the input will also be narrowed down to CodeError if `true`.
1139
+ */
1140
+ static check(input: unknown): input is CodeError<string>;
1141
+ protected static checkCaughtError<ErrorCode extends string = string>(this: typeof CodeError, error: unknown, options?: ExpectErrorOptions$1<ErrorCode>): CodeError;
1142
+ /**
1143
+ * Gets the thrown `CodeError` from a given function if one was thrown, and re-throws any other errors, or throws a default `CodeError` if no error thrown.
1144
+ *
1145
+ * @param errorFunction - The function expected to throw the error.
1146
+ * @param options - Extra options to apply.
1147
+ *
1148
+ * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `CodeError`.
1149
+ * @throws {Error} If no `CodeError` was thrown by the `errorFunction`
1150
+ *
1151
+ * @returns The `CodeError` that was thrown by the `errorFunction`
1152
+ */
1153
+ static expectError<ErrorCode extends string = string>(this: typeof CodeError, errorFunction: () => unknown, options?: ExpectErrorOptions$1<ErrorCode>): CodeError;
1154
+ /**
1155
+ * Gets the thrown `CodeError` from a given asynchronous function if one was thrown, and re-throws any other errors, or throws a default `CodeError` if no error thrown.
1156
+ *
1157
+ * @param errorFunction - The function expected to throw the error.
1158
+ * @param options - Extra options to apply.
1159
+ *
1160
+ * @throws {Error} Any other errors thrown by the `errorFunction` that are not a `CodeError`.
1161
+ * @throws {Error} If no `CodeError` was thrown by the `errorFunction`
1162
+ *
1163
+ * @returns The `CodeError` that was thrown by the `errorFunction`
1164
+ */
1165
+ static expectErrorAsync<ErrorCode extends string = string>(this: typeof CodeError, errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions$1<ErrorCode>): Promise<CodeError>;
1166
+ }
1167
+ //#endregion
1168
+ //#region src/v6/DataError.d.ts
1169
+ type DefaultDataErrorCode = "INVALID_DATA";
1170
+ interface ExpectErrorOptions<ErrorCode extends string = DefaultDataErrorCode> {
1171
+ expectedCode?: ErrorCode | DefaultDataErrorCode;
1172
+ }
1173
+ declare const DataErrorCode: {
1174
+ readonly INVALID_DATA: "INVALID_DATA";
1175
+ };
1176
+ type DataErrorCode = CreateEnumType<typeof DataErrorCode>;
1177
+ /**
1178
+ * Represents errors you may get that may've been caused by a specific piece of data.
1179
+ *
1180
+ * @category Types
1209
1181
  *
1210
1182
  * @template DataType - The type of the data that caused the error.
1211
1183
  */
1212
- declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> extends Error {
1213
- code: string;
1184
+ declare class DataError$1<DataType extends object = Record<PropertyKey, unknown>, ErrorCode extends string = DataErrorCode> extends CodeError<ErrorCode | DataErrorCode> {
1214
1185
  data: DataType;
1215
1186
  /**
1216
1187
  * @param data - The data that caused the error.
@@ -1218,8 +1189,7 @@ declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<P
1218
1189
  * @param message - A human-readable error message (e.g. The data provided is invalid).
1219
1190
  * @param options - Extra options to pass to super Error constructor.
1220
1191
  */
1221
- constructor(data: DataType, code?: string, message?: string, options?: ErrorOptions);
1222
- private static checkCaughtError;
1192
+ constructor(data: DataType, code?: ErrorCode | DefaultDataErrorCode, message?: string, options?: ErrorOptions);
1223
1193
  /**
1224
1194
  * Checks whether the given input may have been caused by a DataError.
1225
1195
  *
@@ -1227,7 +1197,7 @@ declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<P
1227
1197
  *
1228
1198
  * @returns `true` if the input is a DataError, and `false` otherwise. The type of the input will also be narrowed down to DataError if `true`.
1229
1199
  */
1230
- static check<DataType extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>>(input: unknown): input is DataError<DataType>;
1200
+ static check<DataType extends object = Record<PropertyKey, unknown>, ErrorCode extends string = DataErrorCode>(input: unknown): input is DataError$1<DataType, ErrorCode>;
1231
1201
  /**
1232
1202
  * Gets the thrown `DataError` from a given function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
1233
1203
  *
@@ -1239,7 +1209,7 @@ declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<P
1239
1209
  *
1240
1210
  * @returns The `DataError` that was thrown by the `errorFunction`
1241
1211
  */
1242
- static expectError(errorFunction: () => unknown, options?: ExpectErrorOptions): DataError;
1212
+ static expectError<DataType extends Record<PropertyKey, unknown>, ErrorCode extends string = DefaultDataErrorCode>(errorFunction: () => unknown, options?: ExpectErrorOptions<ErrorCode>): DataError$1<DataType, ErrorCode>;
1243
1213
  /**
1244
1214
  * Gets the thrown `DataError` from a given asynchronous function if one was thrown, and re-throws any other errors, or throws a default `DataError` if no error thrown.
1245
1215
  *
@@ -1251,17 +1221,66 @@ declare class DataError<DataType extends Record<PropertyKey, unknown> = Record<P
1251
1221
  *
1252
1222
  * @returns The `DataError` that was thrown by the `errorFunction`
1253
1223
  */
1254
- static expectErrorAsync(errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions): Promise<DataError>;
1224
+ static expectErrorAsync<DataType extends Record<PropertyKey, unknown>, ErrorCode extends string = DefaultDataErrorCode>(errorFunction: () => Promise<unknown>, options?: ExpectErrorOptions<ErrorCode>): Promise<DataError$1<DataType, ErrorCode>>;
1255
1225
  }
1256
1226
  //#endregion
1257
- //#region src/root/deprecated/RecordKey.d.ts
1227
+ //#region src/root/zod/parseZodSchema.d.ts
1258
1228
  /**
1259
- * Represents the native Record's possible key type.
1229
+ * An alternative function to zodSchema.parse() that can be used to strictly parse Zod schemas.
1260
1230
  *
1261
- * @category Types
1231
+ * NOTE: Use `parseZodSchemaAsync` if your schema includes an asynchronous function.
1262
1232
  *
1263
- * @deprecated Please use the native `PropertyKey` type instead.
1233
+ * @category Parsers
1234
+ *
1235
+ * @deprecated Please use `az.with(schema).parse(input)` instead.
1236
+ *
1237
+ * @template SchemaType - The Zod schema type.
1238
+ * @template ErrorType - The type of error to throw on invalid data.
1239
+ *
1240
+ * @param schema - The Zod schema to use in parsing.
1241
+ * @param input - The data to parse.
1242
+ * @param onError - A custom error to throw on invalid data (defaults to `DataError`). May either be the error itself, or a function that returns the error or nothing. If nothing is returned, the default error is thrown instead.
1243
+ *
1244
+ * @throws {DataErrorCode} If the given data cannot be parsed according to the schema.
1245
+ *
1246
+ * @returns The parsed data from the Zod schema.
1264
1247
  */
1265
- type RecordKey = string | number | symbol;
1248
+ declare function parseZodSchema<SchemaType extends ZodType, ErrorType extends Error = DataError$1>(schema: SchemaType, input: unknown, onError?: ErrorType | ((zodError: ZodError) => ErrorType | void)): z.infer<SchemaType>;
1249
+ //#endregion
1250
+ //#region src/root/zod/parseZodSchemaAsync.d.ts
1251
+ /**
1252
+ * An alternative function to zodSchema.parseAsync() that can be used to strictly parse asynchronous Zod schemas.
1253
+ *
1254
+ * @category Parsers
1255
+ *
1256
+ * @deprecated Please use `az.with(schema).parseAsync(input)` instead.
1257
+ *
1258
+ * @template SchemaType - The Zod schema type.
1259
+ * @template ErrorType - The type of error to throw on invalid data.
1260
+ *
1261
+ * @param schema - The Zod schema to use in parsing.
1262
+ * @param input - The data to parse.
1263
+ * @param onError - A custom error to throw on invalid data (defaults to `DataError`). May either be the error itself, or a function that returns the error or nothing. If nothing is returned, the default error is thrown instead.
1264
+ *
1265
+ * @throws {DataError} If the given data cannot be parsed according to the schema.
1266
+ *
1267
+ * @returns The parsed data from the Zod schema.
1268
+ */
1269
+ declare function parseZodSchemaAsync<SchemaType extends ZodType, ErrorType extends Error = DataError$1>(schema: SchemaType, input: unknown, onError?: ErrorType | ((zodError: ZodError) => ErrorType | void)): Promise<z.infer<SchemaType>>;
1270
+ //#endregion
1271
+ //#region src/root/zod/zodFieldWrapper.d.ts
1272
+ declare function zodFieldWrapper<SchemaType extends ZodType<unknown, string | null>>(schema: SchemaType): ZodType<z$1.infer<SchemaType>, string>;
1273
+ //#endregion
1274
+ //#region src/root/zod/az.d.ts
1275
+ declare const az: {
1276
+ field: typeof zodFieldWrapper;
1277
+ fieldNumber: () => ZodCoercedNumber<string | null>;
1278
+ versionNumber: () => ZodType<VersionNumber, unknown>;
1279
+ fieldDate: () => ZodCoercedDate<string | null>;
1280
+ with: <SchemaType extends ZodType>(schema: SchemaType) => {
1281
+ parse: <ErrorType extends Error = DataError$1<Record<PropertyKey, unknown>, "INVALID_DATA">>(input: unknown, error?: ErrorType | ((zodError: z$1.ZodError<unknown>) => void | ErrorType)) => ReturnType<typeof parseZodSchema<SchemaType, ErrorType>>;
1282
+ parseAsync: <ErrorType extends Error = DataError$1<Record<PropertyKey, unknown>, "INVALID_DATA">>(input: unknown, error?: ErrorType | ((zodError: z$1.ZodError<unknown>) => void | ErrorType)) => ReturnType<typeof parseZodSchemaAsync<SchemaType, ErrorType>>;
1283
+ };
1284
+ };
1266
1285
  //#endregion
1267
- export { APIError, type ArrayElement, type CallReturnType, CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, KebabToCamelOptions, type NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, type NullableOnCondition, ONE_DAY_IN_MILLISECONDS, type OptionalOnCondition, ParallelTuple, RecordKey, RemoveUndefined, type StringListToArrayOptions, ToTitleCaseOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, type FormatOptionsBase as VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, calculateMonthlyDifference, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, escapeRegexPattern, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseUUID, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, toTitleCase, truncate, wait, zodVersionNumber };
1286
+ export { APIError, type ArrayElement, type CallReturnType, CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, KebabToCamelOptions, type NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, type NullableOnCondition, ONE_DAY_IN_MILLISECONDS, type OptionalOnCondition, ParallelTuple, RecordKey, RemoveUndefined, type StringListToArrayOptions, ToTitleCaseOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, type FormatOptionsBase as VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, az, calculateMonthlyDifference, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, escapeRegexPattern, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseUUID, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, toTitleCase, truncate, wait, zodVersionNumber };