import { MediaMatcher } from '@angular/cdk/layout'; import { OverlayRef, Overlay } from '@angular/cdk/overlay'; import * as i0 from '@angular/core'; import { Injector, TemplateRef, ElementRef, OnInit, EventEmitter, OnChanges, SimpleChanges, SimpleChange } from '@angular/core'; import { Observable, BehaviorSubject } from 'rxjs'; import { FocusTrapFactory } from '@angular/cdk/a11y'; import { MatSelectionListChange } from '@angular/material/list'; import { Query, ResultItem, TupleTypes } from '@spinque/query-api'; import { SpinqueApiService } from '@spinque/angular-ui'; import { FormControl } from '@angular/forms'; import { DatePipe } from '@angular/common'; /** * Class that is instanciated whenever a facet overlay is created and serves as a reference for that specific overlay */ declare class SpinqueFacetOverlayRef { private overlayRef; private afterClosed$; private optionChange$; isClosed: boolean; constructor(overlayRef: OverlayRef); change(data: any): void; close(data?: any): void; afterClosed(): Observable; optionChange(): Observable; } /** * Service that manages the facet dropdowns, with a public API to open and close dropdowns. */ declare class SpinqueFacetDropdownService { private overlay; private injector; private media; private focusTrapFactory; openOverlays: SpinqueFacetOverlayRef[]; constructor(overlay: Overlay, injector: Injector, media: MediaMatcher, focusTrapFactory: FocusTrapFactory); open(template: TemplateRef, originElement?: ElementRef, height?: string | undefined): SpinqueFacetOverlayRef; closeAll(): void; private createOverlay; private attachOverlayContainer; private createInjector; private getOverlayConfig; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Directive that closes the facet dropdown when host element is clicked on. */ declare class SpinqueFacetDropdownCloseDirective { private facetDropdown; constructor(facetDropdown: SpinqueFacetDropdownService); click(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface DropdownableFacet { facetId: string; selected: any; visible?: boolean; update: () => void; clear: () => void; } /** * Component that holds a facet dropdown. Expects a facet as element content. */ declare class SpinqueFacetDropdown implements OnInit { private facetDropdown; template?: TemplateRef; facet?: DropdownableFacet; showActions: boolean; height?: string; ariaLabelClearButton?: string; ariaLabelCloseButton?: string; close: EventEmitter; private triggerElement?; constructor(facetDropdown: SpinqueFacetDropdownService); ngOnInit(): void; open(originElement: ElementRef): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Directive that triggers an inputted facet dropdown component when host element is clicked on. */ declare class SpinqueFacetDropdownTrigger { private elRef; /** * A SpinqueFacetDropdownComponenent that should be opened when the host element is clicked on */ spinqueFacetDropdownTrigger?: SpinqueFacetDropdown; constructor(elRef: ElementRef); click(): void; onKeyDown(event: KeyboardEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Renders a label string for a given facet component, indicating what is/is not selected */ declare class SpinqueFacetLabel { selected: i0.InputSignal; options: i0.InputSignal; singular: i0.InputSignal; plural: i0.InputSignal; readonly selectedOptions: i0.Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SpinqueFacetMultiList implements OnInit, OnChanges, DropdownableFacet { private api; queryStack: Query[]; sort: 'name' | 'score'; sortOrder: 'asc' | 'desc'; sortFn?: (a: object, b: object) => number; templateRef?: TemplateRef; search: boolean; searchLabel: string; count: number; scroll: boolean; scrollOffset: number; showScore: boolean; selected: string[]; singular: string; plural: string; noResults: string; noResultsSecondaryLabel: string; showNoneAsAll: boolean; optionMapping: (option: any) => any; visible: boolean; options: any[]; optionIds: string[]; filteredOptions: any[]; isLoading: i0.WritableSignal; queryControl: FormControl; error: any; queryChange: BehaviorSubject; selectedChange: EventEmitter; deselectedChange: EventEmitter; template?: TemplateRef; constructor(api: SpinqueApiService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; clear(): void; update(): void; get facetId(): string; hasRelevantChange(queryChange: SimpleChange): boolean; isEqual(a: any, b: any): boolean; getFacetOptions(offset?: number): Observable; compareOption(o1: any, o2: any): any; selectionChange(): void; deselectOne(event: MatSelectionListChange): void; setSelection(options: any[]): void; listScroll(event: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Component that contains the dropdown with facet */ declare class SpinqueFacetOverlayComponent implements OnInit { facetOverlayRef: SpinqueFacetOverlayRef; template: TemplateRef; private elementRef; animationState: 'void' | 'enter'; animationStateChanged: EventEmitter; constructor(facetOverlayRef: SpinqueFacetOverlayRef, template: TemplateRef, elementRef: ElementRef); ngOnInit(): void; onKeyDown(event: KeyboardEvent): void; z8: boolean; get dropDown(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Simple component that combines a button, SpinqueFacetDropdown and SpinqueFacetMultiList into one single * button that toggles a dropdown containing a multilist facet. */ declare class SpinqueFacetToggle { /** * The QueryStack to get the facet options for */ queryStack: Query[]; sort: 'name' | 'score'; sortOrder: 'asc' | 'desc'; sortFn?: (a: object, b: object) => number; search: boolean; searchLabel: string; count: number; scrollOffset: number; height?: string; showScore: boolean; selected: string[]; singular: string; plural: string; noResults: string; noResultsSecondaryLabel: string; optionMapping: (input: any) => any; /** * The text to display in the toggle button */ label?: string; ariaLabel?: string; ariaLabelClearButton?: string; ariaLabelCloseButton?: string; /** * Emits when the selection of the facet has changed */ selectedChange: EventEmitter; templateRef?: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SpinqueFacetNumberSlider implements OnInit, OnChanges, DropdownableFacet { private rest; queryStack: Query[]; label: string; step: number; optionMapping: ((o: ResultItem) => string) | undefined; numberFormatter: (o: string) => number; displayFormatter: ((o: number) => string) | undefined; debounceTime: number; selectedChange: EventEmitter; formField: FormControl; queryChange: BehaviorSubject; options: number[]; isLoading: boolean; _selected: number | undefined; get selected(): number | undefined; set selected(value: undefined | number | string | string[]); constructor(rest: SpinqueApiService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; get facetId(): string; update(): void; hasRelevantChange(queryChange: { previousValue: Query[] | null; currentValue: Query[] | null; firstChange: boolean; }): boolean; clear(): void; getFacetOptions(): Observable; compareOption(o1: any, o2: any): any; get min(): number; get max(): number; get range(): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SpinqueFacetDateSlider implements OnInit, OnChanges, DropdownableFacet { private datePipe; queryStack: Query[]; label: string; step: number; optionMapping: (o: ResultItem) => string; selected: string | string[] | undefined; selectedChange: EventEmitter; format: string; slider?: SpinqueFacetNumberSlider; numberToDate: (n: number) => string; dateToNumber: (n: string) => number; constructor(datePipe: DatePipe); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; get facetId(): string; update(): void; clear(): void; parseSelectedChange(value: number | undefined): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { SpinqueFacetDateSlider, SpinqueFacetDropdown, SpinqueFacetDropdownCloseDirective, SpinqueFacetDropdownService, SpinqueFacetDropdownTrigger, SpinqueFacetLabel, SpinqueFacetMultiList, SpinqueFacetNumberSlider, SpinqueFacetOverlayComponent, SpinqueFacetToggle };