import { IComputedValue, ObservableMap } from 'mobx';
import DataSet, { RecordValidationErrors } from './DataSet';
import Field, { FieldProps, Fields } from './Field';
import DataSetSnapshot from './DataSetSnapshot';
import { RecordStatus } from './enum';
import ValidationResult from '../validator/ValidationResult';
import { AttachmentCache } from '../stores/AttachmentStore';
export declare const EXPANDED_KEY = "__EXPANDED_KEY__";
export interface RecordBaseProps {
    disabled?: boolean | undefined;
    selectable?: boolean | undefined;
    defaultSelected?: boolean | undefined;
    defaultExpanded?: boolean | undefined;
}
export declare type RecordDynamicProps = {
    [P in keyof RecordBaseProps]: (record: Record) => RecordBaseProps[P];
};
export interface RecordProps extends RecordBaseProps {
    dynamicProps?: Partial<RecordDynamicProps>;
}
export default class Record {
    id: number;
    dataSet: DataSet;
    get fields(): Fields;
    ownerFields: Fields;
    tempFields?: Map<string, Field>;
    memo?: object;
    private prepareForReport?;
    dataSetSnapshot?: {
        [key: string]: DataSetSnapshot;
    } | undefined;
    cascadeRecordsMap?: {
        [key: string]: Record[];
    } | undefined;
    cascading?: {
        [key: string]: boolean;
    } | undefined;
    validating?: boolean | undefined;
    data: object;
    dirtyData?: ObservableMap<string, any> | undefined;
    validationErrors?: ObservableMap<string, ValidationResult[]>;
    lookupTokens?: ObservableMap<string, string | undefined> | undefined;
    attachmentCaches?: ObservableMap<string, AttachmentCache>;
    computedFieldProps?: Map<string | symbol, IComputedValue<any>>;
    lastDynamicFieldProps?: Map<string, {
        [key: string]: any;
    } | undefined>;
    get pristineData(): object;
    set pristineData(data: object);
    status: RecordStatus;
    get selectedTimestamp(): number | undefined;
    set selectedTimestamp(timestamp: number | undefined);
    get selectable(): boolean;
    set selectable(selectable: boolean);
    get disabled(): boolean;
    set disabled(selectable: boolean);
    get isDataSetInAllPageSelection(): boolean;
    get isSelected(): boolean;
    set isSelected(isSelected: boolean);
    isCurrent?: boolean;
    isCached?: boolean;
    editing?: boolean;
    pending?: boolean;
    childrenLoaded?: boolean;
    state?: ObservableMap<string, any> | undefined;
    get key(): string | number;
    get index(): number;
    get indexInParent(): number;
    get isRemoved(): boolean;
    get isNew(): boolean;
    get isSelectionIndeterminate(): boolean;
    get isIndeterminate(): boolean;
    get isExpanded(): boolean;
    set isExpanded(expand: boolean);
    get previousRecord(): Record | undefined;
    get nextRecord(): Record | undefined;
    get records(): Record[];
    children?: Record[] | undefined;
    parent?: Record | undefined;
    get parents(): Record[];
    get path(): Record[];
    get level(): number;
    get dirty(): boolean;
    get cascadeParent(): Record | undefined;
    constructor(data?: object, dataSet?: DataSet, status?: RecordStatus);
    processTreeLevel(props: {
        dataSet: DataSet;
        value: any;
        fieldName: string;
    }): void;
    /**
     * 转换成普通数据
     * 一般用于父级联数据源中的json类型字段
     * 禁止通过此方法获取某一个或几个字段值
     */
    toData(needIgnore?: boolean, noCascade?: boolean, isCascadeSelect?: boolean, all?: boolean): any;
    /**
     * 转换成用于提交的数据
     */
    toJSONData(noCascade?: boolean, isCascadeSelect?: boolean): any;
    validate(all?: boolean, noCascade?: boolean): Promise<boolean>;
    cancelReportValidity(): void;
    reportValidity(result: RecordValidationErrors, fromField?: boolean): void;
    getValidationErrors(): RecordValidationErrors[];
    addField(name: string, fieldProps?: FieldProps): Field;
    getField(fieldName?: string): Field | undefined;
    getCascadeRecordsIncludeDelete(fieldName?: string): Record[] | undefined;
    getCascadeRecords(fieldName?: string): Record[] | undefined;
    getCascadeSelectedRecordsIncludeDelete(fieldName?: string): Record[] | undefined;
    getCascadeSelectedRecords(fieldName?: string): Record[] | undefined;
    get(fieldName?: string | string[]): any;
    set(item: string | object, value?: any): Record;
    getPristineValue(fieldName?: string): any;
    init(item: string | object, value?: any): Record;
    clone(): Record;
    ready(): Promise<any>;
    tls(name?: string): Promise<void>;
    reset(): Record;
    save(): Record;
    restore(): Record;
    clear(): Record;
    commit(data?: object, dataSet?: DataSet): Record;
    setState(item: string | object, value?: any): this;
    getState(key: string): any;
    treeReduce<U>(fn: (previousValue: U, record: Record) => U, initialValue: U): U;
    private commitTls;
    processFieldValue(fieldName: string, field: Field, fields: Fields, newData: object, data: object, needMerge?: boolean): void;
    setValidationError(name: string, result: ValidationResult[]): void;
    getValidationError(name: string): ValidationResult[] | undefined;
    clearValidationError(name: any): boolean | undefined;
    private processData;
    private normalizeData;
    private normalizeCascadeData;
}
