import { AllowedComponentProps } from 'vue';
import { AnyFn } from '@vueuse/core';
import { AxiosInstance } from 'axios';
import { AxiosRequestConfig } from 'axios';
import { ComponentCustomProps } from 'vue';
import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { ComputedRef } from 'vue';
import { DefineComponent } from 'vue';
import { FilterField } from './filterFactory';
import { FilterField as FilterField_2 } from '../filters/filterFactory';
import { InjectionKey } from 'vue';
import { Method } from 'axios';
import { PublicProps } from 'vue';
import { Ref } from 'vue';
import { ShallowUnwrapRef } from 'vue';
import { SortOrderType as SortOrderType_2 } from '../../composables/system/datatableColumns';
import { UseApiFetchListReturnType as UseApiFetchListReturnType_2 } from '../api/useApiFetchList';
import { UseDebounceFnReturn } from '@vueuse/shared';
import { UserAdminConfigDataFilterBookmark as UserAdminConfigDataFilterBookmark_2 } from '../../types/UserAdminConfig';
import { UserAdminConfigDataPinnedWidgets as UserAdminConfigDataPinnedWidgets_2 } from '../../types/UserAdminConfig';
import { VNode } from 'vue';
import { VNodeProps } from 'vue';

declare const __VLS_component: DefineComponent<__VLS_PublicProps, {
submit: () => void;
reset: () => void;
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"update:datatableHiddenColumns": (value: string[] | undefined) => any;
"update:showDetail": (value: boolean) => any;
} & {
reset: () => any;
submit: () => any;
bookmarkLoadAfter: () => any;
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
onReset?: (() => any) | undefined;
onSubmit?: (() => any) | undefined;
"onUpdate:datatableHiddenColumns"?: ((value: string[] | undefined) => any) | undefined;
onBookmarkLoadAfter?: (() => any) | undefined;
"onUpdate:showDetail"?: ((value: boolean) => any) | undefined;
}>, {
userId: IntegerIdNullable;
enableTop: boolean;
hideButtons: boolean;
client: () => AxiosInstance;
formName: string;
store: FilterStoreIdentifier | boolean;
alwaysVisible: boolean;
hideMore: boolean;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

declare const __VLS_component_2: DefineComponent<__VLS_PublicProps_2, {
submit: () => void;
reset: () => void;
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"update:datatableHiddenColumns": (value: string[] | undefined) => any;
} & {
reset: () => any;
submit: () => any;
bookmarkLoadAfter: () => any;
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
onReset?: (() => any) | undefined;
onSubmit?: (() => any) | undefined;
"onUpdate:datatableHiddenColumns"?: ((value: string[] | undefined) => any) | undefined;
onBookmarkLoadAfter?: (() => any) | undefined;
}>, {
userId: IntegerIdNullable;
hideButtons: boolean;
client: () => AxiosInstance;
formName: string;
disableFilterUrlSync: boolean;
store: FilterStoreIdentifier | boolean;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

declare const __VLS_component_3: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
placeholder: string;
dataCy: string;
allowed: TimeIntervalToolsValue[];
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

declare type __VLS_PrettifyLocal<T> = {
    [K in keyof T]: T[K];
} & {};

declare type __VLS_PrettifyLocal_2<T> = {
    [K in keyof T]: T[K];
} & {};

declare type __VLS_PrettifyLocal_3<T> = {
    [K in keyof T]: T[K];
} & {};

declare type __VLS_Props = {
    enableTop?: boolean;
    hideButtons?: boolean;
    formName?: string;
    userId?: IntegerIdNullable | undefined;
    client?: (() => AxiosInstance) | undefined;
    store?: FilterStoreIdentifier | boolean;
    alwaysVisible?: boolean;
    hideMore?: boolean;
};

declare type __VLS_Props_10 = {
    variant?: 'id' | 'createdAt' | 'most-relevant';
    customOptions?: undefined | DatatableOrderingOptions;
    paginationUpdateCustomCb?: ((option: DatatableOrderingOption, pagination: Ref<Pagination>) => void) | undefined;
};

declare type __VLS_Props_11 = {
    itemsPerPageOptions?: number[];
    hideRecordsPerPage?: boolean;
};

declare type __VLS_Props_2 = {
    hideButtons?: boolean;
    formName?: string;
    disableFilterUrlSync?: boolean;
    userId?: IntegerIdNullable | undefined;
    client?: (() => AxiosInstance) | undefined;
    store?: FilterStoreIdentifier | boolean;
};

declare type __VLS_Props_3 = {
    name: string;
    allT?: string;
    trueT?: string;
    falseT?: string;
    dataCy?: string;
};

declare type __VLS_Props_4 = {
    name: string;
    dataCy?: string;
};

declare type __VLS_Props_5 = {
    name: string;
    placeholder?: string | undefined;
    dataCy?: string;
};

declare type __VLS_Props_6 = {
    name: string;
    fetchItemsMinimal: FetchItemsMinimalType;
    fetchItemsMinimalByIds: FetchItemsMinimalByIdsType;
    filterByField: string;
    filterSortBy?: DatatableSortBy;
    placeholder?: string | undefined;
    prefetch?: 'hover' | 'focus' | 'mounted' | false;
    searchMinChars?: number;
    itemTitle?: string;
    itemValue?: string;
};

declare type __VLS_Props_7 = {
    name: string;
    placeholder?: string | undefined;
    dataCy?: string;
};

declare type __VLS_Props_8 = {
    nameFrom: string;
    nameUntil: string;
    allowed?: TimeIntervalToolsValue[];
    placeholder?: string | undefined;
    dataCy?: string;
};

declare type __VLS_Props_9 = {
    name: string;
    items: ValueObjectOption<string | number>[];
};

declare type __VLS_PublicProps = {
    'datatableHiddenColumns'?: string[] | undefined;
    'showDetail'?: boolean;
} & __VLS_Props;

declare type __VLS_PublicProps_2 = {
    'datatableHiddenColumns'?: string[] | undefined;
} & __VLS_Props_2;

declare type __VLS_PublicProps_3 = {
    'modelValue'?: number;
} & __VLS_Props_10;

declare function __VLS_template(): {
    attrs: Partial<{}>;
    slots: Partial<Record<string, (_: {
        itemConfig: FilterField;
    }) => any>> & {
        top?(_: {}): any;
        bookmarks?(_: {}): any;
        search?(_: {}): any;
        buttons?(_: {}): any;
        detail?(_: {}): any;
    };
    refs: {};
    rootEl: any;
};

declare function __VLS_template_2(): {
    attrs: Partial<{}>;
    slots: Partial<Record<string, (_: {
        itemConfig: FilterField_2;
    }) => any>> & {
        bookmarks?(_: {}): any;
        detail?(_: {}): any;
        buttons?(_: {}): any;
    };
    refs: {};
    rootEl: any;
};

declare function __VLS_template_3(): {
    attrs: Partial<{}>;
    slots: {
        title?(_: {}): any;
    };
    refs: {};
    rootEl: any;
};

declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;

declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;

declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;

declare type __VLS_WithTemplateSlots<T, S> = T & {
    new (): {
        $slots: S;
    };
};

declare type __VLS_WithTemplateSlots_2<T, S> = T & {
    new (): {
        $slots: S;
    };
};

declare type __VLS_WithTemplateSlots_3<T, S> = T & {
    new (): {
        $slots: S;
    };
};

export declare const ADatatableOrdering: DefineComponent<__VLS_PublicProps_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"update:modelValue": (value: number) => any;
} & {
sortByChange: (data: DatatableOrderingOption) => any;
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
onSortByChange?: ((data: DatatableOrderingOption) => any) | undefined;
}>, {
variant: "id" | "createdAt" | "most-relevant";
customOptions: DatatableOrderingOptions;
paginationUpdateCustomCb: (option: DatatableOrderingOption, pagination: Ref<Pagination>) => void;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;

export declare const ADatatablePagination: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
itemsPerPageOptions: number[];
hideRecordsPerPage: boolean;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;

export declare const AFilterBooleanSelect: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
dataCy: string;
allT: string;
trueT: string;
falseT: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterDatetimePicker: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
dataCy: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterInteger: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
placeholder: string;
dataCy: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterRemoteAutocomplete: <T extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
    props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
        readonly onChange?: (() => any) | undefined;
    } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onChange"> & {
        name: string;
        fetchItems: (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => Promise<ValueObjectOption<T>[]>;
        fetchItemsByIds: (ids: T[]) => Promise<ValueObjectOption<T>[]>;
        filterByField: string;
        filterSortBy?: DatatableSortBy;
        prefetch?: "hover" | "focus" | "mounted" | false;
        minSearchChars?: number;
        minSearchText?: string | undefined;
        placeholder?: string | undefined;
    } & Partial<{}>> & PublicProps;
    expose(exposed: ShallowUnwrapRef<    {}>): void;
    attrs: any;
    slots: {};
    emit: (e: "change") => void;
}>) => VNode & {
    __ctx?: Awaited<typeof __VLS_setup>;
};

