import type { IFilter, IHint, ISort } from '../../types/query';
export interface IApiResponse {
    success: boolean;
}
export interface IApiSuccess extends IApiResponse {
    displayMessage: string;
    displayMessageTitle: string;
    error: string;
    job_id: number;
}
export interface IApiPayload<T> extends IApiSuccess {
    data: T;
}
export interface IApiError extends IApiResponse {
    errno: number;
    error: string;
    trace: string;
}
/**
 * Interface for data request
 * @interface
 * @property {string} query - Text for global search
 * @property {string[]} fields - Requested columns list
 * @property {IFilter[]} filter - Filter sets
 * @property {IHint[]} hints - Additional hints for server
 * @property {ISort[]} sort - Sort sets
 * @property {number} start - Index for first request row
 * @property {number} limit - Page size for request
 */
export interface IDataTableQuery {
    /** selected scope ID */
    scopeId?: number;
    /** selected language ID */
    languageId?: number;
    /** Text for global search */
    query?: string;
    /** Requested columns list */
    fields?: string[];
    /** Filter sets */
    filter?: IFilter[];
    /** Additional hints for server */
    hints?: IHint[];
    /** Sort sets */
    sort?: ISort[];
    /** Index for first request row */
    start?: number;
    /** Page size for request */
    limit?: number;
}
/**
 * Interface for data response
 * @interface
 * @template T
 * @property {T[]} data - Data array (rows list)
 * @property {number} n_rows - Total rows count
 */
export interface IDataFetcherResponse<T> extends IApiSuccess {
    /** Data array (rows list) */
    data: T[];
    /** Total rows count */
    n_rows: number;
}
export type IDataFetcher<T extends object> = (query: IDataTableQuery & any) => Promise<IDataFetcherResponse<T>>;
export interface IChildrenFetcherResponse<T> extends IApiSuccess {
    /** Data array (rows list) */
    children: T[];
    /** Total rows count */
    n_rows: number;
}
