Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
install tsc during build (#17)
Browse files Browse the repository at this point in the history
fixes #13
  • Loading branch information
analogrelay committed Nov 8, 2016
1 parent 2de8f98 commit 02c9813
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions makefile.shade
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var VERSION='0.1'
var FULL_VERSION='0.1'
var AUTHORS='Microsoft'

use-standard-lifecycle
k-standard-goals

default TYPESCRIPT_PROJECT_GLOB = "src/*/tsconfig.json"

var nodeDirectory = '${Path.Combine(Directory.GetCurrentDirectory(), "bin", "nodejs")}'
var nodeBin = '${ Path.Combine(nodeDirectory, "node_modules", ".bin") }'
var localTsc = '${ Path.Combine(nodeBin, "tsc") }'
var localTscExists = '${ File.Exists(localTsc) }'

#install-tsc target='initialize'
var installCommand = 'install ${E("KOREBUILD_NPM_INSTALL_OPTIONS")} --prefix "${nodeDirectory}" typescript'
npm npmCommand="${installCommand}" if="!localTscExists"
@{
E("PATH", $"{nodeBin}{Path.PathSeparator}{E("PATH")}");
Console.WriteLine("PATH:" + E("PATH"));
}
25 changes: 25 additions & 0 deletions src/Microsoft.AspNetCore.SignalR.Client.TS/EventSource.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
interface EventSourceOptions {
withcredentials: boolean
}

declare class EventSource extends EventTarget {
constructor(url: string);
constructor(url: string, configuration: EventSourceOptions);

readonly CLOSED: number;
readonly CONNECTING: number;
readonly OPEN: number;

close();

onerror: (this: this, ev: ErrorEvent) => any;
onmessage: (this: this, ev: MessageEvent) => any;
onopen: (this: this, ev: Event) => any;
addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
addEventListener(type: "open", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;

readonly readyState: number;
readonly url: string;
}

2 comments on commit 02c9813

@davidfowl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anurse move this to KoreBuild. aspnet/KoreBuild#135

@analogrelay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? a) KoreBuild is probably going away and b) Does any other project actually use TypeScript yet?

Please sign in to comment.