export declare const AFilterRemoteAutocompleteWithMinimal: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
placeholder: string;
itemTitle: string;
itemValue: string;
filterSortBy: {
key: string;
order: SortOrderType_2;
} | null;
prefetch: "hover" | "focus" | "mounted" | false;
searchMinChars: number;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterString: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{
onChange?: (() => any) | undefined;
}>, {
placeholder: string;
dataCy: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterTimeInterval: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;

export declare const AFilterValueObjectOptionsSelect: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
change: () => any;
}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{
onChange?: (() => any) | undefined;
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;

export declare const AFilterWrapper: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;

export declare const AFilterWrapperSubjectSelect: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;

export declare const AFormRemoteAutocomplete: <T extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
    props: __VLS_PrettifyLocal_2<Pick<Partial<{}> & Omit<{
        readonly onBlur?: ((data: T | T[] | null | undefined) => any) | undefined;
        readonly onFocus?: ((data: T | T[] | null | undefined) => any) | undefined;
        readonly "onUpdate:modelValue"?: ((value: T | T[] | null | undefined) => any) | undefined;
        readonly "onUpdate:selected"?: ((value: ValueObjectOption<T> | ValueObjectOption<T>[] | null) => any) | undefined;
        readonly onSearchChange?: ((data: string) => any) | undefined;
        readonly onSearchChangeDebounced?: ((data: string) => any) | undefined;
        readonly "onClick:chipClose"?: ((data: ValueObjectOption<T>) => any) | undefined;
    } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:modelValue" | "onFocus" | "onBlur" | "onUpdate:selected" | "onSearchChange" | "onSearchChangeDebounced" | "onClick:chipClose"> & ({
        modelValue: T | T[] | null | undefined;
        selected?: ValueObjectOption<T> | ValueObjectOption<T>[] | null;
    } & {
        label?: string | undefined;
        required?: boolean | undefined;
        multiple?: boolean;
        clearable?: boolean;
        v?: any;
        errorMessage?: string;
        hideDetails?: boolean;
        hideLabel?: boolean;
        fetchItems: (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => Promise<ValueObjectOption<T>[]>;
        fetchItemsByIds: (ids: T[]) => Promise<ValueObjectOption<T>[]>;
        filterByField: string;
        filterSortBy?: DatatableSortBy;
        loading?: boolean;
        collab?: CollabComponentConfig;
        disabled?: boolean | undefined;
        readonly?: boolean;
        chips?: boolean;
        closableChips?: boolean;
        disableAutoSingleSelect?: boolean;
        prefetch?: "hover" | "focus" | "mounted" | false;
        minSearchChars?: number;
        minSearchText?: string | undefined;
    }) & Partial<{}>> & PublicProps;
    expose(exposed: ShallowUnwrapRef<    {
    tryLoadModelValue: (tryLoadValue: T | T[] | null | undefined, prefetch?: boolean) => Promise<boolean | undefined>;
    }>): void;
    attrs: any;
    slots: {
        locked?(_: {
            userId: number;
        }): any;
        append?(_: {}): any;
    };
    emit: {
        (e: "searchChange", data: string): void;
        (e: "searchChangeDebounced", data: string): void;
        (e: "blur", data: T | T[] | null | undefined): void;
        (e: "focus", data: T | T[] | null | undefined): void;
        (e: "click:chipClose", data: ValueObjectOption<T>): void;
    } & (((evt: "update:modelValue", value: T | T[] | null | undefined) => void) & ((evt: "update:selected", value: ValueObjectOption<T> | ValueObjectOption<T>[] | null) => void));
}>) => VNode & {
    __ctx?: Awaited<typeof __VLS_setup>;
};

