import type { AddressLevel, Region } from '../../../../lib/address/types.js'; import type { Address } from '../../../../types/address.js'; /** * What the `Address` GraphQL interface needs on the server (spec ยง 3.7): * * - `toGraphqlAddress(row, typename)` is what the CartAddress / CustomerAddress * / OrderAddress parent resolvers return: `camelCase(row)` plus the RAW * `extra` (its keys are never camel-cased), `__typename` for * `Address.__resolveType`, and the row itself for the field resolvers. * - `addressFieldResolvers` is the shared field map: every level below country * is a `Region { key, name, isoCode }`, `country` resolves through the * `Country` type, `formatted` renders the row for the request locale. */ export type AddressTypename = 'CartAddress' | 'CustomerAddress' | 'OrderAddress'; export interface RegionGraphql { key: string; name: string; isoCode: string | null; } export declare function toGraphqlAddress(row: Address, typename: AddressTypename): Record; /** The stored row behind a parent object; rebuilt from camelCase keys when a caller did not use `toGraphqlAddress`. */ export declare function rowOf(parent: Record): Address; /** `Region` for a stored key at `level`, with the outer enumerated levels as parent path. */ export declare function regionForRow(row: Address, level: AddressLevel, locale: string): Promise; /** `Region` for an entry already listed by a provider (the `regions` queries). */ export declare function toRegionGraphql(region: Region, country: string, locale: string): RegionGraphql & { retired: boolean; mergedInto: string | null; }; export declare const addressFieldResolvers: { dependentLocality: (parent: Record) => Promise; locality: (parent: Record) => Promise; administrativeArea: (parent: Record) => Promise; country: (parent: Record) => { code: string; name: string; } | null; extra: (parent: Record) => Record | null; formatted: (parent: Record) => Promise; };