import { Observable } from 'rxjs'; import { QuotePickUpType } from '@karhoo/demand-api'; import { QuotePriceType } from '@karhoo/demand-api'; import { QuotesV2 } from '@karhoo/demand-api'; import { QuotesV2SearchParams } from '@karhoo/demand-api'; import { QuoteV2Item } from '@karhoo/demand-api'; import { ServiceLevelAgreements } from '@karhoo/demand-api'; declare type QuoteFilters = { numOfPassengers: number; numOfLuggage: number; }; export declare interface QuoteItem { currencyCode: string; eta?: number | null; etaBreakdown: { from?: number | null; to?: number | null; }; finalPrice?: null; fleetCapabilities: string[]; fleetId: string; fleetLogo: string; fleetName: string; fleetPhoneNumber: string; fleetTermsAndConditions: string; id: string; quotedPrice: number | null; pickUpType?: QuotePickUpType; type: QuotePriceType | ''; vehicleClass: string; vehicleTags: string[]; vehicleType: string; vehicleList: string[]; vehicleImage: string; vehicleLuggageCapacity: number; vehiclePassengerCapacity: number; fleetDescription: string; originalQuote: QuoteV2Item; serviceLevelAgreements?: ServiceLevelAgreements | null; } export declare class QuotesBloc { private quotesService; private _filters; private _searchParams; private _locale?; private quotes$; private quotesExpired$; private noQuotesFound$; private quotesLoadingError$; private loading$; private pollingSubscription; private timerSubscription; constructor(quotesService: QuotesService); /** * Returns not-filtered quotes stream. Each iteration it is a quotes array */ get quotes(): Observable; /** * Returns matching quotes stream (by number of passengers and number of luggage filters) */ get matchingQuotes(): Observable; /** * Returns non-matching quotes stream (by number of passengers and number of luggage filters) */ get otherAvailibleQuotes(): Observable; /** * Emits value once there are no quotes available for given search params */ get noQuotesFound(): Observable; /** * Emits true/false when all quotes started/finished to load */ get loading(): Observable; /** * Emits a value once loaded quotes are expired */ get quotesExpired(): Observable; /** * Emits a value with an error if loading of quotes failed */ get quotesLoadingErrors(): Observable; /** * Gets filters value (number of passengers and number of luggage) */ get filters(): QuoteFilters; /** * Sets filters value (number of passengers and number of luggage) */ set filters(params: QuoteFilters); /** * Gets quote search params */ get searchParams(): QuotesV2SearchParams | null; /** * Sets quote search params */ set searchParams(params: QuotesV2SearchParams | null); private startLoading; private stopLoading; private isMatchingQuote; private convertValidityToMS; /** * Schedules an `quotes expired` event * @param expiresAt {number} Date in miliseconds after which `quotes expired` event is emitted */ scheduleExpiredEvent(expiresAt?: number): void; /** * Stops requesting quotes */ stopRequestingQuotes(): void; /** * Requests quotes with previous search params */ refreshQuotes(): void; /** * Requests quotes with given search params * @param params {QuotesSearchParams} search params for quotes * @param locale {string} user locale in xx-XX format e.g. en-GB or fr-FR */ requestQuotes(params: QuotesV2SearchParams, locale?: string): Promise; dispose(): void; } declare type QuotesService = Pick; declare type QuotesState = { items: QuoteItem[]; validity: number; }; export declare const transformer: (quote: QuoteV2Item) => QuoteItem; export { }