0.1.4 • Published 6 months ago
@types/jsonquery v0.1.4
Installation
npm install --save @types/jsonquery
Summary
This package contains type definitions for jsonquery (https://github.com/eugeneware/jsonquery).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonquery.
index.d.ts
// Type definitions for jsonquery 0.1
// Project: https://github.com/eugeneware/jsonquery
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
declare function jsonquery<T>(query: jsonquery.Query<T>): NodeJS.ReadWriteStream;
declare namespace jsonquery {
function match<T>(haystack: T, predicate: Query<T>): boolean;
type Query<T> = BinaryQueryCondition<T> | QueryValue<T> | PathQuery;
interface OrQueryCondition<T> {
$or: ReadonlyArray<Query<T>>;
}
interface AndQueryCondition<T> {
$and: ReadonlyArray<Query<T>>;
}
type BinaryQueryCondition<T> = OrQueryCondition<T> | AndQueryCondition<T>;
interface BaseCondition<P> {
$lt: P;
$lte: P;
$gt: P;
$gte: P;
$mod: [number, number];
$ne: P;
$in: ReadonlyArray<P>;
$nin: ReadonlyArray<P>;
$all: ReadonlyArray<P>;
$elemMatch: Partial<P>;
}
interface PathQuery {
[path: string]: any;
}
type QueryValue<T> = {
[P in keyof T]?: T[P] | BaseCondition<T[P]>;
};
}
export = jsonquery;
Additional Details
- Last updated: Thu, 23 Dec 2021 23:34:57 GMT
- Dependencies: @types/node
- Global values: none
Credits
These definitions were written by DefinitelyTyped.