tsc

VSCode TypeScript problemMatcher `$tsc-watch` not watching

☆樱花仙子☆ 提交于 2020-05-12 02:56:52
问题 I'm trying to avoid having to use watch: true in a tsconfig.json configuration. Through VSCode's tasks I'm using the base problem matcher $tsc-watch but it's not launching tsc in watch mode when building. I'm adding gulp support and I see there is gulp-watch but I'd like to understand why $tsc-watch isn't working as I believe it should. 回答1: I figured this out by looking at the typescript extension's taskProvider.js . In order for tsc-watch to function the task needed option: "watch" to be

How to import KnockOut 4 in TypeScript?

孤街浪徒 提交于 2020-04-18 05:48:10
问题 This seems simple because the same code works well in simple JS file and it also has autocompletion for the ko variable's members. I have the following TypeScript code below: // both of the following import lines result in: `ko` undefined // import { ko } from "@tko/build.knockout"; import { ko } from "../node_modules/@tko/build.knockout/dist/build.knockout.es6"; alert("test: " + ko); tsconfig.json { "compilerOptions": { "removeComments": true, "preserveConstEnums": true, "sourceMap": true,

How to import KnockOut 4 in TypeScript?

孤街浪徒 提交于 2020-04-18 05:47:12
问题 This seems simple because the same code works well in simple JS file and it also has autocompletion for the ko variable's members. I have the following TypeScript code below: // both of the following import lines result in: `ko` undefined // import { ko } from "@tko/build.knockout"; import { ko } from "../node_modules/@tko/build.knockout/dist/build.knockout.es6"; alert("test: " + ko); tsconfig.json { "compilerOptions": { "removeComments": true, "preserveConstEnums": true, "sourceMap": true,

如何安装typescript-如何运行typescript

社会主义新天地 提交于 2020-03-08 12:22:32
如何安装 typescript npm install typescript -g 安装 ts 之前需要安装 node 哈 查看 ts 的版本 tsc -V 我的是 3.6.3 的版本 typescript 文件的后缀名是 ts 哈 tsc 首先要用命令编译成 js 第一步是 tsc XXXX.ts 然后在用 node 去运行 tsc 编译后的 js。 然后是 node XXXX.js 来源: https://www.cnblogs.com/IwishIcould/p/12441644.html

Maintain src/ folder structure when building to dist/ folder with Typescript 3

安稳与你 提交于 2020-02-23 09:07:56
问题 I have a typescript nodejs server with this structure: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.ts When using Typescript 2, I was able to transpile my project from the src/ to a dist/ folder and have a mirror image of my directory structure to work with. With the release of Typescript 3 they have introduced project references and changed the way code is transpiled into an output directory. Now tsc outputs to the dist/ folder in a nested way

Maintain src/ folder structure when building to dist/ folder with Typescript 3

只谈情不闲聊 提交于 2020-02-23 09:06:23
问题 I have a typescript nodejs server with this structure: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.ts When using Typescript 2, I was able to transpile my project from the src/ to a dist/ folder and have a mirror image of my directory structure to work with. With the release of Typescript 3 they have introduced project references and changed the way code is transpiled into an output directory. Now tsc outputs to the dist/ folder in a nested way

DPDK l2fwd源码学习

六月ゝ 毕业季﹏ 提交于 2020-02-14 18:35:41
1. 主函数分析 1 /* 命令行解析 2 * 参数输入 ./l2fwd -c 0x3 -n 4 -- -p 3 -q 1 3 * -c 为十六进制的分配的逻辑内核数量 4 * -n 为十进制的内存通道数量,EAL参数和程序参数用--分开 5 * -q 为分配给每个核心的收发队列数量(端口数量) 6 * -p为十六进制的分配的端口数 7 * -t 为可选默认10s打印时间间隔参数 8 */ 9 int main(int argc, char **argv) 10 { 11 struct lcore_queue_conf *qconf; 12 int ret; 13 uint16_t nb_ports; 14 uint16_t nb_ports_available = 0; 15 uint16_t portid, last_port; 16 unsigned lcore_id, rx_lcore_id; 17 unsigned nb_ports_in_mask = 0; 18 unsigned int nb_lcores = 0; 19 unsigned int nb_mbufs; 20 21 /* init EAL */ 22 /* 初始化EAL参数,并解析参数,系统函数getopt以及getopt_long, 23 * 这些处理命令行参数的函数,处理到“--”时就会停止,分割参

tsconfig常用配置解析

╄→尐↘猪︶ㄣ 提交于 2020-02-13 22:35:58
一、TypeScript编译工具安装 我们用TypeScript开发项目的时候, 编写的源文件都是以".ts"结尾的文件 ,而 ".ts"文件是无法直接被浏览器或node环境下直接运行的 ,所以必须进行编译,将".ts"的文件编译成".js"文件后才能直接运行。要想编译TypeScript文件,那么 必须使用tsc编译工具 ,需要注意的是,我们 并不是直接去安装tsc , 而是全局安装typescript ,全局安装好typescript之后,就可以在命令行工具中直接使用tsc命令了,如下图所示: 二、tsc编译工具的使用 首先我们可以在命令行中,输入 tsc --help ,即可查看tsc命令的使用帮助文档。如果直接在项目根目录下输入 tsc ,那么 tsc会将项目下的所有".ts"文件都进行编译,编译后输出的文件与源ts文件同名、同位置 。 我们可以在执行tsc命令的时候传递一些参数,进行特定的配置,如: // 编译结果采用es5,模块形式采用commonjs,编译源文件为 ts/index.ts tsc --target es5 --module commonjs ts/index.ts 对于简单的项目,我们可以通过给tsc命令传递一些参数进行编译,但是如果是大型的复杂项目,那么通过传递命令参数的形式进行编译就会显得心有余而力不足了,也不方便。我们可以采用配置文件的方式

C#调用TSC条码打印机打印条码

我的梦境 提交于 2020-02-10 07:45:33
#region 调用TSC打印机打印条码 /// <summary> /// 调用TSC打印机打印条码 /// </summary> /// <param name="title">打印的标题</param> /// <param name="barCode">打印的条码编号</param> public static void TSC(string title, string barCode) { // 打开 打印机 端口. TSCLIB_DLL.openport(p_port); // 设置标签 宽度、高度 等信息. // 宽 94mm 高 25mm // 速度为4 // 字体浓度为8 // 使用垂直間距感測器(gap sensor) // 两个标签之间的 间距为 3.5mm TSCLIB_DLL.setup("94", "25", "4", "8", "0", "3.5", "0"); // 清除缓冲信息 TSCLIB_DLL.clearbuffer(); // 发送 TSPL 指令. // 设置 打印的方向. TSCLIB_DLL.sendcommand("DIRECTION 1"); // 打印文本信息. // 在 (176, 16) 的坐标上 // 字体高度为34 // 旋转的角度为 0 度 // 2 表示 粗体. // 文字没有下划线. // 字体为 黑体. //