194 lines
7.7 KiB
Text
194 lines
7.7 KiB
Text
=== tests/cases/compiler/express.d.ts ===
|
|
|
|
|
|
declare module Express {
|
|
>Express : Symbol(Express, Decl(express.d.ts, 0, 0))
|
|
|
|
export interface Request { }
|
|
>Request : Symbol(Request, Decl(express.d.ts, 2, 24))
|
|
|
|
export interface Response { }
|
|
>Response : Symbol(Response, Decl(express.d.ts, 3, 32))
|
|
|
|
export interface Application { }
|
|
>Application : Symbol(Application, Decl(express.d.ts, 4, 33))
|
|
}
|
|
|
|
declare module "express" {
|
|
function e(): e.Express;
|
|
>e : Symbol(, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29))
|
|
>e : Symbol(e, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28))
|
|
>Express : Symbol(Express, Decl(express.d.ts, 54, 9))
|
|
|
|
namespace e {
|
|
>e : Symbol(, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29))
|
|
|
|
interface IRoute {
|
|
>IRoute : Symbol(IRoute, Decl(express.d.ts, 10, 17))
|
|
|
|
all(...handler: RequestHandler[]): IRoute;
|
|
>all : Symbol(IRoute.all, Decl(express.d.ts, 11, 26))
|
|
>handler : Symbol(handler, Decl(express.d.ts, 12, 16))
|
|
>RequestHandler : Symbol(RequestHandler, Decl(express.d.ts, 40, 9))
|
|
>IRoute : Symbol(IRoute, Decl(express.d.ts, 10, 17))
|
|
}
|
|
|
|
interface IRouterMatcher<T> {
|
|
>IRouterMatcher : Symbol(IRouterMatcher, Decl(express.d.ts, 13, 9))
|
|
>T : Symbol(T, Decl(express.d.ts, 15, 33))
|
|
|
|
(name: string|RegExp, ...handlers: RequestHandler[]): T;
|
|
>name : Symbol(name, Decl(express.d.ts, 16, 13))
|
|
>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
>handlers : Symbol(handlers, Decl(express.d.ts, 16, 33))
|
|
>RequestHandler : Symbol(RequestHandler, Decl(express.d.ts, 40, 9))
|
|
>T : Symbol(T, Decl(express.d.ts, 15, 33))
|
|
}
|
|
|
|
interface IRouter<T> extends RequestHandler {
|
|
>IRouter : Symbol(IRouter, Decl(express.d.ts, 17, 9))
|
|
>T : Symbol(T, Decl(express.d.ts, 19, 26))
|
|
>RequestHandler : Symbol(RequestHandler, Decl(express.d.ts, 40, 9))
|
|
|
|
route(path: string): IRoute;
|
|
>route : Symbol(IRouter.route, Decl(express.d.ts, 19, 53))
|
|
>path : Symbol(path, Decl(express.d.ts, 20, 18))
|
|
>IRoute : Symbol(IRoute, Decl(express.d.ts, 10, 17))
|
|
}
|
|
|
|
export function Router(options?: any): Router;
|
|
>Router : Symbol(Router, Decl(express.d.ts, 21, 9), Decl(express.d.ts, 23, 54))
|
|
>options : Symbol(options, Decl(express.d.ts, 23, 31))
|
|
>Router : Symbol(Router, Decl(express.d.ts, 21, 9), Decl(express.d.ts, 23, 54))
|
|
|
|
export interface Router extends IRouter<Router> {}
|
|
>Router : Symbol(Router, Decl(express.d.ts, 21, 9), Decl(express.d.ts, 23, 54))
|
|
>IRouter : Symbol(IRouter, Decl(express.d.ts, 17, 9))
|
|
>Router : Symbol(Router, Decl(express.d.ts, 21, 9), Decl(express.d.ts, 23, 54))
|
|
|
|
interface Errback { (err: Error): void; }
|
|
>Errback : Symbol(Errback, Decl(express.d.ts, 25, 58))
|
|
>err : Symbol(err, Decl(express.d.ts, 27, 29))
|
|
>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
interface Request extends Express.Request {
|
|
>Request : Symbol(Request, Decl(express.d.ts, 27, 49), Decl(augmentation.ts, 2, 26))
|
|
>Express.Request : Symbol(Express.Request, Decl(express.d.ts, 2, 24))
|
|
>Express : Symbol(Express, Decl(express.d.ts, 0, 0))
|
|
>Request : Symbol(Express.Request, Decl(express.d.ts, 2, 24))
|
|
|
|
get (name: string): string;
|
|
>get : Symbol(Request.get, Decl(express.d.ts, 29, 51))
|
|
>name : Symbol(name, Decl(express.d.ts, 31, 17))
|
|
}
|
|
|
|
interface Response extends Express.Response {
|
|
>Response : Symbol(Response, Decl(express.d.ts, 32, 9))
|
|
>Express.Response : Symbol(Express.Response, Decl(express.d.ts, 3, 32))
|
|
>Express : Symbol(Express, Decl(express.d.ts, 0, 0))
|
|
>Response : Symbol(Express.Response, Decl(express.d.ts, 3, 32))
|
|
|
|
charset: string;
|
|
>charset : Symbol(Response.charset, Decl(express.d.ts, 34, 53))
|
|
}
|
|
|
|
interface ErrorRequestHandler {
|
|
>ErrorRequestHandler : Symbol(ErrorRequestHandler, Decl(express.d.ts, 36, 9))
|
|
|
|
(err: any, req: Request, res: Response, next: Function): any;
|
|
>err : Symbol(err, Decl(express.d.ts, 39, 13))
|
|
>req : Symbol(req, Decl(express.d.ts, 39, 22))
|
|
>Request : Symbol(Request, Decl(express.d.ts, 27, 49), Decl(augmentation.ts, 2, 26))
|
|
>res : Symbol(res, Decl(express.d.ts, 39, 36))
|
|
>Response : Symbol(Response, Decl(express.d.ts, 32, 9))
|
|
>next : Symbol(next, Decl(express.d.ts, 39, 51))
|
|
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
}
|
|
|
|
interface RequestHandler {
|
|
>RequestHandler : Symbol(RequestHandler, Decl(express.d.ts, 40, 9))
|
|
|
|
(req: Request, res: Response, next: Function): any;
|
|
>req : Symbol(req, Decl(express.d.ts, 43, 13))
|
|
>Request : Symbol(Request, Decl(express.d.ts, 27, 49), Decl(augmentation.ts, 2, 26))
|
|
>res : Symbol(res, Decl(express.d.ts, 43, 26))
|
|
>Response : Symbol(Response, Decl(express.d.ts, 32, 9))
|
|
>next : Symbol(next, Decl(express.d.ts, 43, 41))
|
|
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
}
|
|
|
|
interface Handler extends RequestHandler {}
|
|
>Handler : Symbol(Handler, Decl(express.d.ts, 44, 9))
|
|
>RequestHandler : Symbol(RequestHandler, Decl(express.d.ts, 40, 9))
|
|
|
|
interface RequestParamHandler {
|
|
>RequestParamHandler : Symbol(RequestParamHandler, Decl(express.d.ts, 46, 51))
|
|
|
|
(req: Request, res: Response, next: Function, param: any): any;
|
|
>req : Symbol(req, Decl(express.d.ts, 49, 13))
|
|
>Request : Symbol(Request, Decl(express.d.ts, 27, 49), Decl(augmentation.ts, 2, 26))
|
|
>res : Symbol(res, Decl(express.d.ts, 49, 26))
|
|
>Response : Symbol(Response, Decl(express.d.ts, 32, 9))
|
|
>next : Symbol(next, Decl(express.d.ts, 49, 41))
|
|
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
>param : Symbol(param, Decl(express.d.ts, 49, 57))
|
|
}
|
|
|
|
interface Application extends IRouter<Application>, Express.Application {
|
|
>Application : Symbol(Application, Decl(express.d.ts, 50, 9))
|
|
>IRouter : Symbol(IRouter, Decl(express.d.ts, 17, 9))
|
|
>Application : Symbol(Application, Decl(express.d.ts, 50, 9))
|
|
>Express.Application : Symbol(Express.Application, Decl(express.d.ts, 4, 33))
|
|
>Express : Symbol(Express, Decl(express.d.ts, 0, 0))
|
|
>Application : Symbol(Express.Application, Decl(express.d.ts, 4, 33))
|
|
|
|
routes: any;
|
|
>routes : Symbol(Application.routes, Decl(express.d.ts, 52, 81))
|
|
}
|
|
|
|
interface Express extends Application {
|
|
>Express : Symbol(Express, Decl(express.d.ts, 54, 9))
|
|
>Application : Symbol(Application, Decl(express.d.ts, 50, 9))
|
|
|
|
createApplication(): Application;
|
|
>createApplication : Symbol(Express.createApplication, Decl(express.d.ts, 56, 47))
|
|
>Application : Symbol(Application, Decl(express.d.ts, 50, 9))
|
|
}
|
|
|
|
var static: any;
|
|
>static : Symbol(static, Decl(express.d.ts, 60, 11))
|
|
}
|
|
|
|
export = e;
|
|
>e : Symbol(e, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28))
|
|
}
|
|
|
|
=== tests/cases/compiler/augmentation.ts ===
|
|
/// <reference path="express.d.ts"/>
|
|
import * as e from "express";
|
|
>e : Symbol(e, Decl(augmentation.ts, 1, 6))
|
|
|
|
declare module "express" {
|
|
interface Request {
|
|
>Request : Symbol(Request, Decl(express.d.ts, 27, 49), Decl(augmentation.ts, 2, 26))
|
|
|
|
id: number;
|
|
>id : Symbol(Request.id, Decl(augmentation.ts, 3, 23))
|
|
}
|
|
}
|
|
|
|
=== tests/cases/compiler/consumer.ts ===
|
|
import { Request } from "express";
|
|
>Request : Symbol(Request, Decl(consumer.ts, 0, 8))
|
|
|
|
import "./augmentation";
|
|
let x: Request;
|
|
>x : Symbol(x, Decl(consumer.ts, 2, 3))
|
|
>Request : Symbol(Request, Decl(consumer.ts, 0, 8))
|
|
|
|
const y = x.id;
|
|
>y : Symbol(y, Decl(consumer.ts, 3, 5))
|
|
>x.id : Symbol(Request.id, Decl(augmentation.ts, 3, 23))
|
|
>x : Symbol(x, Decl(consumer.ts, 2, 3))
|
|
>id : Symbol(Request.id, Decl(augmentation.ts, 3, 23))
|
|
|