import type { DataExtensionSchema } from '@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types';
import { CustomFieldForm, WixPatternsContainer } from '../../state';
import { PatternsErrorHandler, WixPatternsEssentials } from '../../model';
export interface DataExtensionSchemaServiceParams {
    readonly httpClient: WixPatternsEssentials['httpClient'];
    readonly translate: WixPatternsContainer['translate'];
    readonly errorHandler: PatternsErrorHandler;
}
export type DataExtensionType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
export type DataExtensionPermission = 'apps' | 'owning-app' | 'users' | 'users-of-users';
interface DataExtensionFieldItems extends Partial<Omit<DataExtensionField, 'type' | 'maxLength'>> {
    type: Omit<DataExtensionType, 'array'>;
    maxLength: number;
}
export interface DataExtensionField {
    id: string;
    type?: DataExtensionType;
    format?: 'date-time' | 'date' | 'single-line' | 'uri' | string;
    title?: string;
    maxLength?: number;
    enum?: string[];
    'x-wix-archived'?: boolean;
    'x-wix-filterable'?: boolean;
    'x-wix-created-date': string;
    'x-wix-object-type'?: string;
    'x-wix-permissions': {
        read: DataExtensionPermission[];
        write: DataExtensionPermission[];
    };
    properties?: Record<string, any>;
    items?: DataExtensionFieldItems;
    'x-wix-pii'?: {
        enabled: boolean;
    };
}
export type CustomFieldType = 'shortText' | 'longText' | 'url' | 'date' | 'dateTime' | 'integer' | 'decimal' | 'checkbox' | 'dropdown' | 'files' | 'multiSelect';
export type CustomFieldOrigin = 'Custom columns panel' | 'Custom fields panel' | 'Custom fields widget' | 'external';
export interface ExtendedFieldsDataMap {
    [key: string]: any;
}
export interface ExtendedFields {
    _type?: 'ExtendedFields';
    /**
     * Data Extensions extended fields
     * Key: Namespace
     * Value: extended fields data in Struct format
     */
    namespaces?: {
        _user_fields?: ExtendedFieldsDataMap | undefined;
        [key: string]: ExtendedFieldsDataMap | undefined;
    };
}
export type CustomFieldOwner = 'user' | 'app';
export interface CustomField {
    id: string;
    type: CustomFieldType;
    label?: string;
    maxLength?: number;
    options?: string[];
    editable: boolean;
    filterable?: boolean;
    owner: CustomFieldOwner;
    properties?: Record<string, string>;
    namespace: string;
    isPii?: boolean;
    permissions?: {
        read?: DataExtensionPermission[];
        write?: DataExtensionPermission[];
    };
}
export interface AddFieldParams {
    schema?: DataExtensionSchema;
    fqdn: string;
    form: CustomFieldForm;
    filterable?: boolean;
}
export interface ArchiveFieldParams {
    schema?: DataExtensionSchema;
    fqdn: string;
    id: string;
}
export declare class DataExtensionSchemaService {
    readonly httpClient: WixPatternsEssentials['httpClient'];
    readonly translate: WixPatternsContainer['translate'];
    readonly errorHandler: PatternsErrorHandler;
    readonly userFieldsNamespace = "_user_fields";
    static toSchemaType(type?: CustomFieldType): {
        type: string;
        format: string;
        maxLength: number;
        items?: undefined;
    } | {
        type: string;
        maxLength: number;
        format?: undefined;
        items?: undefined;
    } | {
        type: string;
        format: string;
        maxLength?: undefined;
        items?: undefined;
    } | {
        type: string;
        format?: undefined;
        maxLength?: undefined;
        items?: undefined;
    } | {
        type: string;
        items: {
            type: string;
        };
        format?: undefined;
        maxLength?: undefined;
    };
    static toCustomType(field: DataExtensionField): CustomFieldType | undefined;
    static toCustomField(schema: DataExtensionSchema, key: string): DataExtensionField | undefined;
    constructor(params: DataExtensionSchemaServiceParams);
    addCustomField(params: AddFieldParams): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").UpdateDataExtensionSchemaResponse>;
    archiveCustomField(params: ArchiveFieldParams): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").UpdateDataExtensionSchemaResponse>;
    restoreCustomField(params: ArchiveFieldParams): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").UpdateDataExtensionSchemaResponse>;
    restoreDeletedField(params: ArchiveFieldParams & {
        fieldData: any;
    }): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").UpdateDataExtensionSchemaResponse>;
    deleteCustomField(params: ArchiveFieldParams): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").DeleteUserDefinedFieldsResponse>;
    fetchSchemas(fqdn: string): Promise<import("@wix/bex-utils/@wix/ambassador-data-extensions-v1-data-extension-schema/types").ListDataExtensionSchemasResponse>;
    private _createDataExtensionSchema;
    private _updateDataExtensionSchema;
    private _deleteUserDefinedFields;
}
export {};
//# sourceMappingURL=dataExtensionService.d.ts.map