import * as sift_lib_utils from 'sift/lib/utils'; import * as sift_lib_core from 'sift/lib/core'; import { Application, Service, FeathersService, Params, Paginated, Id, NullableId } from '@feathersjs/feathers'; import { Observable, OperatorFunction } from 'rxjs'; type ListStrategy = any; interface Options { idField: string; dataField?: string; sorter?: (query: any, options: any) => any; /** * a filter function factory */ matcher?: (query: any) => (element: any) => boolean; listStrategies?: { [name: string]: ListStrategy; }; listStrategy?: 'always' | 'smart' | 'never' | string | ListStrategy; pipe?: OperatorFunction | Array>; } interface ReactiveServiceMixin { created$: Observable; updated$: Observable; patched$: Observable; removed$: Observable; reset$: Observable; never(source$: Observable): Observable; always(source$: Observable, options: Options, args: any): Observable; smart(source$: Observable, options: Options, args: any): Observable; } declare module '@feathersjs/feathers' { interface ServiceAddons { watch(options?: Partial): ReactiveService; rx(options?: Partial): FeathersService; reset(): void; } interface ReactiveService { /** * Retrieves a list of all resources from the service. * Provider parameters will be passed as params.query */ find(params?: Params): Observable>; /** * Retrieves a single resource with the given id from the service. */ get(id: Id | string, params?: Params): Observable; /** * Creates a new resource with data. */ create(data: Partial, params?: Params): Observable; create(data: Partial, params?: Params): Observable; /** * Replaces the resource identified by id with data. * Update multiples resources with id equal `null` */ update(id: NullableId, data: T, params?: Params): Observable; /** * Merges the existing data of the resource identified by id with the new data. * Implement patch additionally to update if you want to separate between partial and full updates and support the PATCH HTTP method. * Patch multiples resources with id equal `null` */ patch(id: NullableId, data: Partial, params?: Params): Observable; /** * Removes the resource with id. * Delete multiple resources with id equal `null` */ remove(id: NullableId, params?: Params): Observable; } } declare function strategies(): ReactiveServiceMixin; declare function rx(options?: Options): (app: Application) => void; declare namespace rx { var strategy: typeof strategies; var sift: (query: sift.Query, options?: Partial) => (item: unknown, key?: sift_lib_utils.Key, owner?: any) => boolean; } export { Options, rx };