import { AttachmentData } from '@airtable/blocks/dist/types/src/types/attachment';
import { FieldType } from '@airtable/blocks/models';
import { Color } from '@airtable/blocks/types';
import { CollaboratorData } from '@airtable/blocks/types';
declare type CollaboratorData_Rest_Api = Omit<CollaboratorData, 'profilePicUrl'>;
interface RecordLink {
    id: RecordId;
    name: string;
}
declare type RecordId = string;
interface BarcodeData {
    text: string;
    type?: string;
}
interface SelectField {
    id: string;
    name: string;
    color?: Color;
}
interface LookupData {
    linkedRecordId: RecordId;
    value: unknown;
}
interface ButtonData {
    label: string;
    url: string | null;
}
interface ExternalSyncSource {
    id: string;
    name: string;
    color?: Color;
}
/**
 * Type map of FieldType to the type of the field value.
 * The type of the value retrieved may differ depending on whether the Block API (Record#getCellValue) or the REST API is used.
 * The REST API provides less information than the Blocks API and given that we use both to handle syncing
 * data, we'll translate the field value provided by the Blocks API into the same type that the REST API provides.
 */
export declare type AirtableFieldTypesToDefinedFieldValueTypes = {
    [FieldType.SINGLE_LINE_TEXT]: {
        block: string;
        rest: string;
    };
    [FieldType.EMAIL]: {
        block: string;
        rest: string;
    };
    [FieldType.URL]: {
        block: string;
        rest: string;
    };
    [FieldType.MULTILINE_TEXT]: {
        block: string;
        rest: string;
    };
    [FieldType.NUMBER]: {
        block: number;
        rest: number;
    };
    [FieldType.PERCENT]: {
        block: number;
        rest: number;
    };
    [FieldType.CURRENCY]: {
        block: number;
        rest: number;
    };
    [FieldType.SINGLE_SELECT]: {
        block: SelectField;
        rest: string;
    };
    [FieldType.MULTIPLE_SELECTS]: {
        block: SelectField[];
        rest: string[];
    };
    [FieldType.SINGLE_COLLABORATOR]: {
        block: CollaboratorData;
        rest: CollaboratorData_Rest_Api;
    };
    [FieldType.MULTIPLE_COLLABORATORS]: {
        block: CollaboratorData[];
        rest: CollaboratorData_Rest_Api[];
    };
    [FieldType.MULTIPLE_RECORD_LINKS]: {
        block: RecordLink[];
        rest: RecordId[];
    };
    [FieldType.DATE]: {
        block: string;
        rest: string;
    };
    [FieldType.DATE_TIME]: {
        block: string;
        rest: string;
    };
    [FieldType.PHONE_NUMBER]: {
        block: string;
        rest: string;
    };
    [FieldType.MULTIPLE_ATTACHMENTS]: {
        block: AttachmentData[];
        rest: AttachmentData[];
    };
    [FieldType.CHECKBOX]: {
        block: boolean;
        rest: boolean;
    };
    [FieldType.FORMULA]: {
        block: any;
        rest: any;
    };
    [FieldType.CREATED_TIME]: {
        block: string;
        rest: string;
    };
    [FieldType.ROLLUP]: {
        block: any;
        rest: any;
    };
    [FieldType.COUNT]: {
        block: number;
        rest: number;
    };
    [FieldType.MULTIPLE_LOOKUP_VALUES]: {
        block: LookupData[];
        rest: unknown[];
    };
    [FieldType.AUTO_NUMBER]: {
        block: number;
        rest: number;
    };
    [FieldType.BARCODE]: {
        block: BarcodeData;
        rest: BarcodeData;
    };
    [FieldType.RATING]: {
        block: number;
        rest: number;
    };
    [FieldType.RICH_TEXT]: {
        block: string;
        rest: string;
    };
    [FieldType.DURATION]: {
        block: number;
        rest: number;
    };
    [FieldType.LAST_MODIFIED_TIME]: {
        block: string;
        rest: string;
    };
    [FieldType.CREATED_BY]: {
        block: CollaboratorData;
        rest: CollaboratorData_Rest_Api;
    };
    [FieldType.LAST_MODIFIED_BY]: {
        block: CollaboratorData;
        rest: CollaboratorData_Rest_Api;
    };
    [FieldType.BUTTON]: {
        block: ButtonData;
        rest: ButtonData;
    };
    [FieldType.EXTERNAL_SYNC_SOURCE]: {
        block: ExternalSyncSource;
        rest: ExternalSyncSource;
    };
};
export declare type AirtableFieldValueRest = AirtableFieldTypesToDefinedFieldValueTypes[FieldType]['rest'];
export declare type AirtableFieldTypesToFieldValues = {
    [FieldType in keyof AirtableFieldTypesToDefinedFieldValueTypes]: {
        [ApiType in keyof AirtableFieldTypesToDefinedFieldValueTypes[FieldType]]: AirtableFieldTypesToDefinedFieldValueTypes[FieldType][ApiType] | null;
    };
};
export declare type AirtableField = SingleLineTextField | UrlField | EmailField | MultiLineTextField | NumberField | IntegerField | FloatField | PercentageField | CurrencyField | SingleSelectField | MultipleSelectsField | MultipleRecordLinksField | DateField | DatetimeField | CheckboxField | BarcodeField | RichTextField | DurationField | PhoneField;
interface AbstractAirtableField {
    type: FieldType;
    options: {
        [key: string]: unknown;
    } | null;
}
interface AbstractStringField extends AbstractAirtableField {
}
export interface SingleLineTextField extends AbstractStringField {
    type: FieldType.SINGLE_LINE_TEXT;
    options: null;
}
export interface UrlField extends AbstractStringField {
    type: FieldType.URL;
    options: null;
}
export interface EmailField extends AbstractStringField {
    type: FieldType.EMAIL;
    options: null;
}
export interface PhoneField extends AbstractStringField {
    type: FieldType.PHONE_NUMBER;
    options: null;
}
export interface MultiLineTextField extends AbstractStringField {
    type: FieldType.MULTILINE_TEXT;
    options: null;
}
export interface NumberField extends AbstractAirtableField {
    type: FieldType.NUMBER;
    options: {
        precision: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
    };
}
export interface IntegerField extends NumberField {
    type: FieldType.NUMBER;
    options: {
        precision: 0;
    };
}
export interface FloatField extends NumberField {
    type: FieldType.NUMBER;
    options: {
        precision: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
    };
}
export interface PercentageField extends AbstractAirtableField {
    type: FieldType.NUMBER;
    options: {
        precision: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
    };
}
export interface CurrencyField extends AbstractAirtableField {
    type: FieldType.CURRENCY;
    options: {
        precision: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
        symbol: string;
    };
}
export interface SingleSelectField extends AbstractAirtableField {
    type: FieldType.SINGLE_SELECT;
}
export interface MultipleSelectsField extends AbstractAirtableField {
    type: FieldType.MULTIPLE_SELECTS;
    options: {
        choices: string[];
    };
}
export interface MultipleRecordLinksField extends AbstractAirtableField {
    type: FieldType.MULTIPLE_RECORD_LINKS;
}
declare type DateFormat = {
    name: 'local';
    format?: 'l';
} | {
    name: 'friendly';
    format?: 'LL';
} | {
    name: 'us';
    format?: 'M/D/YYYY';
} | {
    name: 'european';
    format?: 'D/M/YYYY';
} | {
    name: 'iso';
    format?: 'YYYY-MM-DD';
};
declare type TimeFormat = {
    name: '12hour';
    format: 'h:mma';
} | {
    name: '24hour';
    format: 'HH:mma';
};
declare type timezone = 'utc' | 'client';
export interface DateField extends AbstractAirtableField {
    type: FieldType.DATE;
    options: {
        dateFormat: DateFormat;
        timeZone: timezone;
    };
}
export interface DatetimeField extends AbstractAirtableField {
    type: FieldType.DATE_TIME;
    options: {
        dateFormat: DateFormat;
        timeFormat: TimeFormat;
        timeZone: timezone;
    };
}
export interface CheckboxField extends AbstractAirtableField {
    type: FieldType.CHECKBOX;
    options: {
        icon: 'check' | 'star' | 'heart' | 'thumbsUp' | 'flag';
        color: 'yellowBright' | 'orangeBright' | 'redBright' | 'pinkBright' | 'purpleBright' | 'blueBright' | 'cyanBright' | 'tealBright' | 'greenBright' | 'grayBright';
    };
}
export interface BarcodeField extends AbstractAirtableField {
    type: FieldType.BARCODE;
    options: null;
}
export interface RichTextField extends AbstractAirtableField {
    type: FieldType.RICH_TEXT;
    options: null;
}
export interface DurationField extends AbstractAirtableField {
    type: FieldType.DURATION;
    options: {
        durationFormat: 'h:mm' | 'h:mm:ss' | 'h:mm:ss.S' | 'h:mm:ss.SS' | 'h:mm:ss.SSS';
    };
}
export {};