declare type AllowedFilterValues = number | number[] | string | string[] | null | undefined | boolean;

declare interface AnzuUserAndTimeTrackingAware extends CreatedByAware {
    createdAt: DatetimeUTC;
    modifiedAt: DatetimeUTC;
    modifiedBy: IntegerIdNullable;
}

declare interface AnzuUserMinimal extends BaseUser {
    id: IntegerId;
}

export declare const ASubjectSelect: <TItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_3<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
    props: __VLS_PrettifyLocal_3<Pick<Partial<{}> & Omit<{
        readonly "onUpdate:modelValue"?: ((data: boolean) => any) | undefined;
        readonly onOnConfirm?: ((data: TItem[]) => any) | undefined;
        readonly onOnOpen?: (() => any) | undefined;
        readonly "onUpdate:pagination"?: ((data: Pagination) => any) | undefined;
        readonly onOnPageChange?: (() => any) | undefined;
        readonly onOnFetchNextPage?: (() => any) | undefined;
    } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:modelValue" | "onOnConfirm" | "onOnOpen" | "onUpdate:pagination" | "onOnPageChange" | "onOnFetchNextPage"> & {
        selectedItems: Array<TItem>;
        pagination: Pagination;
        loading?: boolean;
        minCount?: number;
        maxCount?: number;
        modelValue?: boolean | undefined;
        dialogTitleT?: string;
        paginationMode?: "standard" | "more";
    } & Partial<{}>> & PublicProps;
    expose(exposed: ShallowUnwrapRef<    {
    open: () => void;
    }>): void;
    attrs: any;
    slots: {
        activator?(_: {
            props: {
                onClick: () => void;
            };
        }): any;
        title?(_: {}): any;
        'second-bar'?(_: {}): any;
        'second-bar-left'?(_: {}): any;
        'second-bar-right'?(_: {}): any;
        filter?(_: {}): any;
        content?(_: {}): any;
        'button-confirm-title'?(_: {}): any;
        'button-confirm-title'?(_: {}): any;
    };
    emit: {
        (e: "update:modelValue", data: boolean): void;
        (e: "update:pagination", data: Pagination): void;
        (e: "onOpen"): void;
        (e: "onPageChange"): void;
        (e: "onConfirm", data: Array<TItem>): void;
        (e: "onFetchNextPage"): void;
    };
}>) => VNode & {
    __ctx?: Awaited<typeof __VLS_setup>;
};

