@arkenv/standard 1.0.0-alpha.3 → 1.0.0-alpha.5

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.cts CHANGED
@@ -830,11 +830,11 @@ declare const ExactLength$1: {
830
830
  //#region ../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/standardSchema.d.ts
831
831
  /** From https://github.com/standard-schema/standard-schema */
832
832
  /** The Standard Typed interface. This is a base type extended by other specs. */
833
- interface StandardTypedV1$2<Input = unknown, Output = Input> {
833
+ interface StandardTypedV1$3<Input = unknown, Output = Input> {
834
834
  /** The Standard properties. */
835
- readonly "~standard": StandardTypedV1$2.Props<Input, Output>;
835
+ readonly "~standard": StandardTypedV1$3.Props<Input, Output>;
836
836
  }
837
- declare namespace StandardTypedV1$2 {
837
+ declare namespace StandardTypedV1$3 {
838
838
  /** The Standard Typed properties interface. */
839
839
  interface Props<Input = unknown, Output = Input> {
840
840
  /** The version number of the standard. */
@@ -852,20 +852,20 @@ declare namespace StandardTypedV1$2 {
852
852
  readonly output: Output;
853
853
  }
854
854
  /** Infers the input type of a Standard Typed. */
855
- type InferInput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["input"];
855
+ type InferInput<Schema extends StandardTypedV1$3> = NonNullable<Schema["~standard"]["types"]>["input"];
856
856
  /** Infers the output type of a Standard Typed. */
857
- type InferOutput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["output"];
857
+ type InferOutput<Schema extends StandardTypedV1$3> = NonNullable<Schema["~standard"]["types"]>["output"];
858
858
  }
859
859
  /** The Standard Schema interface. */
860
- interface StandardSchemaV1$2<Input = unknown, Output = Input> {
860
+ interface StandardSchemaV1$3<Input = unknown, Output = Input> {
861
861
  /** The Standard Schema properties. */
862
- readonly "~standard": StandardSchemaV1$2.Props<Input, Output>;
862
+ readonly "~standard": StandardSchemaV1$3.Props<Input, Output>;
863
863
  }
864
- declare namespace StandardSchemaV1$2 {
864
+ declare namespace StandardSchemaV1$3 {
865
865
  /** The Standard Schema properties interface. */
866
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1$2.Props<Input, Output> {
866
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$3.Props<Input, Output> {
867
867
  /** Validates unknown input values. */
868
- readonly validate: (value: unknown, options?: StandardSchemaV1$2.Options | undefined) => Result<Output> | Promise<Result<Output>>;
868
+ readonly validate: (value: unknown, options?: StandardSchemaV1$3.Options | undefined) => Result<Output> | Promise<Result<Output>>;
869
869
  }
870
870
  /** The result interface of the validate function. */
871
871
  type Result<Output> = SuccessResult<Output> | FailureResult;
@@ -898,11 +898,11 @@ declare namespace StandardSchemaV1$2 {
898
898
  readonly key: PropertyKey;
899
899
  }
900
900
  /** The Standard types interface. */
901
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1$2.Types<Input, Output> {}
901
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$3.Types<Input, Output> {}
902
902
  /** Infers the input type of a Standard. */
903
- type InferInput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferInput<Schema>;
903
+ type InferInput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferInput<Schema>;
904
904
  /** Infers the output type of a Standard. */
905
- type InferOutput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferOutput<Schema>;
905
+ type InferOutput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferOutput<Schema>;
906
906
  /** ArkType-specific properties that extend the standard schema with JSON Schema support. */
907
907
  interface ArkTypeProps<Input = unknown, Output = Input> extends Props<Input, Output>, StandardJSONSchemaV1$1.Props<Input, Output> {
908
908
  vendor: "arktype";
@@ -915,7 +915,7 @@ interface StandardJSONSchemaV1$1<Input = unknown, Output = Input> {
915
915
  }
916
916
  declare namespace StandardJSONSchemaV1$1 {
917
917
  /** The Standard JSON Schema properties interface. */
918
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1$2.Props<Input, Output> {
918
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$3.Props<Input, Output> {
919
919
  /** Methods for generating the input/output JSON Schema. */
920
920
  readonly jsonSchema: StandardJSONSchemaV1$1.Converter;
921
921
  }
@@ -942,11 +942,11 @@ declare namespace StandardJSONSchemaV1$1 {
942
942
  readonly libraryOptions?: Record<string, unknown> | undefined;
943
943
  }
944
944
  /** The Standard types interface. */
945
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1$2.Types<Input, Output> {}
945
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$3.Types<Input, Output> {}
946
946
  /** Infers the input type of a Standard. */
947
- type InferInput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferInput<Schema>;
947
+ type InferInput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferInput<Schema>;
948
948
  /** Infers the output type of a Standard. */
949
- type InferOutput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferOutput<Schema>;
949
+ type InferOutput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferOutput<Schema>;
950
950
  }
951
951
  //#endregion
952
952
  //#region ../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts
@@ -1164,7 +1164,7 @@ declare namespace ArkErrors$1 {
1164
1164
  * Subsequent errors added at an existing path are merged into an
1165
1165
  * ArkError intersection.
1166
1166
  */
1167
- declare class ArkErrors$1 extends ReadonlyArray$2<ArkError$1> implements StandardSchemaV1$2.FailureResult {
1167
+ declare class ArkErrors$1 extends ReadonlyArray$2<ArkError$1> implements StandardSchemaV1$3.FailureResult {
1168
1168
  readonly [arkKind$1] = "errors";
1169
1169
  protected ctx: Traversal$1;
1170
1170
  constructor(ctx: Traversal$1);
@@ -2002,14 +2002,14 @@ type DiscriminantKind$1 = show$1<keyof DiscriminantKinds$1>;
2002
2002
  interface InternalRootDeclaration$1 extends BaseNodeDeclaration$1 {
2003
2003
  kind: RootKind$1;
2004
2004
  }
2005
- declare abstract class BaseRoot$1< /** @ts-ignore cast variance */out d extends InternalRootDeclaration$1 = InternalRootDeclaration$1> extends BaseNode$1<d> implements StandardSchemaV1$2, StandardJSONSchemaV1$1 {
2005
+ declare abstract class BaseRoot$1< /** @ts-ignore cast variance */out d extends InternalRootDeclaration$1 = InternalRootDeclaration$1> extends BaseNode$1<d> implements StandardSchemaV1$3, StandardJSONSchemaV1$1 {
2006
2006
  readonly [arkKind$1]: "root";
2007
2007
  readonly [inferred$1]: unknown;
2008
2008
  constructor(attachments: UnknownAttachments$1, $: BaseScope$1);
2009
2009
  get rawIn(): BaseRoot$1;
2010
2010
  get rawOut(): BaseRoot$1;
2011
2011
  get internal(): this;
2012
- get "~standard"(): StandardSchemaV1$2.ArkTypeProps;
2012
+ get "~standard"(): StandardSchemaV1$3.ArkTypeProps;
2013
2013
  as(): this;
2014
2014
  brand(name: string): this;
2015
2015
  readonly(): this;
@@ -4859,7 +4859,7 @@ interface Type$8<out t = unknown, $ = {}> extends Callable$1<(data: unknown) =>
4859
4859
  */
4860
4860
  distribute<mapOut, reduceOut = mapOut[]>(mapBranch: (branch: Type$8, i: number, branches: array$1<Type$8>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;
4861
4861
  /** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */
4862
- "~standard": StandardSchemaV1$2.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
4862
+ "~standard": StandardSchemaV1$3.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
4863
4863
  /** @deprecated */
4864
4864
  apply: Function["apply"];
4865
4865
  /** @deprecated */
@@ -5330,13 +5330,13 @@ type parseGenericScopeKey$1<name extends string, params extends string, def> = {
5330
5330
  type InnerParseResult$1 = BaseRoot$1 | ParsedOptionalProperty$1 | ParsedDefaultableProperty$1;
5331
5331
  //#endregion
5332
5332
  //#region ../../node_modules/.pnpm/arktype@2.2.0/node_modules/arktype/out/parser/definition.d.ts
5333
- type inferDefinition$1<def, $, args> = [def] extends [anyOrNever$1] ? def : def extends type$1.cast<infer t> ? ifEmptyObjectLiteral$1<def, object, t> : def extends ThunkCast$1<infer t> ? t : def extends string ? inferString$1<def, $, args> : def extends array$1 ? inferTuple$1<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$2 ? inferStandardSchema$1<def> : def extends object ? inferObjectLiteral$1<def, $, args> : never;
5334
- type inferStandardSchema$1<schema extends StandardSchemaV1$2, i = StandardSchemaV1$2.InferInput<schema>, o = StandardSchemaV1$2.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out$1<o>;
5333
+ type inferDefinition$1<def, $, args> = [def] extends [anyOrNever$1] ? def : def extends type$1.cast<infer t> ? ifEmptyObjectLiteral$1<def, object, t> : def extends ThunkCast$1<infer t> ? t : def extends string ? inferString$1<def, $, args> : def extends array$1 ? inferTuple$1<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$3 ? inferStandardSchema$1<def> : def extends object ? inferObjectLiteral$1<def, $, args> : never;
5334
+ type inferStandardSchema$1<schema extends StandardSchemaV1$3, i = StandardSchemaV1$3.InferInput<schema>, o = StandardSchemaV1$3.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out$1<o>;
5335
5335
  type validateDefinition$1<def, $, args> = null extends undefined ? ErrorMessage$1<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever$1] ? def : def extends OptionalPropertyDefinition$1 ? ErrorMessage$1<shallowOptionalMessage$1> : isDefaultable$1<def, $, args> extends true ? ErrorMessage$1<shallowDefaultableMessage$1> : validateInnerDefinition$1<def, $, args>;
5336
5336
  type validateInnerDefinition$1<def, $, args> = [def] extends [TerminalObjectDefinition$1] ? def : def extends string ? validateString$1<def, $, args> : unknown extends def ? BaseCompletions$1<$, args> | {} : def extends readonly unknown[] ? validateTuple$1<def, $, args> : def extends BadDefinitionType$1 ? ErrorMessage$1<writeBadDefinitionTypeMessage$1<objectKindOrDomainOf$1<def>>> : validateObjectLiteral$1<def, $, args>;
5337
5337
  type validateTuple$1<def extends array$1, $, args> = maybeValidateTupleExpression$1<def, $, args> extends infer result ? result extends null ? validateTupleLiteral$1<def, $, args> : result : never;
5338
5338
  type inferTuple$1<def extends array$1, $, args> = def extends TupleExpression$1 ? inferTupleExpression$1<def, $, args> : inferTupleLiteral$1<def, $, args>;
5339
- type TerminalObjectDefinition$1 = type$1.cast<unknown> | Fn$1 | RegExp | StandardSchemaV1$2;
5339
+ type TerminalObjectDefinition$1 = type$1.cast<unknown> | Fn$1 | RegExp | StandardSchemaV1$3;
5340
5340
  type ThunkCast$1<t = unknown> = () => type$1.cast<t>;
5341
5341
  type BadDefinitionType$1 = Exclude<Primitive$1, string>;
5342
5342
  declare const writeBadDefinitionTypeMessage$1: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage$1<actual>;
@@ -6064,85 +6064,144 @@ l & r : r extends array$1 ? l & r : keyof l & keyof r extends never ? show$1<l &
6064
6064
  * Copied from standard-schema (MIT License)
6065
6065
  * Copyright (c) 2024 Colin McDannell
6066
6066
  */
6067
- /** The Standard Typed interface. This is a base type extended by other specs. */
6068
- interface StandardTypedV1$1<Input = unknown, Output = Input> {
6069
- /** The Standard properties. */
6070
- readonly "~standard": StandardTypedV1$1.Props<Input, Output>;
6067
+ /**
6068
+ * The Standard Typed interface. This is a base type extended by other specs.
6069
+ */
6070
+ interface StandardTypedV1$2<Input = unknown, Output = Input> {
6071
+ /**
6072
+ * The Standard properties.
6073
+ */
6074
+ readonly "~standard": StandardTypedV1$2.Props<Input, Output>;
6071
6075
  }
6072
- declare namespace StandardTypedV1$1 {
6073
- /** The Standard Typed properties interface. */
6076
+ declare namespace StandardTypedV1$2 {
6077
+ /**
6078
+ * The Standard Typed properties interface.
6079
+ */
6074
6080
  interface Props<Input = unknown, Output = Input> {
6075
- /** The version number of the standard. */
6081
+ /**
6082
+ * The version number of the standard.
6083
+ */
6076
6084
  readonly version: 1;
6077
- /** The vendor name of the schema library. */
6085
+ /**
6086
+ * The vendor name of the schema library.
6087
+ */
6078
6088
  readonly vendor: string;
6079
- /** Inferred types associated with the schema. */
6089
+ /**
6090
+ * Inferred types associated with the schema.
6091
+ */
6080
6092
  readonly types?: Types<Input, Output> | undefined;
6081
6093
  }
6082
- /** The Standard Typed types interface. */
6094
+ /**
6095
+ * The Standard Typed types interface.
6096
+ */
6083
6097
  interface Types<Input = unknown, Output = Input> {
6084
- /** The input type of the schema. */
6098
+ /**
6099
+ * The input type of the schema.
6100
+ */
6085
6101
  readonly input: Input;
6086
- /** The output type of the schema. */
6102
+ /**
6103
+ * The output type of the schema.
6104
+ */
6087
6105
  readonly output: Output;
6088
6106
  }
6089
- /** Infers the input type of a Standard Typed. */
6090
- type InferInput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
6091
- /** Infers the output type of a Standard Typed. */
6092
- type InferOutput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
6107
+ /**
6108
+ * Infers the input type of a Standard Typed.
6109
+ */
6110
+ type InferInput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["input"];
6111
+ /**
6112
+ * Infers the output type of a Standard Typed.
6113
+ */
6114
+ type InferOutput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["output"];
6093
6115
  }
6094
- /** The Standard Schema interface. */
6095
- interface StandardSchemaV1$1<Input = unknown, Output = Input> {
6096
- /** The Standard Schema properties. */
6097
- readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
6116
+ /**
6117
+ * The Standard Schema interface.
6118
+ */
6119
+ interface StandardSchemaV1$2<Input = unknown, Output = Input> {
6120
+ /**
6121
+ * The Standard Schema properties.
6122
+ */
6123
+ readonly "~standard": StandardSchemaV1$2.Props<Input, Output>;
6098
6124
  }
6099
- declare namespace StandardSchemaV1$1 {
6100
- /** The Standard Schema properties interface. */
6101
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
6102
- /** Validates unknown input values. */
6103
- readonly validate: (value: unknown, options?: StandardSchemaV1$1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
6125
+ declare namespace StandardSchemaV1$2 {
6126
+ /**
6127
+ * The Standard Schema properties interface.
6128
+ */
6129
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$2.Props<Input, Output> {
6130
+ /**
6131
+ * Validates unknown input values.
6132
+ */
6133
+ readonly validate: (value: unknown, options?: StandardSchemaV1$2.Options | undefined) => Result<Output> | Promise<Result<Output>>;
6104
6134
  }
6105
- /** The result interface of the validate function. */
6135
+ /**
6136
+ * The result interface of the validate function.
6137
+ */
6106
6138
  type Result<Output> = SuccessResult<Output> | FailureResult;
6107
- /** The result interface if validation succeeds. */
6139
+ /**
6140
+ * The result interface if validation succeeds.
6141
+ */
6108
6142
  interface SuccessResult<Output> {
6109
- /** The typed output value. */
6143
+ /**
6144
+ * The typed output value.
6145
+ */
6110
6146
  readonly value: Output;
6111
- /** A falsy value for `issues` indicates success. */
6147
+ /**
6148
+ * A falsy value for `issues` indicates success.
6149
+ */
6112
6150
  readonly issues?: undefined;
6113
6151
  }
6114
6152
  interface Options {
6115
- /** Explicit support for additional vendor-specific parameters, if needed. */
6153
+ /**
6154
+ * Explicit support for additional vendor-specific parameters, if needed.
6155
+ */
6116
6156
  readonly libraryOptions?: Record<string, unknown> | undefined;
6117
6157
  }
6118
- /** The result interface if validation fails. */
6158
+ /**
6159
+ * The result interface if validation fails.
6160
+ */
6119
6161
  interface FailureResult {
6120
- /** The issues of failed validation. */
6162
+ /**
6163
+ * The issues of failed validation.
6164
+ */
6121
6165
  readonly issues: ReadonlyArray<Issue>;
6122
6166
  }
6123
- /** The issue interface of the failure output. */
6167
+ /**
6168
+ * The issue interface of the failure output.
6169
+ */
6124
6170
  interface Issue {
6125
- /** The error message of the issue. */
6171
+ /**
6172
+ * The error message of the issue.
6173
+ */
6126
6174
  readonly message: string;
6127
- /** The path of the issue, if any. */
6175
+ /**
6176
+ * The path of the issue, if any.
6177
+ */
6128
6178
  readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
6129
6179
  }
6130
- /** The path segment interface of the issue. */
6180
+ /**
6181
+ * The path segment interface of the issue.
6182
+ */
6131
6183
  interface PathSegment {
6132
- /** The key representing a path segment. */
6184
+ /**
6185
+ * The key representing a path segment.
6186
+ */
6133
6187
  readonly key: PropertyKey;
6134
6188
  }
6135
- /** The Standard types interface. */
6136
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
6137
- /** Infers the input type of a Standard. */
6138
- type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
6139
- /** Infers the output type of a Standard. */
6140
- type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
6189
+ /**
6190
+ * The Standard types interface.
6191
+ */
6192
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$2.Types<Input, Output> {}
6193
+ /**
6194
+ * Infers the input type of a Standard.
6195
+ */
6196
+ type InferInput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferInput<Schema>;
6197
+ /**
6198
+ * Infers the output type of a Standard.
6199
+ */
6200
+ type InferOutput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferOutput<Schema>;
6141
6201
  }
6142
6202
  //#endregion
6143
6203
  //#region ../internal/utils/dist/index.d.ts
6144
- //#region ../types/dist/helpers.d.ts
6145
- type Dict<T> = Record<string, T | undefined>; //#endregion
6204
+ //#endregion
6146
6205
  //#region ../../../node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/functions.d.ts
6147
6206
  type Fn<args extends readonly any[] = readonly any[], returns = unknown> = (...args: args) => returns;
6148
6207
  type Thunk<ret = unknown> = () => ret;
@@ -6949,11 +7008,11 @@ declare const ExactLength: {
6949
7008
  //#region ../../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/standardSchema.d.ts
6950
7009
  /** From https://github.com/standard-schema/standard-schema */
6951
7010
  /** The Standard Typed interface. This is a base type extended by other specs. */
6952
- interface StandardTypedV1<Input = unknown, Output = Input> {
7011
+ interface StandardTypedV1$1<Input = unknown, Output = Input> {
6953
7012
  /** The Standard properties. */
6954
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
7013
+ readonly "~standard": StandardTypedV1$1.Props<Input, Output>;
6955
7014
  }
6956
- declare namespace StandardTypedV1 {
7015
+ declare namespace StandardTypedV1$1 {
6957
7016
  /** The Standard Typed properties interface. */
6958
7017
  interface Props<Input = unknown, Output = Input> {
6959
7018
  /** The version number of the standard. */
@@ -6971,20 +7030,20 @@ declare namespace StandardTypedV1 {
6971
7030
  readonly output: Output;
6972
7031
  }
6973
7032
  /** Infers the input type of a Standard Typed. */
6974
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
7033
+ type InferInput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
6975
7034
  /** Infers the output type of a Standard Typed. */
6976
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
7035
+ type InferOutput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
6977
7036
  }
6978
7037
  /** The Standard Schema interface. */
6979
- interface StandardSchemaV1<Input = unknown, Output = Input> {
7038
+ interface StandardSchemaV1$1<Input = unknown, Output = Input> {
6980
7039
  /** The Standard Schema properties. */
6981
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
7040
+ readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
6982
7041
  }
6983
- declare namespace StandardSchemaV1 {
7042
+ declare namespace StandardSchemaV1$1 {
6984
7043
  /** The Standard Schema properties interface. */
6985
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
7044
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
6986
7045
  /** Validates unknown input values. */
6987
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
7046
+ readonly validate: (value: unknown, options?: StandardSchemaV1$1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
6988
7047
  }
6989
7048
  /** The result interface of the validate function. */
6990
7049
  type Result<Output> = SuccessResult<Output> | FailureResult;
@@ -7017,11 +7076,11 @@ declare namespace StandardSchemaV1 {
7017
7076
  readonly key: PropertyKey;
7018
7077
  }
7019
7078
  /** The Standard types interface. */
7020
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
7079
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
7021
7080
  /** Infers the input type of a Standard. */
7022
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
7081
+ type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
7023
7082
  /** Infers the output type of a Standard. */
7024
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
7083
+ type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
7025
7084
  /** ArkType-specific properties that extend the standard schema with JSON Schema support. */
7026
7085
  interface ArkTypeProps<Input = unknown, Output = Input> extends Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {
7027
7086
  vendor: "arktype";
@@ -7034,7 +7093,7 @@ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
7034
7093
  }
7035
7094
  declare namespace StandardJSONSchemaV1 {
7036
7095
  /** The Standard JSON Schema properties interface. */
7037
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
7096
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
7038
7097
  /** Methods for generating the input/output JSON Schema. */
7039
7098
  readonly jsonSchema: StandardJSONSchemaV1.Converter;
7040
7099
  }
@@ -7061,11 +7120,11 @@ declare namespace StandardJSONSchemaV1 {
7061
7120
  readonly libraryOptions?: Record<string, unknown> | undefined;
7062
7121
  }
7063
7122
  /** The Standard types interface. */
7064
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
7123
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
7065
7124
  /** Infers the input type of a Standard. */
7066
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
7125
+ type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
7067
7126
  /** Infers the output type of a Standard. */
7068
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
7127
+ type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
7069
7128
  } //#endregion
7070
7129
  //#region ../../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts
7071
7130
  declare class ToJsonSchemaError<code extends ToJsonSchema.Code = ToJsonSchema.Code> extends Error {
@@ -7279,7 +7338,7 @@ declare namespace ArkErrors {
7279
7338
  * Subsequent errors added at an existing path are merged into an
7280
7339
  * ArkError intersection.
7281
7340
  */
7282
- declare class ArkErrors extends ReadonlyArray$1<ArkError> implements StandardSchemaV1.FailureResult {
7341
+ declare class ArkErrors extends ReadonlyArray$1<ArkError> implements StandardSchemaV1$1.FailureResult {
7283
7342
  readonly [arkKind] = "errors";
7284
7343
  protected ctx: Traversal;
7285
7344
  constructor(ctx: Traversal);
@@ -8099,14 +8158,14 @@ type DiscriminantKind = show<keyof DiscriminantKinds>; //#endregion
8099
8158
  interface InternalRootDeclaration extends BaseNodeDeclaration {
8100
8159
  kind: RootKind;
8101
8160
  }
8102
- declare abstract class BaseRoot< /** @ts-ignore cast variance */out d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode<d> implements StandardSchemaV1, StandardJSONSchemaV1 {
8161
+ declare abstract class BaseRoot< /** @ts-ignore cast variance */out d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode<d> implements StandardSchemaV1$1, StandardJSONSchemaV1 {
8103
8162
  readonly [arkKind]: "root";
8104
8163
  readonly [inferred]: unknown;
8105
8164
  constructor(attachments: UnknownAttachments, $: BaseScope);
8106
8165
  get rawIn(): BaseRoot;
8107
8166
  get rawOut(): BaseRoot;
8108
8167
  get internal(): this;
8109
- get "~standard"(): StandardSchemaV1.ArkTypeProps;
8168
+ get "~standard"(): StandardSchemaV1$1.ArkTypeProps;
8110
8169
  as(): this;
8111
8170
  brand(name: string): this;
8112
8171
  readonly(): this;
@@ -10895,7 +10954,7 @@ interface Type$1<out t = unknown, $ = {}> extends Callable<(data: unknown) => di
10895
10954
  */
10896
10955
  distribute<mapOut, reduceOut = mapOut[]>(mapBranch: (branch: Type$1, i: number, branches: array<Type$1>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;
10897
10956
  /** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */
10898
- "~standard": StandardSchemaV1.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
10957
+ "~standard": StandardSchemaV1$1.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
10899
10958
  /** @deprecated */
10900
10959
  apply: Function["apply"];
10901
10960
  /** @deprecated */
@@ -11360,13 +11419,13 @@ type parseGenericScopeKey<name extends string, params extends string, def> = {
11360
11419
  };
11361
11420
  type InnerParseResult = BaseRoot | ParsedOptionalProperty | ParsedDefaultableProperty; //#endregion
11362
11421
  //#region ../../../node_modules/.pnpm/arktype@2.2.0/node_modules/arktype/out/parser/definition.d.ts
11363
- type inferDefinition<def, $, args> = [def] extends [anyOrNever] ? def : def extends type.cast<infer t> ? ifEmptyObjectLiteral<def, object, t> : def extends ThunkCast<infer t> ? t : def extends string ? inferString<def, $, args> : def extends array ? inferTuple<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1 ? inferStandardSchema<def> : def extends object ? inferObjectLiteral<def, $, args> : never;
11364
- type inferStandardSchema<schema extends StandardSchemaV1, i = StandardSchemaV1.InferInput<schema>, o = StandardSchemaV1.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out<o>;
11422
+ type inferDefinition<def, $, args> = [def] extends [anyOrNever] ? def : def extends type.cast<infer t> ? ifEmptyObjectLiteral<def, object, t> : def extends ThunkCast<infer t> ? t : def extends string ? inferString<def, $, args> : def extends array ? inferTuple<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$1 ? inferStandardSchema<def> : def extends object ? inferObjectLiteral<def, $, args> : never;
11423
+ type inferStandardSchema<schema extends StandardSchemaV1$1, i = StandardSchemaV1$1.InferInput<schema>, o = StandardSchemaV1$1.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out<o>;
11365
11424
  type validateDefinition<def, $, args> = null extends undefined ? ErrorMessage<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever] ? def : def extends OptionalPropertyDefinition ? ErrorMessage<shallowOptionalMessage> : isDefaultable<def, $, args> extends true ? ErrorMessage<shallowDefaultableMessage> : validateInnerDefinition<def, $, args>;
11366
11425
  type validateInnerDefinition<def, $, args> = [def] extends [TerminalObjectDefinition] ? def : def extends string ? validateString<def, $, args> : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple<def, $, args> : def extends BadDefinitionType ? ErrorMessage<writeBadDefinitionTypeMessage<objectKindOrDomainOf<def>>> : validateObjectLiteral<def, $, args>;
11367
11426
  type validateTuple<def extends array, $, args> = maybeValidateTupleExpression<def, $, args> extends infer result ? result extends null ? validateTupleLiteral<def, $, args> : result : never;
11368
11427
  type inferTuple<def extends array, $, args> = def extends TupleExpression ? inferTupleExpression<def, $, args> : inferTupleLiteral<def, $, args>;
11369
- type TerminalObjectDefinition = type.cast<unknown> | Fn | RegExp | StandardSchemaV1;
11428
+ type TerminalObjectDefinition = type.cast<unknown> | Fn | RegExp | StandardSchemaV1$1;
11370
11429
  type ThunkCast<t = unknown> = () => type.cast<t>;
11371
11430
  type BadDefinitionType = Exclude<Primitive, string>;
11372
11431
  declare const writeBadDefinitionTypeMessage: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage<actual>;
@@ -12073,6 +12132,148 @@ interface MorphableIntersection<piped extends boolean> extends Hkt<[unknown, unk
12073
12132
  }
12074
12133
  type intersectObjects<l, r, piped extends boolean> = l extends array ? r extends array ? intersectArrays<l, r, MorphableIntersection<piped>> : // for an intersection with exactly one array operand like { name: string } & string[],
12075
12134
  l & r : r extends array ? l & r : keyof l & keyof r extends never ? show<l & r> : show<{ [k in keyof l]: k extends keyof r ? _inferIntersection<l[k], r[k], piped> : l[k] } & { [k in keyof r]: k extends keyof l ? _inferIntersection<l[k], r[k], piped> : r[k] }>; //#endregion
12135
+ //#region ../types/dist/standard-schema.d.ts
12136
+ /**
12137
+ * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
12138
+ *
12139
+ * Copied from standard-schema (MIT License)
12140
+ * Copyright (c) 2024 Colin McDannell
12141
+ */
12142
+ /**
12143
+ * The Standard Typed interface. This is a base type extended by other specs.
12144
+ */
12145
+ interface StandardTypedV1<Input = unknown, Output = Input> {
12146
+ /**
12147
+ * The Standard properties.
12148
+ */
12149
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
12150
+ }
12151
+ declare namespace StandardTypedV1 {
12152
+ /**
12153
+ * The Standard Typed properties interface.
12154
+ */
12155
+ interface Props<Input = unknown, Output = Input> {
12156
+ /**
12157
+ * The version number of the standard.
12158
+ */
12159
+ readonly version: 1;
12160
+ /**
12161
+ * The vendor name of the schema library.
12162
+ */
12163
+ readonly vendor: string;
12164
+ /**
12165
+ * Inferred types associated with the schema.
12166
+ */
12167
+ readonly types?: Types<Input, Output> | undefined;
12168
+ }
12169
+ /**
12170
+ * The Standard Typed types interface.
12171
+ */
12172
+ interface Types<Input = unknown, Output = Input> {
12173
+ /**
12174
+ * The input type of the schema.
12175
+ */
12176
+ readonly input: Input;
12177
+ /**
12178
+ * The output type of the schema.
12179
+ */
12180
+ readonly output: Output;
12181
+ }
12182
+ /**
12183
+ * Infers the input type of a Standard Typed.
12184
+ */
12185
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
12186
+ /**
12187
+ * Infers the output type of a Standard Typed.
12188
+ */
12189
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
12190
+ }
12191
+ /**
12192
+ * The Standard Schema interface.
12193
+ */
12194
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
12195
+ /**
12196
+ * The Standard Schema properties.
12197
+ */
12198
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
12199
+ }
12200
+ declare namespace StandardSchemaV1 {
12201
+ /**
12202
+ * The Standard Schema properties interface.
12203
+ */
12204
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
12205
+ /**
12206
+ * Validates unknown input values.
12207
+ */
12208
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
12209
+ }
12210
+ /**
12211
+ * The result interface of the validate function.
12212
+ */
12213
+ type Result<Output> = SuccessResult<Output> | FailureResult;
12214
+ /**
12215
+ * The result interface if validation succeeds.
12216
+ */
12217
+ interface SuccessResult<Output> {
12218
+ /**
12219
+ * The typed output value.
12220
+ */
12221
+ readonly value: Output;
12222
+ /**
12223
+ * A falsy value for `issues` indicates success.
12224
+ */
12225
+ readonly issues?: undefined;
12226
+ }
12227
+ interface Options {
12228
+ /**
12229
+ * Explicit support for additional vendor-specific parameters, if needed.
12230
+ */
12231
+ readonly libraryOptions?: Record<string, unknown> | undefined;
12232
+ }
12233
+ /**
12234
+ * The result interface if validation fails.
12235
+ */
12236
+ interface FailureResult {
12237
+ /**
12238
+ * The issues of failed validation.
12239
+ */
12240
+ readonly issues: ReadonlyArray<Issue>;
12241
+ }
12242
+ /**
12243
+ * The issue interface of the failure output.
12244
+ */
12245
+ interface Issue {
12246
+ /**
12247
+ * The error message of the issue.
12248
+ */
12249
+ readonly message: string;
12250
+ /**
12251
+ * The path of the issue, if any.
12252
+ */
12253
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
12254
+ }
12255
+ /**
12256
+ * The path segment interface of the issue.
12257
+ */
12258
+ interface PathSegment {
12259
+ /**
12260
+ * The key representing a path segment.
12261
+ */
12262
+ readonly key: PropertyKey;
12263
+ }
12264
+ /**
12265
+ * The Standard types interface.
12266
+ */
12267
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
12268
+ /**
12269
+ * Infers the input type of a Standard.
12270
+ */
12271
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
12272
+ /**
12273
+ * Infers the output type of a Standard.
12274
+ */
12275
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
12276
+ } //#endregion
12076
12277
  //#region src/coercion/environment.d.ts
12077
12278
  /**
12078
12279
  * Prepare an environment record by optionally stripping empty strings and applying coercion.
@@ -12088,28 +12289,96 @@ l & r : r extends array ? l & r : keyof l & keyof r extends never ? show<l & r>
12088
12289
  //#region src/core.d.ts
12089
12290
  /**
12090
12291
  * Machine-readable classification codes for environment validation issues.
12091
- * Serves as the Source of Truth (SoT) for error categorization in ArkEnv.
12092
12292
  */
12093
- type EnvIssueCode = /** The environment variable is required but was not provided, and has no default value. */"MISSING_VARIABLE" /** The variable value failed a type assertion (e.g., expected a number or boolean but received a string). */ | "INVALID_TYPE" /** The variable value falls below the minimum allowed numeric limit or string/array length constraint. */ | "VALUE_TOO_SMALL" /** The variable value exceeds the maximum allowed numeric limit or string/array length constraint. */ | "VALUE_TOO_LARGE" /** The variable value did not match the specified regular expression (regex) pattern constraint. */ | "PATTERN_MISMATCH" /** The variable value is not in a valid format (e.g., failed email or UUID format validation). */ | "INVALID_FORMAT" /** An undeclared key was found in the environment, and the schema config is set to reject undeclared keys. */ | "UNDECLARED_KEY" /** The provided validation schema definition itself is malformed or invalid. */ | "INVALID_SCHEMA" /** A validation error was triggered by a custom validator function or inline pipe logic. */ | "CUSTOM";
12293
+ type EnvIssueCode =
12294
+ /**
12295
+ * The environment variable is required but was not provided, and has no default value.
12296
+ */
12297
+ "MISSING_VARIABLE"
12298
+ /**
12299
+ * The variable value failed a type assertion (e.g., expected a number or boolean but received a string).
12300
+ */
12301
+ | "INVALID_TYPE"
12302
+ /**
12303
+ * The variable value falls below the minimum allowed numeric limit or string/array length constraint.
12304
+ */
12305
+ | "VALUE_TOO_SMALL"
12306
+ /**
12307
+ * The variable value exceeds the maximum allowed numeric limit or string/array length constraint.
12308
+ */
12309
+ | "VALUE_TOO_LARGE"
12310
+ /**
12311
+ * The variable value did not match the specified regular expression (regex) pattern constraint.
12312
+ */
12313
+ | "PATTERN_MISMATCH"
12314
+ /**
12315
+ * The variable value is not in a valid format (e.g., failed email or UUID format validation).
12316
+ */
12317
+ | "INVALID_FORMAT"
12318
+ /**
12319
+ * An undeclared key was found in the environment, and the schema config is set to reject undeclared keys.
12320
+ */
12321
+ | "UNDECLARED_KEY"
12322
+ /**
12323
+ * The provided validation schema definition itself is malformed or invalid.
12324
+ */
12325
+ | "INVALID_SCHEMA"
12326
+ /**
12327
+ * A validation error was triggered by a custom validator function or inline pipe logic.
12328
+ */
12329
+ | "CUSTOM";
12094
12330
  /**
12095
12331
  * Metadata associated with an environment validation issue.
12096
12332
  */
12097
12333
  type EnvIssueMeta = {
12098
- /** The minimum expected boundary for numeric/string length constraints */min?: number; /** The maximum expected boundary for numeric/string length constraints */
12099
- max?: number; /** Additional validation pattern/specifier details */
12100
- validation?: string; /** Any custom constraint descriptions */
12101
- constraint?: string; /** Traversal error occurred during JSON-parsing of the environment variable */
12334
+ /**
12335
+ * The minimum expected boundary for numeric/string length constraints
12336
+ */
12337
+ min?: number;
12338
+ /**
12339
+ * The maximum expected boundary for numeric/string length constraints
12340
+ */
12341
+ max?: number;
12342
+ /**
12343
+ * Additional validation pattern/specifier details
12344
+ */
12345
+ validation?: string;
12346
+ /**
12347
+ * Any custom constraint descriptions
12348
+ */
12349
+ constraint?: string;
12350
+ /**
12351
+ * Traversal error occurred during JSON-parsing of the environment variable
12352
+ */
12102
12353
  traversalError?: string;
12103
12354
  };
12104
12355
  /**
12105
12356
  * Normalized validation issue representing a failure on a specific environment variable.
12106
12357
  */
12107
12358
  type EnvIssue = {
12108
- /** The dot-separated property path/name of the environment variable */path: string; /** The descriptive, user-friendly error message */
12109
- message: string; /** The normalized classification code for the issue */
12110
- code: EnvIssueCode; /** The expected type or value shape description */
12111
- expected?: string; /** The raw value received (redacted in string formatting if sensitive) */
12112
- received?: unknown; /** Additional validation metadata */
12359
+ /**
12360
+ * The dot-separated property path/name of the environment variable
12361
+ */
12362
+ path: string;
12363
+ /**
12364
+ * The descriptive, user-friendly error message
12365
+ */
12366
+ message: string;
12367
+ /**
12368
+ * The normalized classification code for the issue
12369
+ */
12370
+ code: EnvIssueCode;
12371
+ /**
12372
+ * The expected type or value shape description
12373
+ */
12374
+ expected?: string;
12375
+ /**
12376
+ * The raw value received (redacted in string formatting if sensitive)
12377
+ */
12378
+ received?: unknown;
12379
+ /**
12380
+ * Additional validation metadata
12381
+ */
12113
12382
  meta?: EnvIssueMeta;
12114
12383
  };
12115
12384
  /**
@@ -12127,9 +12396,6 @@ declare function formatIssues(issues: EnvIssue[]): string;
12127
12396
  *
12128
12397
  * @example
12129
12398
  * ```ts
12130
- * import arkenv from 'arkenv';
12131
- * import { ArkEnvError } from 'arkenv/core';
12132
- *
12133
12399
  * try {
12134
12400
  * const env = arkenv({
12135
12401
  * PORT: 'number.port',
@@ -12143,7 +12409,9 @@ declare function formatIssues(issues: EnvIssue[]): string;
12143
12409
  * ```
12144
12410
  */
12145
12411
  declare class ArkEnvError extends Error {
12146
- /** The list of normalized issues that caused the validation failure */
12412
+ /**
12413
+ * The list of normalized issues that caused the validation failure
12414
+ */
12147
12415
  readonly issues: EnvIssue[];
12148
12416
  constructor(issues: EnvIssue[], message?: string);
12149
12417
  }
@@ -12169,16 +12437,17 @@ type SafeArkEnvResult<T> = {
12169
12437
  */
12170
12438
  type ParseStandardConfig = {
12171
12439
  /**
12172
- * The environment variables to parse. Defaults to `process.env`
12440
+ * The environment variables to parse. Defaults to `process.env`.
12441
+ *
12442
+ * All values must be strings (or `undefined`) to match `process.env` semantics.
12173
12443
  */
12174
- env?: Dict<string>;
12444
+ env?: Record<string, string | undefined>;
12175
12445
  /**
12176
12446
  * Control how ArkEnv handles environment variables that are not defined in your schema.
12177
12447
  *
12178
- * Defaults to `'delete'` to ensure your output object only contains
12179
- * keys you've explicitly declared.
12448
+ * Defaults to `'delete'` so the output object only contains keys you've declared.
12180
12449
  *
12181
- * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.
12450
+ * - `delete` (default): Undeclared keys are allowed on input but stripped from the output.
12182
12451
  * - `ignore`: Undeclared keys are allowed and preserved in the output.
12183
12452
  * - `reject`: Undeclared keys will cause validation to fail.
12184
12453
  *
@@ -12192,13 +12461,67 @@ type ParseStandardConfig = {
12192
12461
  debugSecrets?: boolean;
12193
12462
  /**
12194
12463
  * Whether to perform best-effort coercion on the environment variables.
12195
- * Coercion requires validators that implement the StandardJSONSchemaV1 spec
12196
- * (e.g. Zod, Valibot).
12464
+ * Coercion prefers validators that expose Standard JSON Schema on the value
12465
+ * itself (e.g. Zod). For converters that live outside the schema (e.g. Valibot
12466
+ * via `@valibot/to-json-schema`, Zod Mini via `z.toJSONSchema`, or Zod v3 via
12467
+ * `zod-to-json-schema`), pass {@link toJsonSchema}.
12197
12468
  *
12198
12469
  * @see https://standard-schema.dev
12199
12470
  * @default true
12200
12471
  */
12201
12472
  coerce?: boolean;
12473
+ /**
12474
+ * Optional fallback that converts a Standard Schema validator to JSON Schema
12475
+ * for ArkEnv pre-coercion when a key has no Standard JSON Schema on the value.
12476
+ *
12477
+ * Called per key only in that case. Not called when omitted, when `coerce` is
12478
+ * `false`, or when JSON Schema was already read from the value.
12479
+ *
12480
+ * - Return a plain object to use as that key's JSON Schema.
12481
+ * - Return `undefined` to skip coercion for that key only.
12482
+ * - Throwing or returning a non-plain object fails the parse with
12483
+ * {@link ArkEnvError} for that key (`INVALID_SCHEMA`).
12484
+ *
12485
+ * Typed as {@link StandardSchemaV1}. Host converters (Valibot, Zod Mini,
12486
+ * Zod v3 via `zod-to-json-schema`) do not accept that type — assert at the
12487
+ * converter call (`as v.GenericSchema`, `as z.ZodMiniType`,
12488
+ * `as z.ZodTypeAny`). Same assertion for a single-library map and a hybrid
12489
+ * with classic Zod (Zod never reaches this callback at runtime).
12490
+ *
12491
+ * @example Valibot wiring
12492
+ * ```ts
12493
+ * import { toJsonSchema } from "@valibot/to-json-schema";
12494
+ * import * as v from "valibot";
12495
+ *
12496
+ * arkenv(
12497
+ * { PORT: v.number() },
12498
+ * {
12499
+ * toJsonSchema: (schema) =>
12500
+ * toJsonSchema(schema as v.GenericSchema, {
12501
+ * typeMode: "input",
12502
+ * target: "draft-07",
12503
+ * }),
12504
+ * },
12505
+ * );
12506
+ * ```
12507
+ *
12508
+ * @example Zod v3 wiring
12509
+ * ```ts
12510
+ * import { z } from "zod/v3";
12511
+ * import { zodToJsonSchema } from "zod-to-json-schema";
12512
+ *
12513
+ * arkenv(
12514
+ * { PORT: z.number() },
12515
+ * {
12516
+ * toJsonSchema: (schema) =>
12517
+ * zodToJsonSchema(schema as z.ZodTypeAny, {
12518
+ * $refStrategy: "none",
12519
+ * }),
12520
+ * },
12521
+ * );
12522
+ * ```
12523
+ */
12524
+ toJsonSchema?: (schema: StandardSchemaV1) => object | undefined;
12202
12525
  /**
12203
12526
  * The format to use for array parsing when coercion is enabled.
12204
12527
  *
@@ -12238,12 +12561,11 @@ type ParseStandardConfig = {
12238
12561
  //#endregion
12239
12562
  //#region src/schema.d.ts
12240
12563
  /**
12241
- * Extract the keys from a schema definition dynamically.
12564
+ * Extract the keys from a schema definition.
12242
12565
  * Supports plain objects, ArkType schemas, and Standard Schema validators.
12243
12566
  *
12244
12567
  * @param schema The schema definition to extract keys from
12245
12568
  * @returns An array of extracted key names
12246
- * @internal
12247
12569
  */
12248
12570
  declare function getSchemaKeys(schema: any): string[]; //#endregion
12249
12571
  //#region src/utils/errors.d.ts
@@ -12259,9 +12581,10 @@ declare function getSchemaKeys(schema: any): string[]; //#endregion
12259
12581
  //#endregion
12260
12582
  //#region src/index.d.ts
12261
12583
  /**
12262
- * Configuration options for the `arkenv/standard` entry's `arkenv`.
12584
+ * Configuration options for `arkenv` from `@arkenv/standard`.
12263
12585
  */
12264
12586
  type StandardEnvConfig = ParseStandardConfig;
12587
+ type StandardEnvOutput<T extends Record<string, StandardSchemaV1$2>> = { [K in keyof T]: StandardSchemaV1$2.InferOutput<T[K]> };
12265
12588
  /**
12266
12589
  * Parse and validate environment variables using Standard Schema 1.0 validators (e.g. Zod, Valibot).
12267
12590
  *
@@ -12284,12 +12607,9 @@ type StandardEnvConfig = ParseStandardConfig;
12284
12607
  * });
12285
12608
  * ```
12286
12609
  */
12287
- declare function arkenv<const T extends Record<string, StandardSchemaV1$1>>(def: T, config?: StandardEnvConfig & {
12288
- safe?: false;
12289
- }): { [K in keyof T]: StandardSchemaV1$1.InferOutput<T[K]> };
12290
- declare function arkenv<const T extends Record<string, StandardSchemaV1$1>>(def: T, config: StandardEnvConfig & {
12291
- safe: true;
12292
- }): SafeArkEnvResult<{ [K in keyof T]: StandardSchemaV1$1.InferOutput<T[K]> }>;
12610
+ declare function arkenv<const T extends Record<string, StandardSchemaV1$2>, const Safe extends boolean | undefined = undefined>(def: T, config?: Omit<StandardEnvConfig, "safe"> & {
12611
+ safe?: Safe;
12612
+ }): [Safe] extends [true] ? SafeArkEnvResult<StandardEnvOutput<T>> : StandardEnvOutput<T>;
12293
12613
  //#endregion
12294
12614
  export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
12295
12615
  //# sourceMappingURL=index.d.cts.map