UNPKG

@comake/skl-js-engine

Version:

Standard Knowledge Language Javascript Engine

74 lines 3.03 kB
import type { Expression, Variable } from 'sparqljs'; import type { OrArray, JSONArray, JSONObject } from '../util/Types'; import type { FindOperator } from './FindOperator'; import type { InverseRelationOperatorValue } from './operator/InverseRelation'; import type { InverseRelationOrderValue } from './operator/InverseRelationOrder'; export declare type FindOptionsSelect = string[] | { [key: string]: boolean | FindOptionsSelect; }; export interface FindOneOptions { select?: FindOptionsSelect; where?: FindOptionsWhere; relations?: FindOptionsRelations; order?: FindOptionsOrder; skipFraming?: boolean; group?: Variable; entitySelectVariable?: Variable; } export declare type FindOptionsRelationsValue = boolean | FindOptionsRelations | FindOperator<InverseRelationOperatorValue, 'inverseRelation'>; export declare type FindOptionsRelations = { [k: string]: FindOptionsRelationsValue; }; export declare type FindOptionsOrderValue = 'ASC' | 'DESC' | 'asc' | 'desc' | 1 | -1; export declare type FindOptionsOrder = Record<string, FindOptionsOrderValue | FindOperator<InverseRelationOrderValue, 'inverseRelationOrder'>>; export declare type FieldPrimitiveValue = boolean | number | string | Date; export declare type JsonValueObject = { '@value': FieldPrimitiveValue | JSONObject | JSONArray; '@type': '@json'; }; export declare type LanguageValueObject = { '@value': string; '@language': string; '@direction': string; }; export declare type NonJsonValueObject = { '@value': FieldPrimitiveValue; '@type': string; }; export declare type ValueWhereFieldObject = JsonValueObject | LanguageValueObject | NonJsonValueObject; export declare type FindOptionsWhereField = OrArray<FieldPrimitiveValue> | ValueWhereFieldObject | FindOptionsWhere | OrArray<FindOperator<any, any>> | BindPattern[]; export declare type IdFindOptionsWhereField = string | FindOperator<any, 'in' | 'not' | 'equal' | 'inversePath' | 'contains'>; export declare type TypeFindOptionsWhereField = string | FindOperator<string | string[] | FindOptionsWhere, 'in' | 'not' | 'equal' | 'inverse' | 'contains'>; export interface BindPattern { expression: Expression; variable: Variable; } export interface FindOptionsWhere { type?: TypeFindOptionsWhereField; id?: IdFindOptionsWhereField; binds?: BindPattern[]; [k: string]: FindOptionsWhereField | BindPattern[] | undefined; } export interface SubQuery { select: Variable[]; where: FindOptionsWhere; groupBy?: string[]; having?: FindOptionsWhere; } export interface FindAllOptions extends FindOneOptions { offset?: number; limit?: number; skipHook?: boolean; subQueries?: SubQuery[]; } export interface FindExistsOptions { where?: FindOptionsWhere; relations?: FindOptionsRelations; } export interface FindCountOptions { where?: FindOptionsWhere; relations?: FindOptionsRelations; order?: FindOptionsOrder; offset?: number; } //# sourceMappingURL=FindOptionsTypes.d.ts.map