export declare type AxiosClientFn = () => AxiosInstance;

declare interface BaseUser {
    id?: IntegerIdNullable;
    email: string;
    person: {
        firstName: string;
        lastName: string;
        fullName: string;
    };
    avatar: {
        color: string;
        text: string;
    };
}

declare type CachedItem<T extends object> = T & {
    _loaded: boolean;
};

declare type CollabCachedUsersMap = Map<IntegerId, CachedItem<AnzuUserMinimal>>;

declare type CollabComponentConfig = undefined | {
    room: CollabRoom;
    field: CollabFieldName;
    cachedUsers: CollabCachedUsersMap;
};

declare type CollabFieldName = string;

declare type CollabRoom = string;

declare type ColumnConfig = {
    key: string;
    title?: string;
    sortable?: boolean;
    fixed?: boolean;
    maxWidth?: number;
};

export declare function createDatatableColumnsConfig(config: ColumnConfig[], columnsHidden: Ref<Array<string>>, system: string, subject: string, moreOptions?: Partial<DatatableColumnsConfigMoreOptions>): {
    columnsAll: {
        key: string;
        title?: string;
        sortable: boolean;
        fixed: boolean;
        maxWidth?: number;
    }[];
    columnsVisible: ComputedRef<any>;
    columnsHidden: Ref<string[], string[]>;
};

