UNPKG

mingo

Version:

MongoDB query language for in-memory objects

26 lines (25 loc) 1.49 kB
import type * as accumulatorOperators from "./accumulator"; import type * as expressionOperators from "./expression"; import type * as pipelineOperators from "./pipeline"; import type * as projectionOperators from "./projection"; import type * as queryOperators from "./query"; import type * as updateOperators from "./update"; import type * as windowOperators from "./window"; type ExportedFunc<T> = T extends (...args: any[]) => any ? T : never; type T_ACCUMULATOR = typeof accumulatorOperators; type T_EXPRESSION = typeof expressionOperators; type T_PIPELINE = typeof pipelineOperators; type T_PROJECTION = typeof projectionOperators; type T_QUERY = typeof queryOperators; type T_UPDATE = typeof updateOperators; type T_WINDOW = typeof windowOperators; type OpFunc<T> = ExportedFunc<T> extends (...args: infer A) => infer R ? (...args: A) => R : never; export type AccumulatorOperator = OpFunc<T_ACCUMULATOR[keyof T_ACCUMULATOR]>; export type ExpressionOperator = OpFunc<T_EXPRESSION[keyof T_EXPRESSION]>; export type PipelineOperator = OpFunc<T_PIPELINE[keyof T_PIPELINE]>; export type ProjectionOperator = OpFunc<T_PROJECTION[keyof T_PROJECTION]>; export type QueryOperator = OpFunc<T_QUERY[keyof T_QUERY]>; export type UpdateOperator = OpFunc<T_UPDATE[keyof T_UPDATE]>; export type WindowOperator = OpFunc<T_WINDOW[keyof T_WINDOW]>; export type Operator = AccumulatorOperator | ExpressionOperator | PipelineOperator | ProjectionOperator | QueryOperator | WindowOperator; export {};