enum BasicTypes { number , boolean , string , object , date , function } enum BasicTypeScriptTypes { any , void } export class BasicTypeUtil { private static instance : BasicTypeUtil ; private constructor ( ) { } public static getInstance ( ) { if ( ! BasicTypeUtil . instance ) { BasicTypeUtil . instance = new BasicTypeUtil ( ) ; } return BasicTypeUtil . instance ; } param type public isJavascriptType ( type ) { if ( typeof type !== 'undefined' && type . toLowerCase ) { return type . toLowerCase ( ) in BasicTypes ; } else { return false ; } } param type public isTypeScriptType ( type ) { if ( typeof type !== 'undefined' && type . toLowerCase ) { return type . toLowerCase ( ) in BasicTypeScriptTypes ; } else { return false ; } } param type public isKnownType ( type ) { return this . isJavascriptType ( type ) || this . isTypeScriptType ( type ) ; } param type returns public getTypeUrl ( type ) { if ( this . isJavascriptType ( type ) ) { return `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/${ type }` ; } if ( this . isTypeScriptType ( type ) ) { return `https://www.typescriptlang.org/docs/handbook/basic-types.html` ; } return undefined ; } } export default BasicTypeUtil . getInstance ( ) ;