UNPKG

1.31 kBTypeScriptView Raw
1import BigNumber from 'bignumber.js';
2import moment from 'moment';
3import { Time, EdmTypeShared } from '../odata-common';
4import { EdmType } from './edm-types';
5/**
6 * @hidden
7 */
8export declare function edmToTs<T extends EdmType>(value: any, edmType: EdmTypeShared<'v2'>): EdmToPrimitive<T>;
9/**
10 * @hidden
11 */
12export declare function tsToEdm(value: any, edmType: EdmTypeShared<'v2'>): any;
13/**
14 * @hidden
15 * This function can be used for both Edm.DateTime and and Edm.DateTimeOffset.
16 */
17export declare function edmDateTimeToMoment(edmDateTime: string): moment.Moment;
18/**
19 * @hidden
20 * This function can be used for both Edm.DateTime and and Edm.DateTimeOffset.
21 */
22export declare function momentToEdmDateTime(momentInstance: moment.Moment): string;
23export declare type EdmToPrimitive<T extends EdmType> = T extends 'Edm.Int16' | 'Edm.Int32' | 'Edm.Single' | 'Edm.Double' | 'Edm.Float' | 'Edm.Byte' | 'Edm.SByte' ? number : T extends 'Edm.Decimal' | 'Edm.Int64' ? BigNumber : T extends 'Edm.DateTime' | 'Edm.DateTimeOffset' ? moment.Moment : T extends 'Edm.String' | 'Edm.Guid' ? string : T extends 'Edm.Boolean' ? boolean : T extends 'Edm.Time' ? Time : any;
24export { EdmToPrimitive as EdmToPrimitiveV2, edmToTs as edmToTsV2, tsToEdm as tsToEdmV2 };
25//# sourceMappingURL=payload-value-converter.d.ts.map
\No newline at end of file