import { z } from "zod"; import type { ApiClient } from "../../api"; import type { TableApiItem, TableItem } from "./listTables/schemas"; import type { RecordApiItem, RecordItem } from "./getTableRecord/schemas"; import type { FieldApiItem, FieldItem } from "./listTableFields/schemas"; export declare function formatFieldValue(v: unknown): string; /** * Convert a field ID to its numeric form for the Tables API. * Accepts "f6", "6", or 6 and returns 6. */ export declare function toNumericFieldId(id: string | number): number; export declare function transformTableItem(apiItem: TableApiItem): TableItem; export declare function transformFieldItem(apiItem: FieldApiItem): FieldItem; export declare function transformRecordItem(apiItem: RecordApiItem): RecordItem; /** * Check a record API item for field-level validation errors and throw if any * are present. The errors dict is keyed by field ID, and each value has * `{s, v, e, h}` where `h` is the human-friendly message and `e` is the * technical one. */ export declare function throwOnRecordErrors(record: RecordApiItem): void; /** * Check an API response for top-level validation errors (in `meta.errors`) * and throw if any are present. */ export declare function throwOnResponseErrors(response: { meta?: { errors?: unknown[]; } | null; }): void; export declare const KeyModeSchema: z.ZodDefault>>; export type KeyMode = z.infer; export declare const TrashSchema: z.ZodOptional>; export type Trash = z.infer; export declare function isFieldId(key: string): boolean; export declare const NESTED_COMPONENTS: Record>; /** * Resolve an array of field keys (names like "Email" or IDs like "f6", "6", 6) * to numeric field IDs for the API. Only fetches field metadata if any * non-ID keys are present. */ export declare function resolveFieldKeys({ api, tableId, fieldKeys, }: { api: ApiClient; tableId: string; fieldKeys: Array; }): Promise; export interface FieldKeyTranslator { translateInput(data: Record): Record; translateOutput(data: Record): Record; translateFieldKey(key: string): string; } /** * Resolve the field mapping for a table and return a translator. * Fetches field metadata from the API once (when keyMode is "names"), * then all translate methods are synchronous. */ export declare function createFieldKeyTranslator({ api, tableId, keyMode, }: { api: ApiClient; tableId: string; keyMode: KeyMode; }): Promise; //# sourceMappingURL=utils.d.ts.map