ts

Extend interface defined in .d.ts file

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my TypeScript project, I use DefinitelyTyped definitions for external js dependencies. Sometimes it might happen that these definitions are outdated. It might also happen than some libraries can add new methods at runtime, like express-validator in which you can define custom validator functions. Therefore I would like to extend those .d.ts definitions adding new methods and/or properties. So if I have my DefinitelyTyped defininiton in express-validator.d.ts : declare module ExpressValidator { export interface Validator { is(): Validator;

tsconfig.json: Build:No inputs were found in config file

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["../wwwroot/app","node_modules/*"]'. 1> The command exited with code 1. 1> Done executing task "VsTsc" -- FAILED. This is my tsconfig.json file: { "compileOnSave": true, "compilerOptions": { "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es5", "dom" ],

error TS2339: Property 'modal' does not exist on type 'JQuery'

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Typescript with AngularJS. I have a problem with modals using typed definition of jQuery library. I get the following error: 'error TS2339: Property 'modal' does not exist on type 'JQuery'.' Version: jQuery library, version 1.10.x / 2.0.x Definitions: https://github.com/borisyankov/DefinitelyTyped Code $scope.delete = function (id) { Photo.get({id: id}, function(result) { $scope.photo = result; $('#deletePhotoConfirmation').modal('show');// error line }); }; I'm referencing to jquery.d.ts in angular.d.ts <reference path="../jquery

error TS2307: Cannot find module &#039;@angular/core&#039;

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I get the following error when I tried building my application again: ERROR in ../../../node_modules/@angular/cdk/a11y/typings/aria-describer/aria-describer.d.ts(8,42): error TS2307: Cannot find module '@angular/core This error occurred while I was developing my angular application. I apparently got this whilst I was programming but I didn't notice it because the application simply just kept compiling whenever I made some changes. This error only started to prevented me from building the application this morning. Does anybody know what is

Component is part of the declaration of 2 modules

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I try to build an ionic 2 app. When I try the app in the browser with ionic serve or launch it on an emulator everything works fine. But when I try to build it every time the error ionic - app - script tast : "build" Error Type AddEvent in "PATH" / add . event . ts is part of the declarations of 2 modules : AppModule in "PATH" / app . modules . ts and AddEvent in "PATH" / add - event . module . ts . Please consider moving AddEvent in "PATH" / add - event . ts to a higher module that imports AppModule in "PATH" / app . module . ts

How to get SQL Server DateTime field in ODBC native client

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm have SQL Server table: CREATE TABLE [dbo].[Table1]( [rec_id] [int] IDENTITY(1,1) NOT NULL, [id] [int] NOT NULL, [date] [datetime] NOT NULL, [ps] [varchar](200) NULL ) ON [PRIMARY] I'm getting data by a code: status = SQLExecDirect(statement, (SQLWCHAR*)TEXT("SELECT * FROM [DBNAME].[dbo].[Table1]"), SQL_NTS); cout << "SQLExecDirect returned " << status << "\r\n"; if (status == SQL_SUCCESS_WITH_INFO || status == SQL_SUCCESS) { int rec_id; int id; char date[64]; char ps[201] = { 0 }; while (SQLFetch(statement) == SQL_SUCCESS) { SQLGetData

tsc not excluding node_modules

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: { "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] } I'm trying to upgrade an angular2/beta8 app to RC1, and I'm doing so by basically restructuring according to the Quickstart guide. I copied its tsconfig.json into my project directory. I think I've got everything else ready,but when I run tsc , I get all

FT5X06 如何应用在10寸电容屏

匿名 (未验证) 提交于 2019-12-03 00:41:02
硬件搭起来看现象,如下图: 红色区域是FT5406上报有效数据的范围(1280*600),以左上角为原点 ,X轴方向上报数据的最大值1280,Y轴方向上报的最大数据是600.。但是我用的LG的10.1寸屏,分辨率为1366*768。若想把触摸IC上报的数据和像素点的值一一对应起来,只能通过校正了。开始做校正的时候有点犯抽。竟然自己写校正算法,代码冗长不说,校准误差也特别大。 还好,后来想起了tslib这个东西。tslib是专门为电阻屏设计的一个校正库,只能校正单点触摸数据。而FT5406是支持5点触摸的。 不过只需要校正一点就可以了,这个点与其他四个点的上报数据的偏差大小无区别,只需要在驱动中做相同的消除偏差处理即可。思路有了,下面就从驱动开始说起: 1. FT5406 在Linux 3.5 中的驱动要点----数据上报过程 FT5406是通过IIC总线同CPU进行数据交互的,内核中的驱动框架符合一个典型IIC设备驱动+输入子系统(默认大家是了解IIC设备驱动和输入子系统驱动的)。硬件I/O的初始化和寄存器配置就不在这里赘述了, 照着手册来就可以了。重点看一下,数据上报过程,先看一个FT5406 原理图(图中标的是5206 ,没关系接口是一样的):: 原理图上可以看到,用到了EINT14这根中断线。通过这条中断线,差不多就能猜到上报流程了吧:当用户触摸到触摸板以后,产生中断

babel tsc webpack

匿名 (未验证) 提交于 2019-12-03 00:15:02
如果写超过es5版本的js,或者ts等。是需要babel来进行编译的。 但是babel值编译,如果遇到模块化他就无能为力了 需要webpack对其进行模块化打包功能。 通常babel编译+webpack处理模块打包压缩等,挺好的。是完美的方案 但是webpack它不老实。它想牛逼,于是他就内置了不用任何配的情况下,就支持对es6的编译环节。您只管使用webpack命令,他就支持编译+模块处理打包了。但是稍微高端的就不行,比如我要编译ts等,就需要引入ts-loader了。 前端因为浏览器目前2019年均不直接支持模块化,所以需要进行搭配来使用 如果您的代码是es6,且没有用模块,那么用chrome直接运行即可,无需任何处理,我自己测试了,chrome支持良好。 如果你不放心,或者还要支持其他浏览器,那么你可以用babel编译一下子,是的不推荐你用webpack,因为你没有用模块化功能,所以浪费了,webpack肯定要比babel重 若果您的代码有es6以及其模块化,那么推荐您直接上webpack,因为它既能处理es6普通语法,也能处理模块化。当然你可以先用babel编译成es5+webpack去处理模块化,可这不是脱了裤子放屁多次一举么 如果你的代码有ts且没有模块化,babel和tsc都行,如果你的代码ts和模块化,webpack也行就是浪费性能呗, 如果你的代码ts和模块化