I'm using visual studio Angular2 mvc5 template and I changed model of it. And I generated model's typescript version with TypeLite. Now I have to reference the typescript but typescript system is not recognizing them even after rebuild project. It is referencing other file when I pressed F12 on model member.
Folder structure :
ProjectRoot/
app
some.component.ts
...
Scripts
...
TypeLite.Net4.tt
TypeLite.Net4.d.ts
typings (not included in project)
main (same)
ambient (same)
TypeLite (same)
index.d.ts (same)
typings.json
tsconfig.json
...
TypeLite.Net4.d.ts (represents updated model):
/// <reference path="Enums.ts" />
declare module Models {
interface BpmGraph {
Author: string;
BpmPoints: Models.BpmPoint[];
Id: number;
SongName: string;
Tags: string[];
TimedBy: string;
}
interface BpmPoint {
BpmMap: System.Collections.Generic.KeyValuePair<number, number>[];
BpmMap2: System.Tuple<number, number>[];
Bpms: number[];
GraphId: number;
Id: number;
Times: number[];
}
interface List {
Count: number;
CountEnded: number;
Id: number;
Name: string;
Tasks: Models.Task[];
}
interface Task {
Ended: boolean;
Id: number;
ListId: number;
Name: string;
}
}
declare module Models.ViewModel {
interface JSONReturnVM<T> {
element: T;
errormessage: string;
haserror: boolean;
}
}
declare module System {
interface Tuple<T1, T2> {
Item1: T1;
Item2: T2;
}
}
declare module System.Collections.Generic {
interface KeyValuePair<TKey, TValue> {
Key: TKey;
Value: TValue;
}
}
some.component.ts :
...
export class BpmHelperComponent {
constructor(private _appService: AppServiceTodoList)
{
}
get bpmGraph(): Models.List[]
{
return this._appService.todolist;
}
...
Index.d.ts (what model member is referencing, not updated) :
// Generated by typings
// Source: scripts/TypeLite.Net4.d.ts
declare module Models {
interface List {
Count: number;
CountEnded: number;
Id: number;
Name: string;
Tasks: Models.Task[];
}
interface Task {
Ended: boolean;
Id: number;
ListId: number;
Name: string;
}
}
declare module Models.ViewModel {
interface JSONReturnVM<T> {
element: T;
errormessage: string;
haserror: boolean;
}
}
typings.json :
{
"ambientDependencies": {
"bootstrap": "github:DefinitelyTyped/DefinitelyTyped/bootstrap/bootstrap.d.ts#56295f5058cac7ae458540423c50ac2dcf9fc711",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jquery": "github:DefinitelyTyped/DefinitelyTyped/jquery/jquery.d.ts#56295f5058cac7ae458540423c50ac2dcf9fc711",
"TypeLite": "file:Scripts/TypeLite.Net4.d.ts"
}
}
When I changed some.component.ts's Models.List to Models.BpmGraph, build fails saying "Build:Module 'Models' has no exported member 'BpmGraph"
What is correct way to update index.d.ts? It says 'Generated by typings' but I can't find a way to update that file.
I tried typings install but nothing changed except below message
PM> typings install --global
[?25h
+-- debug
| `-- ms
`-- mocha (global)
typings install
. – Aleksey L.-- ms
-- mocha (global) – 이시인