UNPKG

node-web-mvc

Version:
22 lines (21 loc) 950 B
/** * @module TypeConverter * @description 类型转换 */ import { ClazzType } from '../interface/declare'; import { MetaRuntimeTypeInfo } from '../servlets/annotations/annotation/type'; export declare const TypedArray: any; export default class TypeConverter { private createInstance; private isInstanceof; convert(value: object, type: ClazzType, runtimeType?: MetaRuntimeTypeInfo): any; toEnum(value: any, type: object): any; toSet(value: object, type: ClazzType, runtimeType?: MetaRuntimeTypeInfo): Set<any>; toMap(data: any, type: ClazzType, runtimeType?: MetaRuntimeTypeInfo): Map<any, any>; toArray(value: object, type: ClazzType, runtimeType?: MetaRuntimeTypeInfo): any; toTypedArray(data: any, type: ClazzType): Uint8Array; private getDescriptor; toClass(data: object, dataType: ClazzType, runtimeType?: MetaRuntimeTypeInfo): any; private handlePropertyValue; private handleDateProperty; }