UNPKG

@odata2ts/odata-query-objects

Version:

Q-Objects are the magic sauce for the odata-query-builder and allow for renaming and type conversion

43 lines (42 loc) 2.53 kB
import { ValueConverter } from "@odata2ts/converter-api"; import { UrlExpressionValueModel } from "../../param/UrlParamModel"; import { QValuePathModel } from "../QPathModel"; export type ExtractConverted<T> = T extends ValueConverter<any, infer Converted> ? Converted : never; export type InputModel<T> = QValuePathModel | ExtractConverted<T>; export declare abstract class QBasePath<ValueType extends UrlExpressionValueModel, ConvertedType> implements QValuePathModel { protected path: string; readonly converter: ValueConverter<ValueType, ConvertedType>; readonly options: { nativeIn: boolean; }; protected abstract formatValue(value: ValueType): string; constructor(path: string, converter?: ValueConverter<ValueType, ConvertedType>, options?: { nativeIn: boolean; }); protected convertInput: (value: InputModel<this["converter"]>) => string; /** * Get the path to this property. * * @returns this property path */ getPath(): string; ascending: () => import("../..").QOrderByExpression; asc: () => import("../..").QOrderByExpression; descending: () => import("../..").QOrderByExpression; desc: () => import("../..").QOrderByExpression; isNull: () => import("../..").QFilterExpression; isNotNull: () => import("../..").QFilterExpression; equals: (value: InputModel<this["converter"]> | null) => import("../..").QFilterExpression; eq: (value: InputModel<this["converter"]> | null) => import("../..").QFilterExpression; notEquals: (value: InputModel<this["converter"]> | null) => import("../..").QFilterExpression; ne: (value: InputModel<this["converter"]> | null) => import("../..").QFilterExpression; lowerThan: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; lt: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; lowerEquals: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; le: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; greaterThan: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; gt: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; greaterEquals: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; ge: (value: InputModel<this["converter"]>) => import("../..").QFilterExpression; in: (...values: InputModel<this["converter"]>[]) => import("../..").QFilterExpression; }