import { NumberConstraints } from "../schema/number-constraints.mjs"; import { ArgSchema } from "../schema/arg.mjs"; import { StringConstraints } from "../schema/string-constraints.mjs"; import { FlagSchema } from "../schema/flag.mjs"; import "../schema/index.mjs"; //#region src/core/resolve/property.d.ts /** Flag/arg kinds that share a common coercion path. */ declare const SHARED_PROPERTY_MODEL_KINDS: readonly ["string", "number", "enum", "custom"]; /** Union of kind discriminants that participate in shared coercion. */ type SharedPropertyKind = (typeof SHARED_PROPERTY_MODEL_KINDS)[number]; /** Minimal coercion-relevant slice of a flag or arg schema, discriminated by kind. */ type SharedPropertySchema = { readonly kind: 'string'; readonly stringConstraints: StringConstraints | undefined; } | { readonly kind: 'number'; readonly numberConstraints: NumberConstraints | undefined; } | { readonly kind: 'enum'; readonly enumValues: readonly string[] | undefined; } | { readonly kind: 'custom'; readonly parseFn?: (raw: unknown) => unknown; }; /** Contract asserting which concerns are shared vs. kept separate between flags and args. */ interface SharedPropertyModelContract { /** Only coercion logic is shared; resolution orchestration is not. */ readonly scope: 'coercion'; /** The kind discriminants that participate in shared coercion. */ readonly sharedKinds: readonly SharedPropertyKind[]; /** Flag and arg precedence chains remain independent. */ readonly keepsFlagAndArgPrecedenceSeparate: true; /** Fallback-on-coercion-error rules remain independent. */ readonly keepsFallbackRulesSeparate: true; /** Required-value validation remains independent. */ readonly keepsRequiredValueRulesSeparate: true; } /** Runtime-accessible contract instance for property model tests. */ declare const sharedPropertyModelContract: { scope: "coercion"; sharedKinds: readonly ["string", "number", "enum", "custom"]; keepsFlagAndArgPrecedenceSeparate: true; keepsFallbackRulesSeparate: true; keepsRequiredValueRulesSeparate: true; }; /** Extract the shared coercion slice from a flag schema, or `undefined` for boolean/array (handled separately). */ declare function toSharedFlagPropertySchema(schema: FlagSchema): SharedPropertySchema | undefined; /** Extract the shared coercion slice from an arg schema (all arg kinds are shared). */ declare function toSharedArgPropertySchema(schema: ArgSchema): SharedPropertySchema; //#endregion export { SHARED_PROPERTY_MODEL_KINDS, type SharedPropertyKind, type SharedPropertyModelContract, type SharedPropertySchema, sharedPropertyModelContract, toSharedArgPropertySchema, toSharedFlagPropertySchema };