import { injectable } from "inversify"; import { IJsonApiResource } from "../../interfaces"; export const searchType = "search-result"; export interface ISearchAttributes { url: string; title: string; "op-id": string; "op-type": string; "parent-name"?: string; "place-type"?: string; "poi-subtypes"?: string[]; highlights: { [key: string]: string; }; body: string; thumbnail?: string; } export interface ISearchResource extends IJsonApiResource {} export interface ISearch { id?: string; swiftypeId?: string; url: string; title: string; opId: string; opType: string; highlights: { [key: string]: string; }; body: string; type: string; parentName?: string; placeType?: string; poiSubtypes?: string[]; thumbnail?: string; } @injectable() export default class Search implements ISearch { id?: string; swiftypeId?: string; url: string; title: string; opId: string; opType: string; image: string; highlights: { [key: string]: string; } = {}; body: string; type: string = searchType; parentName?: string; placeType?: string; poiSubtypes?: string[]; thumbnail: string; constructor(options?: ISearch) { Object.assign(this, options); } } export interface ISearchResultsPayload { data: ISearch[]; meta: { query: string; total: number; }; total?: number; };