tsc相关内容
我对TypeScript还是很陌生,现在我在整个项目结构中的多个位置都有.ts文件: app/ |-scripts/ |-app.ts | |-classes/ | |-classA.ts | |-classB.ts | |-controllers/ | |-controllerA.ts | |-contr
..
我被标题所困扰,我想通过在VMM中添加 setup_vmcs_config 函数中vmx.c(arch/x86/kvm)中的 CPU_BASED_RDTSC_EXITING 标志和 然后自己处理vm_exit(请参阅:邮件列表).问题是我不能 告诉rdtsc的vm_exit是由来宾内核还是来宾vm用户引起的 空间应用程序,后一个正是我要拦截的内容.我尝试搜索 通过qe
..
我在使用WebPack,TypeScript和TS-Loader的应用程序结构和构建过程中发现了一个问题,我认为这是由TypeScript 2.1.4引起的,但显然一直存在. 您可以从我的其他帖子中看到所有详细信息: TypeScript 2.1.4破坏了webpack ts-loader中的更改 简而言之,我将Gulp和WebPack设置为/client/app.ts的入口点,目前它
..
我编写了以下代码,该代码首先刷新两个数组元素,然后尝试读取元素以测量命中/未命中延迟。 #include #include #include #include int main() { / *创建数组* / int array [100]; int i; for(i =
..
我一直在使用tsc,但是看到angular.io强调了ngc。我想知道这两者是否有优势,还是我应该选择一个。 解决方案 tsc和ngc具有不同的用途,而不是一个选择。 tsc是TypeScript编译器,如果您的应用程序是用TypeScript编写的,则需要它来生成JavaScript。 ngc是Angular特定的编译器。它不会将TypeScript代码转换为JavaScri
..
我试图用C#编写一个函数,该函数接受包含打字稿代码的字符串,并返回包含JavaScript代码的字符串。 解决方案 您可以使用 Process 要调用编译器,请在临时文件夹中指定-out file.js 并读取已编译文件的内容。 我做了一个小应用程序来做到这一点: 用法 TypeScriptCompiler.Compile(@“ C:\tmp\test.ts”);
..
我想将属性分配给类的实例,而无需了解TypeScript中的属性名称,值和值的类型。假设我们有以下 example.ts 脚本: // const someJson:string ='{“ foo”:“ bar”,“ bar”:“ baz”}' class MyClass { someProperty:boolean 构造函数(json:string){ const p
..
我正在用TypeScript编写一个Web应用程序.该应用程序使用来自Facebook的React和Relay. 我的TypeScript源代码使用TypeScript编译器TSC编译为ES6代码.然后,使用Babel将ES6代码转换为ES5代码.为了使Relay在浏览器中工作,Babel插件需要转换Relay GraphQL查询: https://facebook.github.io/relay
..
我正在努力让tsc提取我的tsconfig.json文件并编译我的.ts文件.它会遇到重复错误,我想通过tsconfig.json来避免. 我有: package.json tsconfig.json typings.json typings / main/ ...etc browser/ ...etc main.d.ts browser.d.ts sr
..
我意识到我可以使用tsc my_app.ts --target system编译我的应用程序,它将为每个导入的模块生成一个SystemJS包装的文件,这很了不起,但是它会生成匿名(无名)函数,因此我不能只是将它们串联起来到一个文件. 我曾想过要问这个问题“如何将TypeScript编译为命名的SystemJS模块",但我的目标只是将Angular2应用编译为单个文件,无论是否为SystemJ
..
我的SystemJS文件如下: (function(global) { // map tells the System loader where to look for things var map = { 'angular2-boot': 'app', // 'dist', '@angular': 'no
..
我在Angular5项目中有此import语句: import {plugins, SCECodeGenType} from 'sce-plugins/code-generation'; 这解析为我文件系统上的该路径: /Users/.../suman-chrome-extension/node_modules/sce-plugins/code-generation/index.d
..
我在tsconfig.json中具有以下设置.我添加了"es2017"来使用Array.includes.: { "compilerOptions": { "lib": [ "es6", "es2017", "dom" ], "module": "es6", "target": "es5" } } 现在,我意识到
..
我试图避免在tsconfig.json配置中使用watch: true. 通过VSCode的任务,我正在使用基本问题匹配器$tsc-watch,但在构建时不会在监视模式下启动tsc.我正在添加gulp支持,我看到有gulp-watch,但我想了解为什么$tsc-watch不能按我认为的那样工作. 解决方案 我是通过查看typescript扩展名的taskProvider.js来解决这
..
您可以将以下代码放入foo.ts文件中.我正在尝试动态生成类型.我正在做的事就是基于这个问题: 将数组映射到接口 type TypeMapping = { Boolean: boolean, String: string, Number: number, ArrayOfString: Array, } export enum Type { Boolean
..
说我有一个字符串数组: const s = ['foo', 'rolo', 'zoombaz']; 所以我会得到: type v = { foo: string, rolo: string, zoombaz: string } 奖金:理想情况下,我希望将它们映射到骆驼箱,所以如果我有: const s = ['foo', 'rolo', 'zoom-
..
说我有这个: type TypeMapping = { Boolean: boolean, String: string, Number: number, ArrayOfString: Array, ArrayOfBoolean: Array } export interface ElemType { foo: keyof Type
..
我正在寻找一种使用npm脚本同时运行tsc --watch && nodemon --watch的方法.我可以独立运行此命令,但是当我要同时运行它们时,仅执行第一个命令. 例如. 如果我有这个脚本: "scripts": { "runDeb": "set NODE_ENV=development&& tsc --watch && nodemon --watch" }
..
我有一个具有以下结构的Typescript Node.js服务器: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.ts 使用Typescript 2时,我可以将项目从src/转换为dist/文件夹,并可以使
..
当尝试转换以下包含async和await关键字的TypeScript代码 async function foo() { await bar(); } 我收到以下错误 src/aa.ts(1,7): error TS1005: ';' expected. src/aa.ts(2,11): error TS1005: ';' expected. 结果是具有此内容的.js文件
..