import { S as TransportName, g as PredicateFn } from "./hook-context-BsxU1vfN.mjs"; import { a as IffHook, i as skippable, n as ThrowIfOptions, o as iff, r as throwIf, s as iffElse, t as unless } from "./unless.hook-CVw1wX_x.mjs"; import { B as IsContextOptions, U as SkipHookName, V as isContext } from "./index-C6MN6wag.mjs"; import { HookContext } from "@feathersjs/feathers"; //#region src/predicates/and/and.predicate.d.ts /** * Returns a predicate that is `true` only when **all** given predicates are `true` (logical AND). * Supports both sync and async predicates. Short-circuits on the first `false` result. * Undefined predicates in the list are skipped. * * @example * ```ts * import { iff, and, isProvider, isMulti } from 'feathers-utils/predicates' * * app.service('users').hooks({ * before: { all: [iff(and(isProvider('external'), isMulti), checkMulti())] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/and.html */ declare const and: (...predicates: (PredicateFn | undefined)[]) => PredicateFn; declare const every: , any>>(...predicates: (PredicateFn | undefined)[]) => PredicateFn; //#endregion //#region src/predicates/is-multi/is-multi.predicate.d.ts /** * Checks if the current hook context represents a multi operation. * Returns `true` for `find`, for `create` with array data, and for `patch`/`remove` * with `id === null`. Returns `false` for `get` and `update`. * * @example * ```ts * import { iff, isMulti } from 'feathers-utils/predicates' * * app.service('users').hooks({ * before: { all: [iff(isMulti, rateLimitHook())] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/is-multi.html */ declare const isMulti: (context: H) => boolean; //#endregion //#region src/predicates/is-paginated/is-paginated.predicate.d.ts /** * Checks if the current `find` operation is paginated by inspecting * `params.paginate` and the service's pagination options via `getPaginate`. * Returns `false` for all methods other than `find` or when pagination is disabled. * * @example * ```ts * import { iff, isPaginated } from 'feathers-utils/predicates' * * app.service('users').hooks({ * after: { find: [iff(isPaginated, addTotalCountHeader())] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/is-paginated.html */ declare const isPaginated: (context: H) => boolean; //#endregion //#region src/predicates/is-provider/is-provider.predicate.d.ts /** * Returns a predicate that checks the transport provider of the service call. * Matches against `'rest'`, `'socketio'`, `'external'` (any external provider), * or `'server'` (internal call without a provider). * * @example * ```ts * import { iff, isProvider } from 'feathers-utils/predicates' * * app.service('users').hooks({ * before: { all: [iff(isProvider('external'), authenticate('jwt'))] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/is-provider.html */ declare function isProvider(...providers: TransportName[]): (context: H) => boolean; //#endregion //#region src/predicates/not/not.predicate.d.ts /** * Negates a sync or async predicate function, inverting its boolean result. * Useful for composing conditions like "not external" or "not multi". * * @example * ```ts * import { iff, not, isProvider } from 'feathers-utils/predicates' * * app.service('users').hooks({ * before: { all: [iff(not(isProvider('server')), authenticate('jwt'))] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/not.html */ declare const not: (predicate: PredicateFn) => PredicateFn; //#endregion //#region src/predicates/or/or.predicate.d.ts /** * Returns a predicate that is `true` when **any** of the given predicates is `true` (logical OR). * Supports both sync and async predicates. Short-circuits on the first `true` result. * Undefined predicates in the list are skipped. * * @example * ```ts * import { iff, or, isProvider } from 'feathers-utils/predicates' * * app.service('users').hooks({ * before: { all: [iff(or(isProvider('rest'), isProvider('socketio')), rateLimitHook())] } * }) * ``` * * @see https://utils.feathersjs.com/predicates/or.html */ declare const or: (...predicates: (PredicateFn | undefined)[]) => PredicateFn; declare const some: , any>>(...predicates: (PredicateFn | undefined)[]) => PredicateFn; //#endregion //#region src/predicates/should-skip/should-skip.predicate.d.ts /** * Returns a predicate that checks `params.skipHooks` to determine if a hook should be skipped. * Matches by hook name, hook type (e.g. `'before'`), prefixed name (e.g. `'before:myHook'`), * or `'all'` to skip everything. Designed to be used with `skippable` and `addSkip`. * * @example * ```ts * import { skippable, shouldSkip } from 'feathers-utils/predicates' * * const myHook = skippable(actualHook(), shouldSkip('myHook')) * ``` * * @see https://utils.feathersjs.com/predicates/should-skip.html */ declare const shouldSkip: (hookName: SkipHookName) => (context: H) => boolean; //#endregion export { IffHook, IsContextOptions, ThrowIfOptions, and, every, iff, iff as when, iffElse, isContext, isMulti, isPaginated, isProvider, not, or, shouldSkip, skippable, some, throwIf, unless }; //# sourceMappingURL=predicates.d.mts.map