Merge pull request #1972 from borisyankov/support-1.0

[WIP] support 1.0
This commit is contained in:
Masahiro Wakame
2014-04-03 13:59:15 +09:00
9 changed files with 139208 additions and 73 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('./tsc.js')

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
nomnom/nomnom.d.ts vendored
View File

@@ -3,7 +3,10 @@
// Definitions by: Paul Vick <https://github.com/panopticoncentral>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "nomnom"
// NOTE: Extra identifier's been published is a work-around for the TypeScript 1.0.0.
// original is here -> https://github.com/borisyankov/DefinitelyTyped/commit/9aef1ad84dc006e3d25f5e57709198e33996ba84#diff-0d78c90325d4bfb40327dcc36dcd939a
declare module NomnomInternal
{
/**
* The command-line parser.
@@ -137,7 +140,7 @@ declare module "nomnom"
/**
* The command-line parser.
*/
interface Parser
export interface Parser
{
/**
* Returns the parser.
@@ -220,6 +223,9 @@ declare module "nomnom"
*/
parse(argv?: string[]): any;
}
export = Parser;
}
declare var _nomnom: NomnomInternal.Parser;
declare module "nomnom" {
export = _nomnom;
}

View File

@@ -20,10 +20,11 @@
"node": ">= 0.10.0"
},
"scripts": {
"test": "node ./_infrastructure/tests/runner.js --tsc-version 0.9.7 --test-changes",
"all": "node ./_infrastructure/tests/runner.js --tsc-version 0.9.7",
"dry": "node ./_infrastructure/tests/runner.js --tsc-version 0.9.7 --skip-tests --test-changes",
"list": "node ./_infrastructure/tests/runner.js --tsc-version 0.9.7 --skip-tests --print-files --print-refmap",
"test": "npm run changes",
"changes": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0 --test-changes",
"all": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0",
"dry": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0 --skip-tests --test-changes",
"list": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0 --skip-tests --print-files --print-refmap",
"help": "node ./_infrastructure/tests/runner.js -h"
},
"dependencies": {

8
should/should.d.ts vendored
View File

@@ -111,8 +111,8 @@ interface Internal extends ShouldInternal {
inspect(value: any, obj: any): any;
}
declare module "should" {
export = Internal;
}
declare var should: Internal;
declare module "should" {
export = should;
}

View File

@@ -16,4 +16,4 @@ var req: urlrouter.ServerRequest;
var res: urlrouter.ServerResponse;
function next() { }
result(req, res, next);
result(req, res, next);

View File

@@ -5,65 +5,65 @@
/// <reference path="../node/node.d.ts" />
declare module "_UrlRouterInternal" {
import http = require("http");
export interface ServerRequest extends http.ServerRequest {
params: any;
}
export interface ServerResponse extends http.ServerResponse {
}
export interface App {
// https://github.com/visionmedia/node-methods/blob/master/index.js
get(urlpattern: string, handler: HttpHandler): void;
post(urlpattern: string, handler: HttpHandler): void;
put(urlpattern: string, handler: HttpHandler): void;
head(urlpattern: string, handler: HttpHandler): void;
delete(urlpattern: string, handler: HttpHandler): void;
options(urlpattern: string, handler: HttpHandler): void;
trace(urlpattern: string, handler: HttpHandler): void;
copy(urlpattern: string, handler: HttpHandler): void;
lock(urlpattern: string, handler: HttpHandler): void;
mkcol(urlpattern: string, handler: HttpHandler): void;
move(urlpattern: string, handler: HttpHandler): void;
propfind(urlpattern: string, handler: HttpHandler): void;
proppatch(urlpattern: string, handler: HttpHandler): void;
unlock(urlpattern: string, handler: HttpHandler): void;
report(urlpattern: string, handler: HttpHandler): void;
mkactivity(urlpattern: string, handler: HttpHandler): void;
checkout(urlpattern: string, handler: HttpHandler): void;
merge(urlpattern: string, handler: HttpHandler): void;
"m-search"(urlpattern: string, handler: HttpHandler): void;
notify(urlpattern: string, handler: HttpHandler): void;
subscribe(urlpattern: string, handler: HttpHandler): void;
unsubscribe(urlpattern: string, handler: HttpHandler): void;
patch(urlpattern: string, handler: HttpHandler): void;
search(urlpattern: string, handler: HttpHandler): void;
all(urlpattern: string, handler: HttpHandler): void;
redirect(urlpattern: string, to: string): void;
}
export interface Options {
paramsName?: string;
pageNotFound?: (req: ServerRequest, res: ServerResponse) => void;
errorHandler?: (err:Error, req: ServerRequest, res: ServerResponse) => void;
}
export function _UrlRouterfunc(handler: (app: App) => void, options?: any): void;
export interface HttpHandler {
(req: ServerRequest, res: ServerResponse, next?: () => void): void;
}
}
declare module "urlrouter" {
import _UrlRouterInternal = require("_UrlRouterInternal");
import http = require("http");
function _UrlRouterInternal(handler: (app: _UrlRouterInternal.App) => void): _UrlRouterInternal.HttpHandler;
export = _UrlRouterInternal;
}
function UrlRouterInternal(handler:(app:UrlRouterInternal.App) => void):UrlRouterInternal.HttpHandler;
module UrlRouterInternal {
interface ServerRequest extends http.ServerRequest {
params: any;
}
interface ServerResponse extends http.ServerResponse {
}
interface App {
// https://github.com/visionmedia/node-methods/blob/master/index.js
get(urlpattern:string, handler:HttpHandler): void;
post(urlpattern:string, handler:HttpHandler): void;
put(urlpattern:string, handler:HttpHandler): void;
head(urlpattern:string, handler:HttpHandler): void;
delete(urlpattern:string, handler:HttpHandler): void;
options(urlpattern:string, handler:HttpHandler): void;
trace(urlpattern:string, handler:HttpHandler): void;
copy(urlpattern:string, handler:HttpHandler): void;
lock(urlpattern:string, handler:HttpHandler): void;
mkcol(urlpattern:string, handler:HttpHandler): void;
move(urlpattern:string, handler:HttpHandler): void;
propfind(urlpattern:string, handler:HttpHandler): void;
proppatch(urlpattern:string, handler:HttpHandler): void;
unlock(urlpattern:string, handler:HttpHandler): void;
report(urlpattern:string, handler:HttpHandler): void;
mkactivity(urlpattern:string, handler:HttpHandler): void;
checkout(urlpattern:string, handler:HttpHandler): void;
merge(urlpattern:string, handler:HttpHandler): void;
"m-search"(urlpattern:string, handler:HttpHandler): void;
notify(urlpattern:string, handler:HttpHandler): void;
subscribe(urlpattern:string, handler:HttpHandler): void;
unsubscribe(urlpattern:string, handler:HttpHandler): void;
patch(urlpattern:string, handler:HttpHandler): void;
search(urlpattern:string, handler:HttpHandler): void;
all(urlpattern:string, handler:HttpHandler): void;
redirect(urlpattern:string, to:string): void;
}
interface Options {
paramsName?: string;
pageNotFound?: (req:ServerRequest, res:ServerResponse) => void;
errorHandler?: (err:Error, req:ServerRequest, res:ServerResponse) => void;
}
function _UrlRouterfunc(handler:(app:App) => void, options?:any):void;
interface HttpHandler {
(req:ServerRequest, res:ServerResponse, next?:() => void): void;
}
}
export = UrlRouterInternal;
}