declare interface CreatedByAware {
    createdBy: IntegerIdNullable;
}

export declare function createFilter<F extends readonly MakeFilterOption<string>[]>(filterFields: F, store: FilterData<F>, options?: Partial<GeneralFilterOptions>): {
    filterConfig: FilterConfig<F>;
    filterData: FilterData<F>;
};

export declare function createFilterStore<F extends readonly MakeFilterOption<string>[]>(filterFields: F): FilterData<F>;

declare interface DatatableColumnsConfigMoreOptions {
    storeColumnsLocalStorage: string | boolean;
    disableActions: boolean;
    customI18n: any;
    showExpand: boolean;
}

declare type DatatableOrderingOption = {
    id: number;
    titleT: string;
    sortBy?: DatatableSortBy;
    customData?: any;
};

declare type DatatableOrderingOptions = Array<DatatableOrderingOption>;

export declare const DatatablePaginationKey: InjectionKey<Ref<Pagination>>;

declare type DatatableSortBy = {
    key: string;
    order: SortOrderType;
} | null | undefined;

/**
 * Datetime in RFC 3339 format as string.
 */
declare type DatetimeUTC = string;

/**
 * Datetime in RFC 3339 format as string + null.
 */
declare type DatetimeUTCNullable = string | null;

/**
 * UUID v4 as string.
 */
declare type DocId = string;

declare type FetchItemsMinimalByIdsType = ((ids: IntegerId[]) => Promise<any[]>) | ((ids: DocId[]) => Promise<any[]>);

declare type FetchItemsMinimalType = (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => Promise<any[]>;

declare interface FilerRenderOptions {
    skip: boolean;
    xs: number | undefined;
    sm: number | undefined;
    md: number | undefined;
    lg: number | undefined;
    xl: number | undefined;
}

export declare type FilterConfig<F extends readonly MakeFilterOption<string>[] = readonly MakeFilterOption<string>[]> = {
    general: GeneralFilterOptions;
    touched: boolean;
    fields: {
        [P in F[number]['name']]: FilterField_3;
    };
};

export declare const FilterConfigKey: InjectionKey<FilterConfig>;

export declare type FilterData<F extends readonly MakeFilterOption<string>[] = readonly MakeFilterOption<string>[]> = {
    [P in F[number]['name']]: AllowedFilterValues;
};

export declare const FilterDataKey: InjectionKey<FilterData>;

declare interface FilterField_3 {
    name: string;
    type: FilterType;
    variant: FilterVariant;
    titleT?: string;
    default: AllowedFilterValues;
    apiName: string;
    clearable: boolean;
    mandatory: boolean;
    multiple: boolean;
    advanced: boolean;
    exclude: boolean;
    related: string | undefined;
    render: FilerRenderOptions;
}

declare interface FilterHelpersMoreOptions {
    storeFiltersLocalStorage: string | boolean;
    populateUrlParams: boolean;
}

export declare const FilterInnerConfigKey: InjectionKey<FilterConfig>;

export declare const FilterInnerDataKey: InjectionKey<FilterData>;

export declare type FilterStore<T extends readonly {
    name: string;
}[]> = {
    [K in T[number]['name']]: AllowedFilterValues;
};

declare type FilterStoreIdentifier = {
    system: string;
    subject: string;
};

declare type FilterType = 'boolean' | 'datetime' | 'integer' | 'string' | 'custom' | 'timeInterval';

declare type FilterVariant = 'search' | 'lt' | 'in' | 'notIn' | 'endsWith' | 'startsWith' | 'memberOf' | 'neq' | 'gte' | 'gt' | 'eq' | 'lte' | 'custom';

declare type FilterVariant_2 = 'search' | 'lt' | 'in' | 'notIn' | 'endsWith' | 'startsWith' | 'memberOf' | 'contains' | 'neq' | 'gte' | 'gt' | 'eq' | 'lte' | 'custom';

declare interface GeneralFilterOptions {
    system?: string;
    subject?: string;
    elastic?: boolean;
    simpleFilters?: boolean;
}

export declare const generateListQuery: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>) => string;

