import * as i0 from '@angular/core'; import { InjectionToken, ModuleWithProviders } from '@angular/core'; import { ApiConfig, Query, RequestType, TupleTypes, RequestOptions, ResultsResponse, StatisticsResponse } from '@spinque/query-api'; import { HttpParams, HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; declare const ApiConfigValue: InjectionToken; /** * Main module of @spinque/angular-ui. Import with forRoot and pass an ApiConfig object. */ declare class SpinqueAngularUIModule { static forRoot(config: ApiConfig): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Function that will be called before making requests to the Spinque Query API. * Arguments passed are `queryStack`, `operation` and `options`. * * The function must return a RequestEnrichment, containing params, headers or other * options that will be added to the request made. */ type RequestEnrichmentFunc = (queryStack: Query | Query[], operation: RequestType, options: { [name: string]: any; }) => Observable; /** * Params, headers or other options to be added to a request. */ interface RequestEnrichment { params?: HttpParams | { [key: string]: any; }; headers?: { ['Authorization']: string; }; withCredentials?: boolean; } /** * Service to make requests to the Spinque Query API with. */ declare class SpinqueApiService { private config; private http; private requestEnrichtmentFuncs; constructor(config: ApiConfig, http: HttpClient); /** * Get the results of a query. */ getResults(queries: Query | Query[], options?: RequestOptions, config?: ApiConfig): Observable>; getResultPage(queries: Query | Query[], options?: RequestOptions, config?: ApiConfig): Observable>; /** * Get the statistics of a query. */ getStatistics(queries: Query | Query[], options?: RequestOptions, config?: ApiConfig): Observable; /** * Registers a function that is executed every time a request to the Spinque Query API * is made and can add params, header and other options to the request. */ addRequestEnrichment(func: RequestEnrichmentFunc): void; /** * Underlies getResults and getStatistics */ private fetch; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface ImplicitTemplateVariableFromItemMapping { $implicit: T; inferTypeFrom: (item: any) => T; } declare class InferTypeFromMappingForTemplateDirective { itemMapping: (item: any) => T; static ngTemplateContextGuard(_: InferTypeFromMappingForTemplateDirective, ctx: unknown): ctx is ImplicitTemplateVariableFromItemMapping; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "ng-template[inferTypeFrom]", never, { "itemMapping": { "alias": "inferTypeFrom"; "required": true; }; }, {}, never, never, true, never>; } export { ApiConfigValue, InferTypeFromMappingForTemplateDirective, SpinqueAngularUIModule, SpinqueApiService }; export type { ImplicitTemplateVariableFromItemMapping, RequestEnrichment, RequestEnrichmentFunc };