import type { Application, FeathersService, Id, NullableId, Paginated, Params, Service } from '@feathersjs/feathers'; import type { OperatorFunction } from 'rxjs'; import { Observable } from 'rxjs'; type ListStrategy = any; export 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>; } export 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; // TODO: Was , correct? rx(options?: Partial): FeathersService; // Service; // TODO: Was , correct? reset(): void; // TODO: TODO: Added during typescript migration - check! } 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; } }