import { Condition } from '@ucast/mongo2js'; import { AnyAbility } from '../PureAbility'; import { RuleOf } from '../RuleIndex'; import { ExtractSubjectType } from '../types'; export type RuleToQueryConverter = (rule: RuleOf) => R; export interface AbilityQuery { $or?: T[]; $and?: T[]; } export declare function rulesToQuery(ability: T, action: Parameters[0], subjectType: ExtractSubjectType[1]>, convert: RuleToQueryConverter): AbilityQuery | null; export declare function rulesToAST(ability: T, action: Parameters[0], subjectType: ExtractSubjectType[1]>): Condition | null;