/** https://docs.mongodb.com/manual/reference/operator/query/type/#available-types */
export declare enum BSONType {
    Double = 1,
    String = 2,
    Object = 3,
    Array = 4,
    BinData = 5,
    /** @deprecated */
    Undefined = 6,
    ObjectId = 7,
    Boolean = 8,
    Date = 9,
    Null = 10,
    Regex = 11,
    /** @deprecated */
    DBPointer = 12,
    JavaScript = 13,
    /** @deprecated */
    Symbol = 14,
    JavaScriptWithScope = 15,
    Int = 16,
    Timestamp = 17,
    Long = 18,
    Decimal = 19,
    MinKey = -1,
    MaxKey = 127
}
export declare type BSONTypeAlias = 'number' | 'double' | 'string' | 'object' | 'array' | 'binData' | 'undefined' | 'objectId' | 'bool' | 'date' | 'null' | 'regex' | 'dbPointer' | 'javascript' | 'symbol' | 'javascriptWithScope' | 'int' | 'timestamp' | 'long' | 'decimal' | 'minKey' | 'maxKey';
export declare type RegExpForString<T> = T extends string ? RegExp | T : T;
export declare type MongoAltQuery<T> = T extends Array<infer U> ? T | RegExpForString<U> : RegExpForString<T>;
/** https://docs.mongodb.com/manual/reference/operator/query/#query-selectors */
export declare type QuerySelector<T> = {
    $eq?: T;
    $gt?: T;
    $gte?: T;
    $in?: T[];
    $lt?: T;
    $lte?: T;
    $ne?: T;
    $nin?: T[];
    $not?: T extends string ? QuerySelector<T> | RegExp : QuerySelector<T>;
    /**
     * When `true`, `$exists` matches the documents that contain the field,
     * including documents where the field value is null.
     */
    $exists?: boolean;
    $type?: BSONType | BSONTypeAlias;
    $expr?: any;
    $jsonSchema?: any;
    $mod?: T extends number ? [number, number] : never;
    $regex?: T extends string ? RegExp | string : never;
    $options?: T extends string ? string : never;
    $all?: T extends Array<infer U> ? any[] : never;
    $elemMatch?: T extends Array<infer U> ? object : never;
    $size?: T extends Array<infer U> ? number : never;
};
export declare type RootQuerySelector<T> = {
    /** https://docs.mongodb.com/manual/reference/operator/query/and/#op._S_and */
    $and?: Array<FilterQuery<T>>;
    /** https://docs.mongodb.com/manual/reference/operator/query/nor/#op._S_nor */
    $nor?: Array<FilterQuery<T>>;
    /** https://docs.mongodb.com/manual/reference/operator/query/or/#op._S_or */
    $or?: Array<FilterQuery<T>>;
    /** https://docs.mongodb.com/manual/reference/operator/query/text */
    $text?: {
        $search: string;
        $language?: string;
        $caseSensitive?: boolean;
        $diacraticSensitive?: boolean;
    };
    /** https://docs.mongodb.com/manual/reference/operator/query/where/#op._S_where */
    $where?: string | Function;
    /** https://docs.mongodb.com/manual/reference/operator/query/comment/#op._S_comment */
    $comment?: string;
    [key: string]: any;
};
export declare type ObjectQuerySelector<T = any> = T extends object ? {
    [key in keyof T]?: QuerySelector<T[key]>;
} : QuerySelector<T>;
export declare type Condition<T = any> = MongoAltQuery<T> | QuerySelector<MongoAltQuery<T>>;
export declare type FilterQuery<T = any> = {
    [P in keyof T]?: Condition<T[P]>;
} & RootQuerySelector<T>;
