UNPKG

inversify-datastore

Version:

Some utilities for the development of Google Cloud Datastore applications using Inversify

52 lines (51 loc) 1.72 kB
import { ValidationError } from "class-validator"; export declare type EntityIdentifier<T> = any; export declare class Namespaced { namespace: string | undefined; constructor(namespace?: string); } export declare class QueryRequest extends Namespaced { limit?: number; start?: string; filter: Filter[]; order?: Order; select?: string | string[]; static create(): QueryRequest; withNamespace(namespace: string): QueryRequest; withLimit(limit: number): QueryRequest; withStart(start: string): QueryRequest; withFilter(filter: Filter): QueryRequest; withOrder(order: Order): QueryRequest; withSelection(select: string | string[]): this; } export declare class Filter { static KEY: string; property: string; operator: Operator; value: string; static create(property: string, operator: Operator, value: any): Filter; constructor(property: string, operator: Operator, value: string); } export declare enum Operator { EQUAL = "=", LESS_THAN = "<", LESS_THAN_OR_EQUAL = "<=", GREATER_THAN = ">", GREATER_THAN_OR_EQUAL = ">=", HAS_ANCESTOR = "HAS_ANCESTOR" } export declare class Order { property: string; descending: boolean; static create(property: string, descending: boolean): Order; constructor(property: string, descending: boolean); } export declare class EntityValidationError extends Error { errors: ValidationError[]; constructor(errors: ValidationError[]); } export declare class PagedResponse<T> { data: T[]; endCursor?: string; moreResults?: "MORE_RESULTS_TYPE_UNSPECIFIED" | "NOT_FINISHED" | "MORE_RESULTS_AFTER_LIMIT" | "MORE_RESULTS_AFTER_CURSOR" | "NO_MORE_RESULTS"; }