What is the meaning of working with Visual Studio for implicit typeScript file references?

I give TypeScript another try in version 0.9.5, leaving it alone for a while.

Among the new and old information that I found, I realized that all TypeScript files in the project would “implicitly link” to each other.

I can’t understand what this means. One of my theories is that this means that every file will be able to see all the functions, classes, etc., exported from any other file, all in the global area. (This doesn't sound like a good idea, if true.)

The problem is that I cannot be sure that any interpretation is correct, because there seem to be errors in integrating 0.9.5 with Visual Studio, so it does not do what (some) people expect.

My test is an HTML project with a TypeScript project ', created in Visual Studio 2013 with the TypeScript addon installed by the link on the project template page.

I added a second .tsfile that exports the class with a dumb name:

export class Hedgehog {
    spikes() {
        return 100;
    }
}

and also added knockout.d.tsfrom DefinitelyTyped .

In the main file, app.tsVS gives me intellisense errors if I try to use my class from app.ts:

var h = new Hedgehog(); // Could not find symbol Hedgehog

He also complains that I am trying to use any of ko:

var five = ko.observable(5); // Could not find symbol ko

This problem complains that the implicit link is not working , and there is a comment hinting at a solution, which is to manually edit the project file. However, this person changed this line of his project:

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets"
        Condition="'$(Configuration)' == 'Debug'" />

For this:

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" 
        Condition="Exists('$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets')" />

, -, ( , ?!)

. :

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />

. intellisense Knockout .ts, Hedgehog. :

import otherFile = require('otherFile');
var Hedgehog = otherFile.Hedgehog;

. JavaScript commonjs ( browserify webmake), , ( , ), , Knockout jQuery, , , DOM. , .d.ts - .

, , , . TypeScript 1.0?

:

Visual Studio , .ts, . , #. , , .js.

. 0,9,5, _references.ts . , .js Combine JavaScript ( --out ).

! , , JS? ? , " JavaScript " .

+3
2

TypeScript . , , .

Build Action (. ) TypeScriptCompile. .ts .d.ts , Build Action, , , ko .

- export. . TypeScript, , , export , ( ), import ( , ). . , , export - TypeScript, .

, , , , JQuery Knockout, (import ko = require('ko')) ($.whatever) , , , knockout.d.ts is.

+8

, :

, -, ( , ?!)

Exists Debug, intellisense. , TypeScript , .

Knockout ( ko) .

_references.TS , . ( , -, , , .)

+1

All Articles