/**
 * Integer ID.
 */
declare type IntegerId = number;

/**
 * Integer ID + null.
 */
declare type IntegerIdNullable = number | null;

declare const JOB_RESOURCE_USER_DATA_DELETE = "jobUserDataDelete";

declare interface JobBase<T extends JobBaseResource = JobBaseResource> extends AnzuUserAndTimeTrackingAware {
    readonly id: IntegerId;
    scheduledAt: DatetimeUTC;
    priority: number;
    readonly status: JobStatusType;
    readonly startedAt: DatetimeUTCNullable;
    readonly finishedAt: DatetimeUTCNullable;
    readonly lastBatchProcessedRecord: string;
    readonly batchProcessedIterationCount: number;
    readonly result: string;
    _resourceName: T;
    readonly _system: string;
}

declare type JobBaseResource = typeof JOB_RESOURCE_USER_DATA_DELETE | `job${string}`;

declare const JobStatus: {
    readonly Waiting: "waiting";
    readonly Processing: "processing";
    readonly AwaitingBatchProcess: "awaiting_batch_process";
    readonly Done: "done";
    readonly Error: "error";
};

declare type JobStatusType = (typeof JobStatus)[keyof typeof JobStatus];

export declare interface MakeFilterOption<TName extends string = string> {
    name: TName;
    default: AllowedFilterValues;
    type?: FilterType;
    variant?: FilterVariant;
    titleT?: string;
    apiName?: string;
    clearable?: boolean;
    mandatory?: boolean;
    advanced?: boolean;
    exclude?: boolean;
    related?: string | undefined;
    render?: Partial<FilerRenderOptions>;
}

export declare interface Pagination {
    sortBy: DatatableSortBy;
    page: number;
    rowsPerPage: number;
    rowsNumber: number;
    hasNextPage: null | boolean;
    currentViewCount: number;
    totalCount: number;
}

declare interface PaginationOptions {
    rowsPerPage: number;
}

declare interface SortableItemDataAware {
    id?: DocId | IntegerId;
    position: number;
}

declare const SortOrder: {
    readonly Asc: "asc";
    readonly Desc: "desc";
};

declare type SortOrderType = (typeof SortOrder)[keyof typeof SortOrder];

export declare const TimeIntervalSpecialOptions: {
    readonly CurrentMonth: "cm";
    readonly LastMonth: "lm";
    readonly Last3Months: "l3m";
    readonly Custom: "custom";
};

declare type TimeIntervalSpecialOptionsType = (typeof TimeIntervalSpecialOptions)[keyof typeof TimeIntervalSpecialOptions];

