/** * Copyright 2022 Gravwell, Inc. All rights reserved. * * Contact: [legal@gravwell.io](mailto:legal@gravwell.io) * * This software may be modified and distributed under the terms of the MIT * license. See the LICENSE file for details. */ import { Observable } from 'rxjs'; import { DateRange } from '../../../functions/searches/helpers/create-required-search-filter-observable'; import { APISubscription } from '../../../functions/utils/api-subscription'; import { RawResponseForSearchDetailsMessageReceived, RawResponseForSearchStatsMessageReceived, RawResponseForSearchStatsWithinRangeMessageReceived, RawSearchAttachedMessageReceived, RawSearchMessageReceived } from '../../../models/search/raw-search-message-received'; import { RawSearchMessageSent } from '../../../models/search/raw-search-message-sent'; import { SearchFilter } from '../../../models/search/search-filter'; import { SearchFrequencyStats, SearchStats } from '../../../models/search/search-stats'; import { RequiredSearchFilter } from '../../searches/subscribe-to-one-search/helpers'; export declare const DEBOUNCE_OPTIONS: { initialDueTime: number; step: number; maxDueTime: number; predicate: (isFinished: boolean) => boolean; }; export declare const defaultSearchFilterEntriesOffsetCount = 100; export declare const createInitialSearchFilter: (requiredValues: { defaultStart: Date; defaultEnd: Date; }) => RequiredSearchFilter; export declare const getPreviewDateRange: (props: { initialFilter: RequiredSearchFilter; searchTypeID: string; searchMessages$: Observable; rawSubscription: APISubscription; }) => Promise; export declare type MakeToStatsZoom = (props: Readonly<{ filtersByID: Record; initialFilter: RequiredSearchFilter; previewDateRange: DateRange; }>) => (raw: RawResponseForSearchStatsWithinRangeMessageReceived) => { frequencyStats: Array; filter?: SearchFilter; }; export declare const makeToStatsZoom: MakeToStatsZoom; export declare type MakeToSearchStats = (props: Readonly<{ filtersByID: Record; searchAttachMsg: RawSearchAttachedMessageReceived; }>) => (args: [RawResponseForSearchStatsMessageReceived, RawResponseForSearchDetailsMessageReceived]) => SearchStats; export declare const makeToSearchStats: MakeToSearchStats; /** * Dynamically debounces after each message, then filters out finished events, * and then sends the message in order. */ export declare const debouncedPooling: (props: Readonly<{ rawSubscription: APISubscription; message: MessageSent; }>) => (source: Observable) => Observable; export declare const emitError: () => (source: Observable) => Observable; /** * Given a list of search related observables, this function will return an * observable that emits an error when * * 1. Any of the given observable encounter an error. * 2. Ten seconds have pass and any of the given observables have not emitted a * value. This is to show end users an error message if a transport error has * occurred. See * https://github.com/gravwell/frontend-issues/issues/5851#issuecomment-1353720239. */ export declare const collectSearchObservableErrors: (...observables: Array>) => Observable;