import { Table } from './database'; import { Record } from './record'; import { RelatedField, SimpleField, Model } from './schema'; import { Document, Value } from './types'; export interface RecordConfig { [key: string]: string | string[]; } export declare function parseRelatedOption(spec: string): { name: string; key: string; value: string; }; export declare function loadTable(table: Table, config: LoadingConfig, data: Document | Document[]): Promise; export declare function recordConfigToDocument(table: Table, config: RecordConfig): Document; export declare function mapDocument(doc: Document, config: RecordConfig): Document[]; export interface LoadingOptions { fields: RecordConfig; defaults?: Document; keys?: string[]; } export declare class LoadingConfig { model: Model; fields: RecordConfig; defaults: Document; attrs?: { field: RelatedField; key: string; value: string; }; fieldMap: Map; surrogateKeys: string[]; constructor(model: Model, config: LoadingOptions); getField(selector: string): SimpleField; initFieldMap(): void; private nextSurrogateKeyId; private addSurrogateKey; initKeys(keys?: string[]): void; initAttrs(config: string): void; encodeSurrogateKey(row: { [key: string]: any; }): { [key: string]: any; }; decodeSurrogateKey(key: string): Array<{ selector: string; field: SimpleField; value: string; } | null>; buildSurrogateKey(table: Table, row: Record): string; } export declare function decodeSurrogateKey(table: Table, options: RecordConfig | string[], value: string): { filter: { [key: string]: import("./types").ScalarValue | Document; }; rows: { table: Table; key: { field: string; value: Value; }; }[]; }; export declare function getDefaultSurrogateKeyFields(table: Table, options: RecordConfig | string[]): Array<{ table: string; field: string; selector: string; }>; export declare function surrogateKeyToFields(table: Table, options: RecordConfig | string[], value: string): { fields: { [key: string]: string; }; values: { [key: string]: import("./types").ScalarValue; }; };