UNPKG

1.96 kBTypeScriptView Raw
1import { ODataVersion } from '@sap-cloud-sdk/util';
2export declare type EdmTypeCommon = EdmTypeSameConverters | EdmTypeDifferentConverters;
3export 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';
4export declare type EdmTypeDifferentConverters = 'Edm.DateTimeOffset';
5export declare type ExclusiveEdmTypeV2 = 'Edm.DateTime' | 'Edm.Time';
6export declare type ExclusiveEdmTypeV4 = 'Edm.Date' | 'Edm.Duration' | 'Edm.TimeOfDay' | 'Edm.Enum';
7export declare type EdmTypeShared<VersionT extends ODataVersion | 'any'> = VersionT extends any ? EdmTypeCommon | ExclusiveEdmTypeV2 | ExclusiveEdmTypeV4 : EdmTypeCommon | ExclusiveEdmTypeV2 | ExclusiveEdmTypeV4;
8export declare type EdmTypeSameConvertersUri = Exclude<EdmTypeSameConverters, 'Edm.Guid' | 'Edm.Decimal'>;
9/**
10 * Check whether a value is an EdmType. This will yield positive results for every string starting with `Edm.`.
11 * @param val - Value to test.
12 * @returns Whether the given value is of type [[EdmTypeShared]]
13 */
14export declare function isEdmType(val: any): val is EdmTypeShared<'any'>;
15/**
16 * EDM types that can be compared with `greaterThan`, `greaterOrEqual`, `lessThan` and `lessOrEqual`.
17 */
18export 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';
19/**
20 * Convenience function to check whether a given EDM type is of type [[OrderableEdmType]].
21 * @param edmType - Literal EDM type string to check.
22 * @returns Whether the given `edmType` is of type [[OrderableEdmType]].
23 */
24export declare function isOrderableEdmType(edmType: EdmTypeShared<'any'>): boolean;
25//# sourceMappingURL=edm-types.d.ts.map
\No newline at end of file