import * as rxjs from 'rxjs'; import { Observable, Subject, MonoTypeOperatorFunction, BehaviorSubject, ReplaySubject } from 'rxjs'; import { DataSource } from '@angular/cdk/table'; import { CollectionViewer } from '@angular/cdk/collections'; import * as i0 from '@angular/core'; import { ViewContainerRef, ElementRef, TemplateRef, PipeTransform, InjectionToken, OnChanges, OnDestroy, Renderer2, SimpleChanges } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpErrorResponse } from '@angular/common/http'; import { CdkScrollable } from '@angular/cdk/overlay'; import * as i1 from '@angular/common'; declare function memoize(props: any, name: any, descriptor: any): { configurable: boolean; value: () => any; }; declare function memoizeStream(props: any, name: any, descriptor: any): { configurable: boolean; value: () => any; }; interface DispatchEvent { data: any; key: any; } type Storage = Map; interface DataStore { push(key: any, value: any): any; pull(key: any): any; observe(key: any): Observable; clear(key: any): any; clearAll(): any; } type Timestamp = number; declare const PerishableTTL: number; interface Perishable { expiryDate?: Timestamp; [prop: string]: any; } interface CacheStore { [identifier: string]: any; } interface RepositoryLoadQuery { ids?: any[]; [prop: string]: any; } declare enum StoreStrategy { Merge = 0, Replace = 1 } declare class RepositoryCacheStore { readonly namespace: string; protected store: DataStore; constructor(namespace: string, store: DataStore); protected get storeKey(): string; setExtractIdentifierStrategy(fn: (T: any) => any): void; observeCache(): Observable>; observe(ids?: any | any[]): Observable; pull(ids?: any | any[]): T[]; push(data: T[] | T, strategy?: StoreStrategy): T[]; removeItems(ids: any | any[]): T[]; dataToIdentifier(data: T): any; set(id: any, data: T): void; clear(): void; getCache(): CacheStore; getMissingIdentifiers(ids: any | any[], outdatedAsMissing?: boolean): any[]; getOutdatedCachedIdentifiers(): string[]; isMissingIdentifier(id: any): boolean; isOutdated(datum: T, time?: Timestamp): boolean; protected extractIdentifierFn: (T: any) => any; protected cacheToList(store: CacheStore, ids?: any[]): T[]; } declare class RepositoryInvalidIdCacheStore { readonly namespace: any; protected store: DataStore; constructor(namespace: any, store: DataStore); protected get storeKey(): string; add(ids: any[] | any): any[]; push(ids: any[]): any[]; pull(): any[]; clear(): void; filterInvalidIds(ids: any[]): any[]; } declare enum UpdateCacheStrategy { Replace = 0, Merge = 1 } interface RepositoryOptions { /** * item time to live, the repository triggers queryData if the data's outdated * 0 means infinite ttl */ itemTTL?: number; } declare abstract class Repository { readonly namespace: string; protected cache: RepositoryCacheStore; protected invalidIdCache: RepositoryInvalidIdCacheStore; protected options: RepositoryOptions; constructor(namespace: string, store: DataStore, options?: RepositoryOptions); get cacheStore(): RepositoryCacheStore; abstract queryData(query?: SearchQuery & RepositoryLoadQuery): Observable; isOutdated(id: any, missingAsOutdated?: boolean): boolean; pull(ids?: any | any[]): T[]; observe(ids?: any | any[]): Observable; dataToIdentifier(datum: T): any; dataToIdentifiers(data: T[]): any[]; get(ids: any | any[], refreshOutdated?: boolean): Observable; getOne(id: any, refreshOutdated?: boolean): Observable; refresh(ids?: any | any[]): Observable; load(query?: SearchQuery & RepositoryLoadQuery, observeResults?: boolean): Observable; reload(query?: SearchQuery & RepositoryLoadQuery, observeResults?: boolean): Observable; clear(): void; markAsOutdated(ids: any | any[]): boolean; markAllAsOutdated(): boolean; markMatchingItemsAsOutdated(fn: (item: T) => boolean): boolean; updateCachedItem(id: any, data: any, refreshTTL?: boolean, strategy?: UpdateCacheStrategy): T; removeCachedItems(ids: any | any[]): T[]; cacheItems(data: T | T[], strategy?: StoreStrategy): T[]; protected _load(query?: SearchQuery & RepositoryLoadQuery, strategy?: StoreStrategy): Observable; protected setItemTTL(data: any, time?: Timestamp): T; protected loadByIds(ids: any[]): Observable; protected mergeItem(item: T, data: any): T; } type FetchQueryFilter = T; type FetchQueryFilters = FetchQueryFilter[]; interface FetchQuerySort { operand: string; direction?: 'asc' | 'desc'; } interface FetchQueryPagination { page: number; limit: number; } interface FetchQuery { filters?: FetchQueryFilters; sort?: FetchQuerySort; pagination: FetchQueryPagination; } interface SourceStore { storeChange: Observable; length: number; total: number; isChunkLoaded(start: number, end: number): boolean; observe(start: number, end?: number): Observable; fetch(query: FetchQuery): Observable<{ data: T[]; total: number; }>; clear(): void; } declare class RxCleaner { protected stream: Subject; unsubscribe(namespace: T): void; unsubscribeAll(): void; takeUntil(namespace?: T): MonoTypeOperatorFunction; complete(): void; } interface FetchedDataSourceConfig { pagination?: { page?: number; limit?: number; }; sort?: FetchQuerySort; filters?: FetchQueryFilters; fetchAtInit?: boolean; } type ReplaceFilterFn = (filter: FetchQueryFilter, index: number) => FetchQueryFilter; declare class FetchedDataSource extends DataSource { protected store: SourceStore; protected readonly _totalChange: BehaviorSubject; protected readonly _fetching: BehaviorSubject; protected readonly renderData: BehaviorSubject; protected readonly paginationChange: ReplaySubject; protected readonly filtersChange: Subject; protected readonly _reload: Subject; protected readonly sortChange: Subject; protected readonly rc: RxCleaner; protected listenchanges: boolean; protected offChanged: boolean; constructor(store: SourceStore, { pagination, sort, filters, fetchAtInit }?: FetchedDataSourceConfig); protected _filters: FetchQueryFilters; get filters(): FetchQueryFilters; set filters(filters: FetchQueryFilters); protected _sort: FetchQuerySort; get sort(): FetchQuerySort; set sort(sort: FetchQuerySort); protected _pagination: FetchQueryPagination; get pagination(): FetchQueryPagination; set pagination(pagination: FetchQueryPagination); get totalChange(): Observable; get isFetching(): boolean; get fetching(): Observable; get total(): number; get totalLoaded(): number; reload(page?: number): void; updatePagination(pagination: { page?: number; limit?: number; }): boolean; updateSort(sort: { operand?: string; direction?: 'asc' | 'desc'; }): boolean; addFilters(filters: FetchQueryFilters | FetchQueryFilter): void; connect(collectionViewer: CollectionViewer): Observable>; disconnect(collectionViewer: CollectionViewer): void; destroy(): void; protected handleOfflineChange(): void; protected updateDataChangeSubscription(): void; protected updateRenderChangeSubscription(): void; protected fetchData(): Observable<{ total: number; data: T[]; }>; } declare class PaginatedFetchedDataSource extends FetchedDataSource { protected updateRenderChangeSubscription(): void; } interface OutletDirective { viewContainer: ViewContainerRef; elementRef: ElementRef; } interface TemplateDefDirective { template: TemplateRef; } declare class UnicodeEncoder { static toBase64(value: string): string; static fromBase64(base64: string): string; static b64ToUint6(nChr: number): number; static base64DecToArr(sBase64: string, nBlocksSize?: number): Uint8Array; static uint6ToB64(nUint6: number): number; static base64EncArr(aBytes: Uint8Array): string; static UTF8ArrToStr(aBytes: Uint8Array): string; static strToUTF8Arr(sDOMStr: string): Uint8Array; } declare class Encoder { static urlBase64Decode(str: string): string; static b64decode(str: string): string; static b64DecodeUnicode(str: any): string; } declare class JwtHelperErrors { static readonly ErrorDecodeToken = "Cannot decode the token."; static readonly ErrorInvalidJWT = "The inspected token doesn't appear to be a JWT."; } declare class JwtHelper { static decodeToken(token: any): any; } declare class NumberFormatter { static microToMoney(value: number): number; static moneyToMicro(value: number): number; static truncate(value: number, precision?: number): number; static shorten(number: number, precision?: number): string; } declare function min(value: number, boundaryValue: number): number; declare function max(value: number, boundaryValue: number): number; declare function minmax(value: number, minBoundary: number, maxBoundary: number): number; declare class UrlParser { static a: HTMLAnchorElement; static getAnchor(href?: string): HTMLAnchorElement; static hostname(url?: string): string; static search(url?: string): string; static decodedHostname(url?: string): string; static extractSearchParams(url?: string): {}; static implodeSearchParams(params?: any): string; } declare class Check { static isDefined(val: any, allowNull?: boolean): boolean; static everyDefined(val: any[], allowNull?: boolean): boolean; static someDefined(val: any[], allowNull?: boolean): boolean; static propertyExists(data: any, property: PropertyKey): any; static isEqual(itemA: any, itemB: any, depth?: number): any; static isEmpty(val: string | any[] | object): boolean; } declare class ArrayUtils { static asArray(data?: any | any[]): any[]; static isArrayOfLength(subject: any, expectedLength: number): boolean; static intersect(...arrs: T[][]): T[]; static except(...arrs: T[][]): T[]; static uniq(array: T[]): T[]; } type StateMap = Map; type StateMapSource = StateMap | Iterable<[State, boolean]> | [State, boolean][]; interface StateChangeEvent { state: State; value: boolean; } declare class StateManager { protected states: StateMap; protected baseStates: StateMap; constructor(states?: StateMapSource); protected _stateChange: Subject; get stateChange(): Observable; is(state: State): boolean; not(state: State): boolean; set(state: State, value: boolean): void; active(state: State): void; deactive(state: State): void; toggle(state: State): boolean; takeWhen(state: State): MonoTypeOperatorFunction; skipWhen(state: State): MonoTypeOperatorFunction; reset(states?: StateMapSource): void; destroy(): void; } declare function coerceObject(val: T): T extends Record ? T : Record; declare function coerceNullable(value?: T, defaultValue?: T): T | null; declare function coerceObservable(data: Observable | T): Observable; declare function coerceMap(data: Map | Iterable<[K, V]> | [K, V][]): Map; declare function coerceArray(val: T | T[] | null | undefined, nullAsEmpty?: boolean): T[]; declare function coerceValue(value: T | any, allowedValues: T[], defaultValue?: T): T; type coercionFn = (value: any) => T; declare function coerceEnumerableProperty(value: any, values: T[], defaultValue?: T): T; declare function createCoerceEnumerablePropertyFn(values: T[], defaultValue?: T): coercionFn; /** * Test purpose only */ declare class DataStoreStub implements DataStore { readonly changeStream: ReplaySubject; storage: Storage; clear(key: any): void; clearAll(): void; observe(key: any): Observable; pull(key: any): any; push(key: any, value: any): any; } declare class DataStoreService implements DataStore { protected storage: Storage; protected eventStream: Subject; clear(key: any): void; clearAll(): void; pull(key: any): any; push(key: any, data?: any): any; observe(toObserve: any): rxjs.Observable; protected dispatch(event: DispatchEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare abstract class MockFactory { abstract generate(opt?: Opts): T; seed(override?: Partial, opt?: Opts): T; sperm(iteration: number, override?: Partial, opt?: Opts): T[]; } interface DummyObject { id: number; [prop: string]: any; } declare class DummyMockFactory extends MockFactory { static id: number; generate(): DummyObject; } type HydraItem = T & { '@id': string; '@type': string; '@context'?: string; }; interface HydraCollection { '@context': string; '@id': string; '@type': string; 'hydra:member': HydraItem[]; 'hydra:totalItems': number; 'hydra:view': { '@id': string; '@type': string; 'hydra:first'?: string; 'hydra:last'?: string; 'hydra:next'?: string; }; } declare class HydraFactory { static generateCollection(items: T[], total?: number, type?: string): HydraCollection; static generateItem(item: T, type?: string): HydraItem; } interface ApiHttpResponse { data: T[]; count?: number; total?: number; [prop: string]: any; } interface ApiHydraHttpResponse extends ApiHttpResponse { metadata: { '@context': string; '@id': string; '@type': string; [prop: string]: any; }; } type HydraId = string; declare class Hydra { static id(item: HydraId | object): HydraId; static normalizeResponse(response: HydraItem | HydraCollection): ApiHydraHttpResponse; } declare class ApiResponseHelper { static getDataFromResponse(response: ApiHttpResponse, returnFirstResult?: boolean): any; static getCountFromResponse(response: ApiHttpResponse): number; static getTotalFromResponse(response: ApiHttpResponse): number; } interface HttpOptions { headers?: HttpHeaders; observe?: 'body'; params?: HttpParams; [prop: string]: any; } declare abstract class HttpEndpoint { protected http: HttpClient; constructor(http: HttpClient); abstract getEndpointHost(): any; get(url: string, options?: HttpOptions): Observable; post(url: string, body: any, options?: HttpOptions): Observable; put(url: string, body: any, options?: HttpOptions): Observable; delete(url: string, options?: HttpOptions): Observable; patch(url: string, body: any, options?: HttpOptions): Observable; head(url: string, options?: HttpOptions): Observable; request(request: HttpRequest): Observable; prepareUrl(url: string): string; protected parseErrorResponse(response?: HttpErrorResponse): Observable; } declare function arrayFirst(): (source: Observable) => Observable; declare function arrayLast(): (source: Observable) => Observable; declare function mapHttpData(mapFn: (item: T) => P): (source: Observable>) => Observable>; declare function getHttpData(returnFirstResult?: boolean): (source: Observable>) => Observable; declare function mapHydraResponse(): (source: Observable) => Observable>; declare class UCFirstPipe implements PipeTransform { transform(text: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class PrependPipe implements PipeTransform { transform(token: string, prefix?: string, glue?: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class AppendPipe implements PipeTransform { transform(token: string, suffix?: string, glue?: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class CoalescePipe implements PipeTransform { transform(value: any, replaceValue: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class PadStartPipe implements PipeTransform { transform(value: any, length: number, filler: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class PadEndPipe implements PipeTransform { transform(value: any, length: number, filler: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ShortNumberPipe implements PipeTransform { transform(value: number, precision?: number): string | any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare const FLEX_SCROLL_CONTAINER: InjectionToken; declare class FlexScrollContainerComponent { cdkScrollable: CdkScrollable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class StopPropagationDirective implements OnChanges, OnDestroy { protected ref: ElementRef; protected render: Renderer2; eventName: string; protected _listener: () => void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; lockPropagation(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class CommonToolsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class CommonDevToolsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { ApiResponseHelper, AppendPipe, ArrayUtils, Check, CoalescePipe, CommonDevToolsModule, CommonToolsModule, DataStoreService, DataStoreStub, DummyMockFactory, Encoder, FLEX_SCROLL_CONTAINER, FetchedDataSource, FlexScrollContainerComponent, HttpEndpoint, Hydra, HydraFactory, JwtHelper, JwtHelperErrors, MockFactory, NumberFormatter, PadEndPipe, PadStartPipe, PaginatedFetchedDataSource, PerishableTTL, PrependPipe, Repository, RepositoryCacheStore, RepositoryInvalidIdCacheStore, RxCleaner, ShortNumberPipe, StateManager, StopPropagationDirective, StoreStrategy, UCFirstPipe, UnicodeEncoder, UpdateCacheStrategy, UrlParser, arrayFirst, arrayLast, coerceArray, coerceEnumerableProperty, coerceMap, coerceNullable, coerceObject, coerceObservable, coerceValue, createCoerceEnumerablePropertyFn, getHttpData, mapHttpData, mapHydraResponse, max, memoize, memoizeStream, min, minmax }; export type { ApiHttpResponse, ApiHydraHttpResponse, CacheStore, DataStore, DispatchEvent, DummyObject, FetchQuery, FetchQueryFilter, FetchQueryFilters, FetchQueryPagination, FetchQuerySort, FetchedDataSourceConfig, HttpOptions, HydraCollection, HydraId, HydraItem, OutletDirective, Perishable, ReplaceFilterFn, RepositoryLoadQuery, RepositoryOptions, SourceStore, StateChangeEvent, StateMap, StateMapSource, Storage, TemplateDefDirective, Timestamp, coercionFn };