tsd

Using a Typescript .d.ts file that doesn't declare a module

戏子无情 提交于 2019-12-13 18:11:22
问题 I'm using tsd to download definitions from Definitely Typed and compile into a tsd.d.ts file. I haven't been able to build yet, but when I use an import like this: import * as THREE from "three" Visual Studio intellisense is happy. However, this doesn't work for Detector.js (a three.js library for detecting webgl support), with this .d.ts file. I'm not sure what the issue is, but I did notice that the three.d.ts file exports a module (THREE) and detector.d.ts file just exports an object:

How do I add a TypeScript definitely typed definition in ASP.NET 5?

北慕城南 提交于 2019-12-06 19:49:02
问题 I'm trying to install TypeScript definition files from DefinitelyTyped within a ASP.NET v5 web project in Visual Studio 2015 RC? NuGet packages don't seem to work anymore and TSD hasn't been updated in awhile and I haven't seen a lot of good documentation for it when using it within VS. What ways are still working for the VS 2015 RC? 回答1: TSD is deprecated. The generally preferred alternative is Typings. From docs: # Install Typings CLI utility. npm install typings --global # Search for

gulp typescript throws error TS2300: Duplicate identifier 'moment'

喜你入骨 提交于 2019-12-05 21:32:43
问题 I have an Angular application generated using Yeoman gulp typescript generator. Suddenly without any apparent reason (change in project) during build typescript started throwing errors: .tmp/typings/moment/moment-node.d.ts(6,16): error TS2300: Duplicate identifier 'moment'. [22:08:34] [TypeScript] TypeScript error: .tmp/typings/moment/moment-node.d.ts(6,16): error TS2300: Duplicate identifier 'moment'. .tmp/typings/moment/moment.d.ts(8,13): error TS2300: Duplicate identifier 'moment'. See

How do I add a TypeScript definitely typed definition in ASP.NET 5?

只谈情不闲聊 提交于 2019-12-05 00:52:24
I'm trying to install TypeScript definition files from DefinitelyTyped within a ASP.NET v5 web project in Visual Studio 2015 RC? NuGet packages don't seem to work anymore and TSD hasn't been updated in awhile and I haven't seen a lot of good documentation for it when using it within VS. What ways are still working for the VS 2015 RC? TSD is deprecated . The generally preferred alternative is Typings . From docs: # Install Typings CLI utility. npm install typings --global # Search for definitions. typings search tape # Find an available definition (by name). typings search --name react # If you

How to install express in typings?

老子叫甜甜 提交于 2019-12-04 10:11:43
问题 I am trying to use expressjs in my app. After installing it using typings install express --ambient --save , I run tsc , but I get two errors: typings/main/ambient/express/index.d.ts(17,34): error TS2307: Cannot find module 'serve-static'. typings/main/ambient/express/index.d.ts(18,27): error TS2307: Cannot find module 'express-serve-static-core'. So, I tried to install both: typings install serve-static --ambient --save typings install express-serve-static --ambient --save and then I run tsc

What to do if a typings (or tsd) is not available?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 09:10:00
I was looking over the TypeScript handbook and I can't seem to find the answer. If I am using a library that no typings exist, what are my options? One is to create the typings file, but this I don't really want to do. What are my other options, I seem to remember some kind of 'declare' keyword ? Or maybe something in the tsconfig ? I assume there is a way of declaring this variable (type) globally so every time I use it, it would just work. And I presume there is a way of just declaring it only available in one file. Of course the best way would be to include a typings file but this won't

What to do if a typings (or tsd) is not available?

时光毁灭记忆、已成空白 提交于 2019-11-28 02:32:19
问题 I was looking over the TypeScript handbook and I can't seem to find the answer. If I am using a library that no typings exist, what are my options? One is to create the typings file, but this I don't really want to do. What are my other options, I seem to remember some kind of 'declare' keyword ? Or maybe something in the tsconfig ? I assume there is a way of declaring this variable (type) globally so every time I use it, it would just work. And I presume there is a way of just declaring it

When to use ambient while searching for a type definition?

大憨熊 提交于 2019-11-27 07:09:15
问题 I'm currently migrating from tsd to typings since it's deprecated. but It's not crystal clear when I need to use --ambient or not when looking for a definition. Also: is it correct to say that the goal of typings, in the longterm, is to completely move away from ambiant declatation from DefintelyTyped and only rely on the typings registry? 回答1: but It's not crystal clear when I need to use --ambient Always Ambient Stuff Stuff that changes the nature of the global environment (e.g. node.d.ts )

How should I use @types with TypeScript 2

谁说我不能喝 提交于 2019-11-27 03:16:47
So far we are used to tsd or (The better version of it) typings But now that TypeScript 2 offers the new @types feature, how should I convert my current project to work with @types? I have tsd.json (typings.json is some cases) with all the dependencies, what are the steps to do the move to TypeScript 2? What are the new best practices? Does @types support specific versions? It's very simple. Just install the definitions that you need via npm. For example if you need lodash you can do: npm install --save @types/lodash Once it's installed you can use it right away in your project. Typescript