@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
25 lines • 1.96 kB
TypeScript
import { ODataVersion } from '@sap-cloud-sdk/util';
export declare type EdmTypeCommon = EdmTypeSameConverters | EdmTypeDifferentConverters;
export declare type EdmTypeSameConverters = 'Edm.String' | 'Edm.Boolean' | 'Edm.Decimal' | 'Edm.Double' | 'Edm.Single' | 'Edm.Float' | 'Edm.Int16' | 'Edm.Int32' | 'Edm.Int64' | 'Edm.SByte' | 'Edm.Binary' | 'Edm.Guid' | 'Edm.Byte' | 'Edm.Any';
export declare type EdmTypeDifferentConverters = 'Edm.DateTimeOffset';
export declare type ExclusiveEdmTypeV2 = 'Edm.DateTime' | 'Edm.Time';
export declare type ExclusiveEdmTypeV4 = 'Edm.Date' | 'Edm.Duration' | 'Edm.TimeOfDay' | 'Edm.Enum';
export declare type EdmTypeShared<VersionT extends ODataVersion | 'any'> = VersionT extends any ? EdmTypeCommon | ExclusiveEdmTypeV2 | ExclusiveEdmTypeV4 : EdmTypeCommon | ExclusiveEdmTypeV2 | ExclusiveEdmTypeV4;
export declare type EdmTypeSameConvertersUri = Exclude<EdmTypeSameConverters, 'Edm.Guid' | 'Edm.Decimal'>;
/**
* Check whether a value is an EdmType. This will yield positive results for every string starting with `Edm.`.
* @param val - Value to test.
* @returns Whether the given value is of type [[EdmTypeShared]]
*/
export declare function isEdmType(val: any): val is EdmTypeShared<'any'>;
/**
* EDM types that can be compared with `greaterThan`, `greaterOrEqual`, `lessThan` and `lessOrEqual`.
*/
export declare type OrderableEdmType = 'Edm.Decimal' | 'Edm.Double' | 'Edm.Single' | 'Edm.Float' | 'Edm.Int16' | 'Edm.Int32' | 'Edm.Int64' | 'Edm.SByte' | 'Edm.Byte' | 'Edm.DateTime' | 'Edm.DateTimeOffset' | 'Edm.Time' | 'Edm.Date' | 'Edm.Duration' | 'Edm.TimeOfDay';
/**
* Convenience function to check whether a given EDM type is of type [[OrderableEdmType]].
* @param edmType - Literal EDM type string to check.
* @returns Whether the given `edmType` is of type [[OrderableEdmType]].
*/
export declare function isOrderableEdmType(edmType: EdmTypeShared<'any'>): boolean;
//# sourceMappingURL=edm-types.d.ts.map