import type { AppliedDataSemantic } from '../Semantics.js';
import { SemanticType } from '../Semantics.js';
/**
 * Validation Logic Flow:
 *
 * When the API receives a POST or PATCH request, the following sequence occurs:
 * 1. Semantic Trigger: The Runtime identifies a property with the PostalCode semantic and config.validate: true.
 * 2. Country Lookup: The Runtime identifies the sibling property tagged with `SemanticType.Country`.
 * 3. Regex Retrieval: The Runtime retrieves the appropriate regex pattern based on the country code.
 * 4. Validation: The Runtime validates the postal code against the retrieved regex pattern.
 * 5. Error Handling: If the validation fails, the Runtime returns a 400 Bad Request error with a descriptive message.
 *   - Example: "Invalid postal code format for country: [CountryCode]."
 *
 * Validation libraries:
 * - https://www.npmjs.com/package/postcode-validator (MIT)
 * - https://github.com/sashiksu/postal-code-checker (MIT)
 */
export interface PostalCodeConfig {
    /**
     * Enables regex-based validation based on the value in the sibling property
     * tagged with `SemanticType.Country`.
     */
    validate?: boolean;
    /**
     * The list of allowed postal codes.
     */
    allowedPostalCodes?: string[];
    /**
     * The list of disallowed postal codes.
     */
    disallowedPostalCodes?: string[];
    /**
     * Custom metadata for the postal code field.
     */
    metadata?: Record<string, unknown>;
    /**
     * Index signature to allow additional properties.
     */
    [key: string]: unknown;
}
export interface AppliedPostalCodeSemantic extends AppliedDataSemantic {
    id: SemanticType.PostalCode;
    config?: PostalCodeConfig;
}
export declare const DEFAULT_POSTAL_CODE_CONFIG: PostalCodeConfig;
export declare const isPostalCodeSemantic: (semantic: AppliedDataSemantic) => semantic is AppliedPostalCodeSemantic;
export declare const createPostalCodeSemantic: (config?: PostalCodeConfig) => AppliedPostalCodeSemantic;
//# sourceMappingURL=PostalCode.d.ts.map