import * as _feathersjs_feathers from '@feathersjs/feathers'; import { HookContext, Application } from '@feathersjs/feathers'; import { LRUCache } from 'lru-cache'; import { RateLimiterMemory } from 'rate-limiter-flexible'; type Promisable = T | Promise; type SetPartial = Partial> & Omit; declare const skippable: (hookName: string, hookFunc: (context: HookContext) => Promisable) => (context: any) => any; type ContextCacheMapOptions = { map: LRUCache; } | LRUCache.Options; declare class ContextCacheMap { map: LRUCache; constructor(options?: ContextCacheMapOptions); makeCacheKey(context: any): string; makeId(id: any): any; makeResultId(record: any): any; cloneResult(context: any): any; get(context: any): Promise; set(context: any): Promise>; clear(context: any): Promise; } type SanitizeSchema = { [key: string]: string | ((str: string, key: any) => string); }; type VirtualFn = (data: Record, context: HookContext, prepResult: Record) => any; type Virtuals = Record; type PrepFunction = (context: HookContext) => Promisable; declare const contextCache: , any> = HookContext<_feathersjs_feathers.Application, any>>(cacheMap: ContextCacheMap) => (context: H) => Promise; type JoinQueryEntry = { overwrite: boolean; makeKey: (key: any) => any; makeParams: (defaultParams: any, context: HookContext, option: JoinQueryEntry) => any; service: string; targetKey: string; foreignKey: string; }; type JoinQueryOptions = { [key: string]: SetPartial; }; declare const joinQuery: , any>>(_options: JoinQueryOptions) => (context: H) => Promise; declare const jsonQueryStringify: (options?: { overwrite: boolean; propName: string; }) => (context: HookContext) => HookContext<_feathersjs_feathers.Application, any>; declare const jsonQueryParse: (options?: { overwrite: boolean; propName: string; }) => (context: HookContext) => HookContext<_feathersjs_feathers.Application, any>; declare const jsonQueryClient: (app: any) => void; declare const jsonQueryServer: (app: any) => void; declare const preventChange: (virtuals: any, prepFunc?: () => void) => (context: any) => Promise; type RateLimitOptions = { makeKey?: (context: HookContext) => string; makePoints?: (context: HookContext) => number; }; declare const rateLimit: (rateLimiter: RateLimiterMemory, _options?: RateLimitOptions) => (context: any) => Promise; type SanitizeErrorOptions = SanitizeSchema | ((context: any) => SanitizeSchema); declare const sanitizeError: (options: SanitizeErrorOptions) => (context: any) => Promise; type SanitizeResultOptions = SanitizeSchema | ((context: any) => SanitizeSchema); declare const sanitizeResult: (options: SanitizeResultOptions) => (context: any) => Promise; type SequelizeJoinQueryOptions = { makeIncludeOptions?: (association: any, context: HookContext) => any; }; declare const sequelizeJoinQuery: (options?: SequelizeJoinQueryOptions) => (context: any) => any; type StashableOptions = { propName?: string; stashFunc?: (context: HookContext) => Promise; }; declare const stashable: (_options?: StashableOptions) => (context: any) => any; /** * Add data, such as defaults to context.data in a before hook. * * Note `data` could technically be an array of multiple items * to create/update/patch. Also note that although the keys are * iterated over syncronously (in order of definition on the virtuals * object) that if data is an array, all items in the data array * are run in parallel. * * The value of each property in the virtuals object can be a function, * a promise, a function that returns a promise, or a simple value. The * virtual should return the value to be attached to the key and should * not mutate context directly. */ declare const withData: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; declare const withQuery: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; declare const withResult: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; declare const withoutData: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; declare const withoutQuery: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; declare const withoutResult: (virtuals: Virtuals, prepFunc?: PrepFunction) => (context: any) => Promise; type StrictRestQueryOptions = { arrayLimit?: number; depth?: number; parameterLimit?: number; strictNullHandling?: boolean; }; declare const strictRestQuery: (opts?: StrictRestQueryOptions) => (app: Application) => Application; export { ContextCacheMap, JoinQueryEntry, JoinQueryOptions, RateLimitOptions, SanitizeErrorOptions, SanitizeResultOptions, SequelizeJoinQueryOptions, StashableOptions, StrictRestQueryOptions, contextCache, joinQuery, jsonQueryClient, jsonQueryParse, jsonQueryServer, jsonQueryStringify, preventChange, rateLimit, sanitizeError, sanitizeResult, sequelizeJoinQuery, skippable, stashable, strictRestQuery, withData, withQuery, withResult, withoutData, withoutQuery, withoutResult };