import type { QueryComposer } from '../core/query-composer'; /** * Scope callback type * * `T` is a phantom type parameter: it documents the model a scope targets and * is part of the published API surface, so it stays even though the callback * signature does not reference it. */ export type ScopeCallback = (qc: QueryComposer) => QueryComposer; /** * Scope definition * * `T` is a phantom type parameter — see {@link ScopeCallback}. */ export interface Scope { apply: (qc: QueryComposer) => QueryComposer; } /** * Create a reusable query scope * * Scopes are reusable query modifications that can be applied to any QueryComposer. * They encapsulate common query patterns like: * - Filtering for specific statuses * - Adding default ordering * - Applying pagination defaults * * @example * ```typescript * const published = scope(q => * q.where({ status: 'active' }) * ); * * const recent = scope(q => * q.orderBy('-created_at') * ); * * // Apply to query * const qc = new QueryComposer(PostSchema, 'posts') * .apply(published) * .apply(recent); * ``` */ export declare function scope(callback: ScopeCallback): Scope; /** * Create a parameterized scope * * @example * ```typescript * const byStatus = (status: string) => scope(q => * q.where({ status }) * ); * * // Apply with different values * qc.apply(byStatus('active')); * qc.apply(byStatus('pending')); * ``` */ export declare function parameterizedScope(factory: (...params: P) => ScopeCallback): (...params: P) => Scope; //# sourceMappingURL=scope.d.ts.map