import { Result } from '@mtna/search-manager-ui'; import * as i0 from "@angular/core"; /** * Abstract selection service for a search feature where selection is turned on. * * This can maintain the current selection as a user interacts with the table (checking/unchecking rows), * and optionally emit when the user decides to do something with the selected item via a CTA button. * * This is is abstract and will need to be extended to define what object or primative is going * be used as the selected item. * * @author Will Davis */ export declare abstract class MtnaSearchSelectionService { /** Underlying subject to manage the action. */ private _doTheThing; /** * Emitted when the user wants to use the current selection to do something. * It is the responsibility of the consuming app to subscribe to this and * handle what happens. */ doTheThing$: import("rxjs").Observable; /** Underlying subject to hold the currently selected model. */ private _selected; /** Observable stream that contains the currently selected item. */ selected$: import("rxjs").Observable; /** * Take some action, given the currently selected model. * It is up to the consuming app to subscribe to {@link doTheThing$} * and handle what happens. * * Will not emit if nothing is selected. */ doTheThing(): void; /** * Given a search {@link Result} extract/create the model used to determine selection. * @param result The search result to get a model for * @returns A model that represents the given search {@link Result}. */ abstract getModelFromResult(result: Result): M; /** * Determine whether a model represents a specific search {@link Result}. * * @param model The model to compare with the {@link Result} * @param result The result to compare with the model * @returns Whether the model represents the result, is equivalent. */ abstract modelIsResult(model: M, result: Result): boolean; /** * Make a selection. * * @param model the model to select or undefined to indicate there is nothingn selected. */ select(model: M | undefined): void; /** * Helper method to make a selection with a search result. * Will get a model given the result and call {@link select}. * @param result The result to select or undefined if there is nothing selected. */ selectResult(result: Result | undefined): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; }