UNPKG

@apihawk/billia-sdk

Version:

The ApiHawk Billia SDK

100 lines 2.92 kB
import { ICatalogProductBase, IOrderLineItemSimple, ICustomerProductOption, ICustomerProduct } from '../types'; export interface ISearchParams { /** * The search query. */ q: string; /** * The maximum amount of results to be returned. */ limit?: number; /** * The REST API resource names. * By default will search in all resources. */ resource?: string[]; } /** * Generic search result object. */ export interface ISearchResult { _index: string; _type: string; _id: string; _score: number; _source: any; } /** * Article search result */ export interface ISearchResultArticle extends ISearchResult { _index: 'index[content]'; _source: ISearchResultArticleData; } /** * Article search result data */ export interface ISearchResultArticleData { id: number; parent_id: number | null; published: '1' | '0'; type: string; title: string; lang_id: string; seo_url: string; primary_category: string; featured: string; table_of_contents: string; created_at: string; updated_at: string; meta_description?: any; categories: string[]; description: string; keywords: string; tags: ISearchResultArticleDataTag[]; } interface ISearchResultArticleDataTag { name: string; value: string; } export declare function isSearchResultArticle(result: ISearchResult): result is ISearchResultArticle; /** * Catalog product search result */ export interface ISearchResultCatalogProduct extends ISearchResult { _index: 'billing[product]'; _source: ISearchResultCustomerProductData; } /** * Catalog product search result data */ export interface ISearchResultCatalogProductData extends ICatalogProductBase { } export declare function isSearchResultCatalogProduct(result: ISearchResult): result is ISearchResultCustomerProduct; /** * Customer product search result */ export interface ISearchResultCustomerProduct extends ISearchResult { _index: 'customer[product]'; _source: ISearchResultCustomerProductData; } /** * Customer product search result data */ export declare type ISearchResultCustomerProductData = ICustomerProduct; export declare function isSearchResultCustomerProduct(result: ISearchResult): result is ISearchResultCustomerProduct; export interface ISearchResultCustomerProductOption extends ISearchResult { _index: 'customer[product_option]'; _source: ICustomerProductOption; } export declare function isSearchResultCustomerProductOption(result: ISearchResult): result is ISearchResultCustomerProductOption; /** * Order (purchase) */ export interface ISearchResultOrderLine extends ISearchResult { _index: 'database[order]'; _source: IOrderLineItemSimple; } export declare function isSearchResultOrderLine(result: ISearchResult): result is ISearchResultOrderLine; export {}; //# sourceMappingURL=billia-sdk-search.types.d.ts.map