芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/sift/lib/core.d.ts
import { Key, Comparator } from "./utils"; export interface Operation
{ readonly keep: boolean; readonly done: boolean; reset(): any; next(item: TItem, key?: Key, owner?: any): any; } export declare type Tester = (item: any, key?: Key, owner?: any) => boolean; export interface NamedOperation { name: string; } export declare type OperationCreator
= (params: any, parentQuery: any, options: Options, name: string) => Operation
; declare type BasicValueQuery
= { $eq?: TValue; $ne?: TValue; $lt?: TValue; $gt?: TValue; $lte?: TValue; $gte?: TValue; $in?: TValue[]; $nin?: TValue[]; $all?: TValue[]; $mod?: [number, number]; $exists?: boolean; $regex?: string | RegExp; $size?: number; $where?: ((this: TValue) => boolean) | string; $options?: "i" | "g" | "m" | "u"; $type?: Function; $not?: NestedQuery
; $or?: NestedQuery
[]; $nor?: NestedQuery
[]; $and?: NestedQuery
[]; }; declare type ArrayValueQuery
= { $elemMatch?: Query
; } & BasicValueQuery
; declare type Unpacked
= T extends (infer U)[] ? U : T; declare type ValueQuery
= TValue extends Array
? ArrayValueQuery
> : BasicValueQuery
; declare type NotObject = string | number | Date | boolean | Array
; declare type ShapeQuery
= TItemSchema extends NotObject ? {} : { [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery
; }; declare type NestedQuery
= ValueQuery
& ShapeQuery
; export declare type Query
= TItemSchema | RegExp | NestedQuery
; declare abstract class BaseOperation
implements Operation
{ readonly params: TParams; readonly owneryQuery: any; readonly options: Options; keep: boolean; done: boolean; constructor(params: TParams, owneryQuery: any, options: Options); protected init(): void; reset(): void; abstract next(item: any, key: Key, parent: any): any; } export declare abstract class NamedBaseOperation
extends BaseOperation
implements NamedOperation { readonly name: string; constructor(params: TParams, owneryQuery: any, options: Options, name: string); } declare abstract class GroupOperation extends BaseOperation
{ readonly children: Operation
[]; keep: boolean; done: boolean; constructor(params: any, owneryQuery: any, options: Options, children: Operation
[]); /** */ reset(): void; abstract next(item: any, key: Key, owner: any): any; /** */ protected childrenNext(item: any, key: Key, owner: any): void; } export declare abstract class NamedGroupOperation extends GroupOperation implements NamedOperation { readonly name: string; constructor(params: any, owneryQuery: any, options: Options, children: Operation
[], name: string); } export declare class QueryOperation
extends GroupOperation { /** */ next(item: TItem, key: Key, parent: any): void; } export declare class NestedOperation extends GroupOperation { readonly keyPath: Key[]; constructor(keyPath: Key[], params: any, owneryQuery: any, options: Options, children: Operation
[]); /** */ next(item: any, key: Key, parent: any): void; /** */ private _nextNestedValue; } export declare const createTester: (a: any, compare: Comparator) => any; export declare class EqualsOperation
extends BaseOperation
{ private _test; init(): void; next(item: any, key: Key, parent: any): void; } export declare const createEqualsOperation: (params: any, owneryQuery: any, options: Options) => EqualsOperation
; export declare class NopeOperation
extends BaseOperation
{ next(): void; } export declare const numericalOperationCreator: (createNumericalOperation: OperationCreator
) => (params: any, owneryQuery: any, options: Options, name: string) => Operation
| NopeOperation
; export declare const numericalOperation: (createTester: (any: any) => Tester) => (params: any, owneryQuery: any, options: Options, name: string) => Operation
| NopeOperation
; export declare type Options = { operations: { [identifier: string]: OperationCreator
; }; compare: (a: any, b: any) => boolean; }; export declare const containsOperation: (query: any) => boolean; export declare const createQueryOperation:
(query: Query
, owneryQuery?: any, { compare, operations }?: Partial
) => QueryOperation
; export declare const createOperationTester:
(operation: Operation
) => (item: TItem, key?: Key, owner?: any) => boolean; export declare const createQueryTester:
(query: Query
, options?: Partial
) => (item: TItem, key?: Key, owner?: any) => boolean; export {};