import * as i0 from '@angular/core'; import { OnInit, ElementRef, AfterViewInit, ChangeDetectorRef, ViewContainerRef, Renderer2 } from '@angular/core'; import { ILuOnOpenSubscriber, ILuOnScrollBottomSubscriber } from '@lucca-front/ng/core'; import { ILuOptionOperator, LuOptionPickerAdvancedComponent, ILuOptionItem, LuOptionComparer } from '@lucca-front/ng/option'; import { Observable, BehaviorSubject, Subject } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { FormControl, ControlValueAccessor } from '@angular/forms'; import { Overlay } from '@angular/cdk/overlay'; import { ALuSelectInputComponent } from '@lucca-front/ng/select'; interface ILuApiSuggestion { relevance: unknown; item: T; } interface ILuApiItem { id: TId; name?: string; } interface ILuApiResponse { data: D; } type ILuApiCollectionResponse = ILuApiResponse<{ items: T[]; }>; interface ILuApiService { getAll(filters?: string[]): Observable; getPaged(page: number, filters?: string[]): Observable; searchAll(clue: string, filters?: string[]): Observable; searchPaged(clue: string, page: number, filters?: string[]): Observable; } declare abstract class ALuApiService implements ILuApiService { abstract getAll(filters?: string[]): Observable; abstract getPaged(page: number, filters?: string[]): Observable; abstract searchAll(clue: string, filters?: string[]): Observable; abstract searchPaged(clue: string, page: number, filters?: string[]): Observable; } declare class LuApiV3Service extends ALuApiService { protected _http: HttpClient; protected _api: string; set api(api: string); protected _fields: string; set fields(fields: string); protected _filters: string[]; set filters(filters: string[]); protected _orderBy: string; set orderBy(orderBy: string); get url(): string; constructor(_http: HttpClient); getAll(filters?: string[]): Observable; getPaged(page: number, filters?: string[]): Observable; searchAll(clue: string, filters?: string[]): Observable; searchPaged(clue: string, page: number, filters?: string[]): Observable; protected _get(url: string): Observable; protected _clueFilter(clue: string): string; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } declare class LuApiV4Service extends ALuApiService { protected _http: HttpClient; protected _api: string; set api(api: string); protected _filters: string[]; set filters(filters: string[]); get filters(): string[]; protected _sort: string; set sort(sort: string); constructor(_http: HttpClient); getAll(filters?: string[]): Observable; getPaged(page?: number, filters?: string[]): Observable; searchAll(clue?: string, filters?: string[]): Observable; searchPaged(clue?: string, page?: number, filters?: string[]): Observable; count(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } declare class LuApiHybridService extends ALuApiService { private _http; private _v3Service; private _v4Service; private _standard; set standard(std: 'v3' | 'v4'); set api(api: string); set filters(filters: string[]); set fields(fields: string); set orderBy(orderBy: string); set sort(sort: string); private get _service(); constructor(_http: HttpClient); getAll(filters?: string[]): Observable; getPaged(page: number, filters?: string[]): Observable; searchAll(clue: string, filters?: string[]): Observable; searchPaged(clue: string, page: number, filters?: string[]): Observable; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } type ILuApiOptionFeeder = ILuOptionOperator; interface ILuApiFeederService { getAll(): Observable; } declare abstract class ALuApiOptionFeeder = ILuApiService> implements ILuApiOptionFeeder { outOptions$: BehaviorSubject; protected _service: S; constructor(service: S); onOpen(): void; } declare class LuApiFeederComponent extends ALuApiOptionFeeder> implements ILuOptionOperator, ILuOnOpenSubscriber { outOptions$: BehaviorSubject; constructor(hostService: LuApiHybridService, selfService: LuApiHybridService); set standard(standard: 'v3' | 'v4'); set api(api: string); set fields(fields: string); set filters(filters: string[]); set orderBy(orderBy: string); set sort(sort: string); static ɵfac: i0.ɵɵFactoryDeclaration, [{ optional: true; skipSelf: true; }, { self: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-api-feeder", never, { "standard": { "alias": "standard"; "required": false; }; "api": { "alias": "api"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; }, {}, never, never, true, never>; } type ILuApiOptionSearcher = ILuApiOptionFeeder; declare abstract class ALuApiOptionSearcher = ILuApiService> implements ILuApiOptionFeeder, ILuOnOpenSubscriber { protected _service: S; outOptions$: Subject; loading$: Observable; empty$: Observable; protected _clue$: Observable; set clue$(clue$: Observable); constructor(_service: S); init(): void; onOpen(): void; onClose(): void; protected initObservables(): void; abstract resetClue(): any; protected clearOptions(): void; } type ILuApiOptionPagedSearcher = ILuApiOptionSearcher; declare abstract class ALuApiOptionPagedSearcher = ILuApiService> extends ALuApiOptionSearcher implements ILuApiOptionPagedSearcher, ILuOnScrollBottomSubscriber { outOptions$: Subject; loading$: Observable; protected _loading: boolean; protected _page$: Subject; protected _isLastPage: boolean; protected _options: T[]; constructor(service: S); onOpen(): void; onScrollBottom(): void; protected initObservables(): void; abstract resetClue(): any; } declare class LuApiSearcherComponent extends ALuApiOptionSearcher> implements OnInit { searchInput: ElementRef; set standard(standard: 'v3' | 'v4'); set api(api: string); set fields(fields: string); set filters(filters: string[]); set orderBy(orderBy: string); set sort(sort: string); debounceTime: number; clueControl: FormControl; constructor(hostService: LuApiHybridService, selfService: LuApiHybridService); ngOnInit(): void; onOpen(): void; resetClue(): void; static ɵfac: i0.ɵɵFactoryDeclaration, [{ optional: true; skipSelf: true; }, { self: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-api-searcher", never, { "standard": { "alias": "standard"; "required": false; }; "api": { "alias": "api"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; }, {}, never, never, true, never>; } declare class LuApiPagedSearcherComponent extends ALuApiOptionPagedSearcher> implements OnInit { searchInput: ElementRef; set standard(standard: 'v3' | 'v4'); set api(api: string); set fields(fields: string); set filters(filters: string[]); set orderBy(orderBy: string); set sort(sort: string); debounceTime: number; clueControl: FormControl; constructor(hostService: LuApiHybridService, selfService: LuApiHybridService); ngOnInit(): void; onOpen(): void; resetClue(): void; static ɵfac: i0.ɵɵFactoryDeclaration, [{ optional: true; skipSelf: true; }, { self: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-api-paged-searcher", never, { "standard": { "alias": "standard"; "required": false; }; "api": { "alias": "api"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; }, {}, never, never, true, never>; } declare enum Strategy { append = 0, replace = 1 } type ILuApiOptionPager = ILuOptionOperator; interface ILuApiPagerService { getPaged(page: number): Observable; } declare abstract class ALuApiOptionPager = ILuApiService> implements ILuApiOptionPager, ILuOnOpenSubscriber, ILuOnScrollBottomSubscriber { protected _service: S; outOptions$: Subject; loading$: Observable; protected _loading: boolean; protected _results$: Observable<{ items: T[]; strategy: Strategy; }>; protected _options: T[]; protected _page$: Subject; protected _page: number; protected _initialized: boolean; constructor(_service: S); protected init(): void; onOpen(): void; onScrollBottom(): void; protected initObservables(): void; } declare class LuApiPagerComponent extends ALuApiOptionPager> implements ILuOptionOperator, OnInit, ILuOnScrollBottomSubscriber, ILuOnOpenSubscriber { constructor(hostService: LuApiHybridService, selfService: LuApiHybridService); set standard(standard: 'v3' | 'v4'); set api(api: string); set fields(fields: string); set filters(filters: string[]); set orderBy(orderBy: string); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, [{ optional: true; skipSelf: true; }, { self: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-api-pager", never, { "standard": { "alias": "standard"; "required": false; }; "api": { "alias": "api"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; }, {}, never, never, true, never>; } declare class LuApiSelectInputComponent extends ALuSelectInputComponent>> implements ControlValueAccessor, AfterViewInit { protected _changeDetectorRef: ChangeDetectorRef; protected _overlay: Overlay; protected _elementRef: ElementRef; protected _viewContainerRef: ViewContainerRef; protected _renderer: Renderer2; standard: 'v3' | 'v4'; api: string; /** * only works with standard="v3" */ fields: string; filters: string[]; /** * only works with standard="v3", otherwise use sort */ orderBy: string; /** * only works with standard="v4", otherwise use orderBy */ sort: string; byId: LuOptionComparer; constructor(_changeDetectorRef: ChangeDetectorRef, _overlay: Overlay, _elementRef: ElementRef, _viewContainerRef: ViewContainerRef, _renderer: Renderer2); static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-api-select", never, { "standard": { "alias": "standard"; "required": false; }; "api": { "alias": "api"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; }, {}, never, never, true, never>; } /** * @deprecated use `LuApiFeederComponent, LuApiPagedSearcherComponent, LuApiSearcherComponent, LuApiPagerComponent, LuApiSelectInputComponent` instead */ declare class LuApiSelectModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @deprecated use `LuApiFeederComponent, LuApiPagedSearcherComponent, LuApiSearcherComponent, LuApiPagerComponent, LuApiSelectInputComponent` instead */ declare class LuApiModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @deprecated use `LuApiPagedSearcherComponent, LuApiSearcherComponent` instead */ declare class LuApiSearcherModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @deprecated use `LuApiSelectInputComponent` instead */ declare class LuApiSelectInputModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { ALuApiOptionFeeder, ALuApiOptionPagedSearcher, ALuApiOptionPager, ALuApiOptionSearcher, ALuApiService, LuApiFeederComponent, LuApiHybridService, LuApiModule, LuApiPagedSearcherComponent, LuApiPagerComponent, LuApiSearcherComponent, LuApiSearcherModule, LuApiSelectInputComponent, LuApiSelectInputModule, LuApiSelectModule, LuApiV3Service, LuApiV4Service }; export type { ILuApiCollectionResponse, ILuApiFeederService, ILuApiItem, ILuApiOptionFeeder, ILuApiOptionPagedSearcher, ILuApiOptionPager, ILuApiOptionSearcher, ILuApiPagerService, ILuApiResponse, ILuApiService, ILuApiSuggestion };