import type { FC } from 'react';
export declare const typeRegistry: Map<string, CellType<any, any>>;
export interface CellType<Value extends BaseValue = any, BaseValue = any> {
    readonly id: string;
    readonly displayName: string;
    readonly defaultValue: Value;
    readonly validate: (value: BaseValue) => value is Value;
    is<ExpectedCellType extends CellType<unknown>>(t: ExpectedCellType): this is ExpectedCellType;
}
export declare abstract class AbstractCellType<Value extends BaseValue, BaseValue = unknown> implements CellType<Value, BaseValue> {
    abstract readonly id: string;
    abstract readonly displayName: string;
    abstract readonly defaultValue: Value;
    abstract validate: (value: BaseValue) => value is Value;
    is<ExpectedCellType extends CellType<unknown>>(t: ExpectedCellType): this is ExpectedCellType;
}
export declare function defineCellType<Value extends BaseValue, BaseValue = unknown>(id: string, displayName: string, defaultValue: Value, validate: (value: BaseValue) => value is Value, extended?: CellType<BaseValue>): CellType<Value, BaseValue>;
export declare const numberCellType: CellType<number, unknown>;
export declare const stringCellType: CellType<string, unknown>;
export declare const objectCellType: CellType<Record<string, unknown>, unknown>;
export declare const booleanCellType: CellType<boolean, unknown>;
export declare const arrayCellType: CellType<unknown[], unknown>;
export declare const baseCellTypes: {
    readonly array: CellType<unknown[], unknown>;
    readonly boolean: CellType<boolean, unknown>;
    readonly object: CellType<Record<string, unknown>, unknown>;
    readonly number: CellType<number, unknown>;
    readonly string: CellType<string, unknown>;
};
export declare type BaseCellTypes = typeof baseCellTypes;
export declare type BaseCellTypesKeys = keyof BaseCellTypes;
export declare type BaseCellType = BaseCellTypes[BaseCellTypesKeys];
export declare type ConfigPanelProps<Config extends Record<string, unknown>> = {
    config: Config;
    onChangeConfig: (apply: (oldConfig: Config) => Config) => void;
};
export declare type IOItem<Type extends BaseCellType = BaseCellType> = {
    type: Type;
    name: string;
};
export declare type IO = {
    [key: string]: IOItem;
};
export declare type SheetFunctionType = 'map' | 'reduce' | 'transform';
export declare type InferIOItemToJSType<T extends IOItem> = T extends {
    type: infer U;
} ? U extends AbstractCellType<infer V, unknown> ? V : never : never;
export declare type Columns<T extends IO> = {
    [Key in keyof T]: InferIOItemToJSType<T[Key]>[];
};
export interface SheetMapFunction<Inputs extends IO = IO, Outputs extends IO = IO, Config extends Record<string, unknown> = Record<string, any>> {
    /**
     * UUID4
     */
    id: string;
    type: Extract<SheetFunctionType, 'map' | 'transform'>;
    name: string;
    inputs: Inputs;
    outputs: Outputs;
    fn: (columns: Columns<Inputs>, config: Config) => Promise<Columns<Outputs>>;
    defaultConfig: Config;
    configPanel: FC<ConfigPanelProps<Config>> | undefined;
    description: string | undefined;
}
export interface SheetReduceFunction<Inputs extends IOItem = IOItem, Outputs extends IOItem = IOItem, Config extends Record<string, unknown> = Record<string, any>> {
    /**
     * UUID4
     */
    id: string;
    type: Extract<SheetFunctionType, 'reduce'>;
    name: string;
    input: Inputs;
    output: Outputs;
    fn: (column: InferIOItemToJSType<Inputs>[], config: Config) => Promise<InferIOItemToJSType<Outputs>>;
    defaultConfig: Config;
    configPanel: FC<ConfigPanelProps<Config>> | undefined;
    description: string | undefined;
}
export declare type SheetFunction = SheetReduceFunction | SheetMapFunction;
export declare function createSheetFunction<Inputs extends IOItem = IOItem, Outputs extends IOItem = IOItem, Config extends Record<string, unknown> = Record<string, any>>(id: string, name: string, type: Extract<SheetFunctionType, 'reduce'>, input: Inputs, output: Outputs, defaultConfig: Config, fn: SheetReduceFunction<Inputs, Outputs, Config>['fn'], configPanel?: SheetReduceFunction<Inputs, Outputs, Config>['configPanel'], description?: SheetReduceFunction<Inputs, Outputs, Config>['description']): SheetReduceFunction<Inputs, Outputs, Config>;
export declare function createSheetFunction<Inputs extends IO, Outputs extends IO, Config extends Record<string, unknown>>(id: string, name: string, type: Extract<SheetFunctionType, 'map' | 'transform'>, inputs: Inputs, outputs: Outputs, defaultConfig: Config, fn: SheetMapFunction<Inputs, Outputs, Config>['fn'], configPanel?: SheetMapFunction<Inputs, Outputs, Config>['configPanel'], description?: SheetMapFunction<Inputs, Outputs, Config>['description']): SheetMapFunction<Inputs, Outputs, Config>;
//# sourceMappingURL=index.d.ts.map