/** note: number value represents time interval in minutes, null represent unselected */
export declare type TimeIntervalToolsValue = number | TimeIntervalSpecialOptionsType | null;

declare type UrlParams = {
    [key: string]: number | string;
};

declare type UseApiAnyRequestReturnType<R, T = R> = {
    executeRequest: (urlTemplateOverride?: string, urlParamsOverride?: UrlParams | undefined, object?: T | undefined) => Promise<R>;
    abortRequest: () => void;
};

export declare const useApiFetchByIds: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig, isSearchApi?: boolean, field?: string) => UseApiFetchByIdsReturnType<R>;

declare type UseApiFetchByIdsReturnType<R> = {
    executeFetch: (ids: DocId[] | IntegerId[], urlTemplateOverride?: string, urlParamsOverride?: UrlParams | undefined) => Promise<R>;
    abortFetch: () => void;
};

/**
 * @template R Response type override, optional
 */
export declare const useApiFetchList: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiFetchListReturnType<R>;

/**
 * @template R Response type override
 */
export declare const useApiFetchListBatch: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiFetchListBatchReturnType<R>;

declare type UseApiFetchListBatchReturnType<R> = {
    executeFetch: (filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string, urlParamsOverride?: UrlParams, sortBy?: string, sortDesc?: boolean, batchSize?: number, forceElastic?: boolean) => Promise<R>;
    abortFetch: () => void;
};

declare type UseApiFetchListReturnType<R> = {
    executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean) => Promise<R>;
    abortFetch: () => void;
};

/**
 * Docs: /doc/Admin-Cms-Doc/Filters.md
 */
export declare function useApiQueryBuilder(): {
    resolveTimeIntervalFilter: (fromName: string, untilName: string, filterData: FilterData<any>, filterConfig: FilterConfig<any>, mandatory: boolean, exclude: boolean) => null | {
        from: DatetimeUTCNullable;
        until: DatetimeUTCNullable;
    };
    querySetLimit: (value: number) => void;
    querySetOffset: (page: number, limit: number) => void;
    querySetOrder: (field: string | null, desc: boolean) => void;
    queryAddFilter: (filterVariant: FilterVariant_2, field: string, value: string | number | boolean) => void;
    querySetFilters: (filterData: FilterData<any>, filterConfig: FilterConfig<any>) => void;
    queryAdd: (key: string, value: any) => void;
    queryBuild: () => string;
    q: Ref<string[], string[]>;
};

/**
 * @template T Type used for request payload, by default, same as Response type
 * @template R Response type override, optional
 */
