Interface SearchDefinition<T, RawType>

interface SearchDefinition<T = any, RawType = any> {
    endpoint: string;
    hitsKey: string;
    isPost?: boolean;
    request?: (
        endpoint: string,
        query?: Record<string, any>,
        options?: RequestOptions,
    ) => Promise<Record<string, any>>;
    totalKey: string;
    transform?: (items: RawType[]) => T[] | Promise<T[]>;
}

Type Parameters

  • T = any
  • RawType = any

Properties

endpoint: string
hitsKey: string
isPost?: boolean
request?: (
    endpoint: string,
    query?: Record<string, any>,
    options?: RequestOptions,
) => Promise<Record<string, any>>
totalKey: string
transform?: (items: RawType[]) => T[] | Promise<T[]>