import { SdSearch } from '@sd-angular/core/forms/models';
import { SdFormGenericArgs } from './form-render/form-render-args.model';
export interface SdFormGenericSelectionItem<T = any> {
    value: string;
    display: string;
    disabled?: boolean;
    template?: string;
    data?: T;
}
export interface SdFormGenericSelectionStaticItem {
    value: string;
    label: string;
}
export type SdFormGenericDefinitionSelection<T = any, TArgs = any> = SelectionValues<T> | SelectionLazyValues<T> | SelectionValuesKey<TArgs> | SelectionLazyValuesKey<TArgs>;
interface SelectionVariables<T = any> {
    items?: {
        value: Extract<keyof T, string>;
        display: string;
    }[];
    detail?: (values: string | number | string[] | number[], args: SdFormGenericArgs) => Promise<T | undefined>;
}
interface SelectionQueries {
    items?: {
        value: string;
        display: string;
    }[];
}
interface SelecttionBase {
    value: string;
    display: string;
    viewed?: (values: (string | number)[], args: SdFormGenericArgs) => Promise<string>;
    queries?: SelectionQueries;
    variables?: SelectionVariables;
}
interface SelectionValuesKey<TArgs> extends SelecttionBase {
    valuesKey: string;
    args?: TArgs;
}
interface SelectionLazyValuesKey<TArgs> extends SelecttionBase {
    lazyValuesKey: string;
    args?: TArgs;
}
interface SelectionValues<T = any> extends SelecttionBase {
    values: (args: SdFormGenericArgs) => Promise<SdFormGenericSelectionItem<T>[]>;
}
interface SelectionLazyValues<T = any> extends SelecttionBase {
    lazyValues: (searchArgs: Parameters<SdSearch>[0], args: SdFormGenericArgs) => Promise<SdFormGenericSelectionItem<T>[]>;
}
export {};