export declare const useApiRequest: <R, T = R>(client: AxiosClientFn, method: Method, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiAnyRequestReturnType<R, T>;

export declare function useFilterHelpers<F extends readonly MakeFilterOption<string>[] = readonly MakeFilterOption<string>[]>(filterData: FilterData<F>, filterConfig: FilterConfig<F>, moreOptions?: Partial<FilterHelpersMoreOptions>): {
    loadStoredFilters: (pagination: Ref<Pagination>, callback?: AnyFn) => boolean;
    resetFilter: (pagination: Ref<Pagination>, callback?: AnyFn) => void;
    submitFilter: (pagination: Ref<Pagination>, callback?: AnyFn) => void;
    serializeFilters: (data: Record<string, AllowedFilterValues>, pagination: Ref<Pagination>, includeSort: boolean) => string;
    deserializeFilters: (hash: string) => {
        filters: Record<string, AllowedFilterValues>;
        sortBy: DatatableSortBy;
    } | null;
};

export declare function useJobApi<JobType extends JobBase = JobBase>(client: () => AxiosInstance, system: string): {
    useFetchJobList: () => UseApiFetchListReturnType_2<JobType[]>;
    fetchJob: (id: number) => Promise<JobType>;
    createJob: (data: JobType) => Promise<JobType>;
    deleteJob: (id: number) => Promise<JobType>;
};

export declare function usePagination(sortKey: string | null, sortOrder?: SortOrderType, options?: Partial<PaginationOptions>, externalPaginationRef?: Ref<Pagination>): UsePaginationReturnType;

declare interface UsePaginationReturnType {
    pagination: Ref<Pagination>;
    setSortBy: (sortBy: DatatableSortBy) => void;
    setPage: (page: number) => void;
    incrementPage: () => number;
}

export declare interface UserAdminConfig<TData = UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets> extends AnzuUserAndTimeTrackingAware, SortableItemDataAware {
    id: IntegerId;
    user: IntegerId;
    configType: UserAdminConfigTypeType;
    layoutType: UserAdminConfigLayoutTypeType;
    systemResource: string;
    customName: string;
    defaultConfig: boolean;
    data: TData;
    position: number;
    _resourceName: 'userAdminConfig';
    _system: string;
}

export declare interface UserAdminConfigDataFilterBookmark {
    filter: string;
    datatableHiddenColumns?: string[];
    sortBy?: DatatableSortBy;
}

export declare type UserAdminConfigDataPinnedWidgets<TVariant extends string = string> = Array<{
    variant: TVariant;
    position: number;
}>;

export declare const UserAdminConfigLayoutType: {
    readonly Desktop: "desktop";
    readonly Mobile: "mobile";
};

export declare const UserAdminConfigLayoutTypeDefault: "desktop";

export declare type UserAdminConfigLayoutTypeType = (typeof UserAdminConfigLayoutType)[keyof typeof UserAdminConfigLayoutType];

export declare const UserAdminConfigType: {
    readonly PinnedWidgets: "pinnedWidgets";
    readonly FilterBookmark: "filterBookmark";
};

export declare const UserAdminConfigTypeDefault: "pinnedWidgets";

export declare type UserAdminConfigTypeType = (typeof UserAdminConfigType)[keyof typeof UserAdminConfigType];

export declare function useSubjectSelect<TItem>(datatableConfig: any, datatableHiddenColumns: any, system: string, subject: string, executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean) => Promise<TItem[]>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, filterSortBy?: DatatableSortBy | null, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean, enableActions?: boolean): {
    items: Ref<TItem[], TItem[]>;
    selected: Ref<TItem[], TItem[]>;
    pagination: Ref<Pagination, Pagination>;
    columnsVisible: ComputedRef<any>;
    columnsHidden: Ref<string[], string[]>;
    columnsAll: {
        key: string;
        title?: string;
        sortable: boolean;
        fixed: boolean;
        maxWidth?: number;
    }[];
    filterTouched: Ref<boolean, boolean>;
    loading: Ref<boolean, boolean>;
    onRowClick: (event: Event) => void;
    onFetchNextPage: () => Promise<void>;
    onOpen: () => void;
    sortByChange: (option: DatatableOrderingOption) => void;
    getList: UseDebounceFnReturn<() => Promise<void>>;
    resetFilter: () => void;
    submitFilter: () => void;
};

export declare function useUserAdminConfigApi(client: () => AxiosInstance, system: string, entity?: string, endPoint?: string): {
    useFetchUserAdminConfigList: () => UseApiFetchListReturnType_2<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>[]>;
    fetchUserAdminConfig: (id: IntegerId) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
    createUserAdminConfig: (data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
    updateUserAdminConfig: (id: IntegerId, data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
    deleteUserAdminConfig: (id: IntegerId) => Promise<unknown>;
    updateUserAdminConfigPositions: (ids: IntegerId[]) => Promise<{
        userAdminConfigs: IntegerId[];
    }>;
};

export declare function useUserAdminConfigFactory(): {
    createDefaultUserAdminConfig: (system: string) => UserAdminConfig;
};

declare interface ValueObjectOption<T> {
    value: T;
    title: string;
    color?: string;
    active?: false;
    subtitle?: string;
}

export { }
