import { ValidatorFn } from '@angular/forms';
import { Tap, TapResponse } from '@iotize/tap';
import { TapInfoKey } from '../tap-info/definitions';
import { TapInfo } from '../tap-info/keys';
import { TapInfoHolder } from '../tap-info/definitions';
export declare type TapConfigPutValueType<DataType> = (tap: Tap, val: DataType, ...args: any[]) => Promise<TapResponse<any>>;
export declare type TapConfigGetValueType<DataType> = (tap: Tap, ...args: any[]) => Promise<DataType>;
export interface TapConfigItemAction {
    title: string;
    icon?: string;
    color?: string;
    call: (tap: Tap) => Promise<TapResponse<any>>;
    triggersRefresh?: TapInfo[];
}
export interface TapConfigItemBase<DataType = any> extends TapInfoKey {
    valueRefreshRequired?: boolean;
    formValidators?: ValidatorFn[];
    title?: string;
    description?: string;
    icon?: string;
    resolvedValue?: TapInfoHolder;
    viewFormatter?: (input: DataType) => string;
    editable?: boolean;
    getValue?: TapConfigGetValueType<DataType> | false;
    putValue?: TapConfigPutValueType<DataType>;
    setValue?: TapConfigPutValueType<DataType>;
    editFormatter?: {
        /**
         * Transform value when it's read from Tap
         */
        read: (input: string) => DataType;
        /**
         * Transform value when it's written to the Tap
         */
        write: (input: DataType | undefined) => string | number;
    };
    input?: {
        pattern?: RegExp;
        minLength?: number;
        maxLength?: number;
        min?: number;
        max?: number;
        type?: 'text' | 'number' | 'password' | 'select' | 'toggle' | 'radio';
        options?: {
            key: any;
            text: string;
            icon?: string;
        }[];
        multiple?: boolean;
    };
}
