';
for(var i=0, l=items.length; i" + fn(items[i]) + "";
+ out = out + '
' + fn(items[i]) + '
';
}
- return out + "
";
+ return out + '
';
});
Handlebars.registerHelper('fullName', (person) => {
- return person.firstName + " " + person.lastName;
-});
\ No newline at end of file
+ return person.firstName + ' ' + person.lastName;
+});
diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts
index 8449fde07..28158031e 100644
--- a/handlebars/handlebars.d.ts
+++ b/handlebars/handlebars.d.ts
@@ -4,30 +4,39 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
-declare module Handlebars {
- function registerHelper(name: string, fn: Function, inverse?: boolean): void;
- function registerPartial(name: string, str: any): void;
- function K(): void;
- function createFrame(object: any): any;
- function Exception(message: string): void;
- class SafeString {
- constructor(str: string);
- static toString(): string;
- }
- function parse(input: string): boolean;
- var logger: Logger;
- function log(level: number, obj: any): void;
- function compile(input: any, options?: any): (context: any, options?: any) => string;
+declare var Handlebars: HandlebarsStatic;
- interface Logger {
- DEBUG: number;
- INFO: number;
- WARN: number;
- ERROR: number;
- level: number;
+interface HandlebarsStatic {
+ registerHelper(name: string, fn: Function, inverse?: boolean): void;
+ registerPartial(name: string, str: any): void;
+ K(): void;
+ createFrame(object: any): any;
+ Exception(message: string): void;
+ SafeString: typeof SafeString;
+ parse(input: string): boolean;
+ logger: Logger;
+ log(level: number, obj: any): void;
+ compile(input: any, options?: any): (context: any, options?: any) => string;
+ Logger: typeof Logger;
+}
- methodMap: { [level: number]: string };
+declare class SafeString {
+ constructor(str: string);
+ static toString(): string;
+}
- log(level: number, obj: string): void;
- }
+interface Logger {
+ DEBUG: number;
+ INFO: number;
+ WARN: number;
+ ERROR: number;
+ level: number;
+
+ methodMap: { [level: number]: string };
+
+ log(level: number, obj: string): void;
+}
+
+declare module "handlebars" {
+ export = Handlebars;
}
diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts
index f20ffcdb5..f6f6e9265 100644
--- a/highcharts/highcharts.d.ts
+++ b/highcharts/highcharts.d.ts
@@ -1011,7 +1011,7 @@ interface HighchartsChartObject {
setTitle(title: HighchartsTitleOptions): void;
setTitle(title: HighchartsTitleOptions, subtitle: HighchartsSubtitleOptions): void;
showLoading(): void;
- showLoading(str: string);
+ showLoading(str: string): void;
xAxis: HighchartsAxisObject[];
yAxis: HighchartsAxisObject[];
@@ -1058,7 +1058,7 @@ interface HighchartsStatic {
setOptions(options: HighchartsOptions): HighchartsOptions;
getOptions(): HighchartsOptions;
- map(array: any[], any): any[];
+ map(array: any[], fn: Function): any[];
}
declare var Highcharts: HighchartsStatic;
@@ -1088,16 +1088,16 @@ interface HighchartsPointObject {
}
interface HighchartsSeriesObject {
- addPoint(options: any);
- addPoint(options: any, redraw: boolean, shift: boolean);
- addPoint(options: any, redraw: boolean, shift: boolean, animation: boolean);
- addPoint(options: any, redraw: boolean, shift: boolean, animation: HighchartsAnimation);
+ addPoint(options: any): void;
+ addPoint(options: any, redraw: boolean, shift: boolean): void;
+ addPoint(options: any, redraw: boolean, shift: boolean, animation: boolean): void;
+ addPoint(options: any, redraw: boolean, shift: boolean, animation: HighchartsAnimation): void;
chart: HighchartsChartObject;
data: HighchartsDataPoint[];
hide(): void;
options: HighchartsSeriesOptions;
remove(): void;
- remove(redraw: boolean);
+ remove(redraw: boolean): void;
name: string;
points: HighchartsPointObject[];
select(): void;
diff --git a/html2canvas/html2canvas-tests.ts b/html2canvas/html2canvas-tests.ts
new file mode 100644
index 000000000..389e3f286
--- /dev/null
+++ b/html2canvas/html2canvas-tests.ts
@@ -0,0 +1,7 @@
+///
+
+var element: HTMLElement;
+
+html2canvas(element);
+html2canvas(element, {});
+
diff --git a/html2canvas/html2canvas.d.ts b/html2canvas/html2canvas.d.ts
new file mode 100644
index 000000000..689421971
--- /dev/null
+++ b/html2canvas/html2canvas.d.ts
@@ -0,0 +1,66 @@
+// Type definitions for html2canvas.js v0.4.1
+// Project: https://github.com/niklasvh/html2canvas
+// Definitions by: Richard Hepburn
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module Html2Canvas {
+ interface Html2CanvasOptions {
+ /** Whether to allow cross-origin images to taint the canvas */
+ allowTaint?: boolean;
+
+ /** Canvas background color, if none is specified in DOM. Set undefined for transparent */
+ background?: string;
+
+ /** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */
+ height?: number;
+
+ /** Whether to render each letter seperately. Necessary if letter-spacing is used. */
+ letterRendering?: boolean;
+
+ /** Whether to log events in the console. */
+ logging?: boolean;
+
+ /** Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded. */
+ proxy?: string;
+
+ /** Whether to test each image if it taints the canvas before drawing them */
+ taintTest?: boolean;
+
+ /** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */
+ timeout?: number;
+
+ /** Define the width of the canvas in pixels. If null, renders with full width of the window. */
+ width?: number;
+
+ /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */
+ useCORS?: boolean;
+
+ }
+}
+
+interface Html2CanvasStatic {
+
+ /**
+ * Renders an HTML element to a canvas so that a screenshot can be generated.
+ *
+ * The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
+ * but builds the screenshot based on the information available on the page.
+ *
+ * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
+ */
+ (element: HTMLElement): void;
+ /**
+ * Renders an HTML element to a canvas so that a screenshot can be generated.
+ *
+ * The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
+ * but builds the screenshot based on the information available on the page.
+ *
+ * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
+ * @param {Html2CanvasOptions} options The options object that controls how the element will be rendered.
+ */
+ (element: HTMLElement, options: Html2Canvas.Html2CanvasOptions): void;
+}
+
+declare var html2canvas: Html2CanvasStatic;
diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts
index 434cf2554..0a935ce44 100644
--- a/jquery/jquery-tests.ts
+++ b/jquery/jquery-tests.ts
@@ -410,6 +410,11 @@ function test_animatedSelector() {
animateIt();
}
+function test_easing() {
+ var result: number = $.easing.linear(3);
+ var result: number = $.easing.swing(3);
+}
+
function test_append() {
$('.inner').append('
Test
');
$('.container').append($('h2'));
diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts
index 2bd9beecc..e68d50e36 100644
--- a/jquery/jquery.d.ts
+++ b/jquery/jquery.d.ts
@@ -348,6 +348,13 @@ interface JQueryEventConstructor {
new (name: string, eventProperties?: any): JQueryEventObject;
}
+/**
+ * The interface used to specify easing functions.
+ */
+interface JQueryEasing {
+ linear(p: number): number;
+ swing(p: number): number;
+}
/*
Static members of jQuery (those on $ and jQuery themselves)
@@ -647,6 +654,7 @@ interface JQueryStatic {
Animation(elem: any, properties: any, options: any): any;
+ easing: JQueryEasing;
}
/*
diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts
index 3485cd6b1..e7f92e8a2 100644
--- a/jquerymobile/jquerymobile.d.ts
+++ b/jquerymobile/jquerymobile.d.ts
@@ -6,7 +6,7 @@
///
-interface JQueryMobileEvent { (event: Event, ui): void; }
+interface JQueryMobileEvent { (event: Event, ui: any): void; }
interface DialogOptions {
closeBtn?: string;
@@ -208,7 +208,7 @@ interface JQueryMobileOptions {
ajaxEnabled?: boolean;
allowCrossDomainPages?: boolean;
autoInitializePage?: boolean;
- buttonMarkup;
+ buttonMarkup: any;
defaultDialogTransition?: string;
defaultPageTransition?: string;
getMaxScrollForTransition?: number;
@@ -227,43 +227,43 @@ interface JQueryMobileOptions {
pushStateEnabled?: boolean;
subPageUrlKey?: string;
touchOverflowEnabled?: boolean;
- transitionFallbacks;
+ transitionFallbacks: any;
}
interface JQueryMobileEvents {
- tap;
- taphold;
- swipe;
- swipeleft;
- swiperight;
+ tap: any;
+ taphold: any;
+ swipe: any;
+ swipeleft: any;
+ swiperight: any;
- vmouseover;
- vmouseout;
- vmousedown;
- vmousemove;
- vmouseup;
- vclick;
- vmousecancel;
+ vmouseover: any;
+ vmouseout: any;
+ vmousedown: any;
+ vmousemove: any;
+ vmouseup: any;
+ vclick: any;
+ vmousecancel: any;
- orientationchange;
- scrollstart;
- scrollstop;
+ orientationchange: any;
+ scrollstart: any;
+ scrollstop: any;
- pagebeforeload;
- pageload;
- pageloadfailed;
- pagebeforechange;
- pagechange;
- pagechangefailed;
- pagebeforeshow;
- pagebeforehide;
- pageshow;
- pagehide;
- pagebeforecreate;
- pagecreate;
- pageinit;
- pageremove;
- updatelayout;
+ pagebeforeload: any;
+ pageload: any;
+ pageloadfailed: any;
+ pagebeforechange: any;
+ pagechange: any;
+ pagechangefailed: any;
+ pagebeforeshow: any;
+ pagebeforehide: any;
+ pageshow: any;
+ pagehide: any;
+ pagebeforecreate: any;
+ pagecreate: any;
+ pageinit: any;
+ pageremove: any;
+ updatelayout: any;
}
interface ChangePageOptions {
@@ -307,37 +307,38 @@ interface JQueryMobile extends JQueryMobileOptions {
loadPage(url: any, options?: LoadPageOptions): void;
loading(command: string, options?: LoaderOptions): void;
- base;
+ base: any;
silentScroll(yPos: number): void;
- activePage;
+ activePage: JQuery;
options: JQueryMobileOptions;
- transitionFallbacks;
- showPageLoadingMsg();
- hidePageLoadingMsg();
- loader;
- page;
+ transitionFallbacks: any;
+ showPageLoadingMsg(): void;
+ hidePageLoadingMsg(): void;
+ loader: any;
+ page: any;
- touchOverflow;
- showCategory;
- path;
+ touchOverflow: any;
+ showCategory: any;
+ path: any;
- dialog;
- popup;
- fixedtoolbar;
- button;
- collapsible;
- collapsibleset;
- textinput;
- slider;
- checkboxradio;
- selectmenu;
- listview;
+ dialog: any;
+ popup: any;
+ fixedtoolbar: any;
+ button: any;
+ collapsible: any;
+ collapsibleset: any;
+ textinput: any;
+ slider: any;
+ checkboxradio: any;
+ selectmenu: any;
+ listview: any;
+ defaultHomeScroll: number;
}
interface JQuerySupport {
- touchOverflow;
+ touchOverflow: any;
}
interface JQuery {
diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts
index d967b0bf2..e74012548 100644
--- a/knockout/tests/knockout-tests.ts
+++ b/knockout/tests/knockout-tests.ts
@@ -56,7 +56,7 @@ function test_computed() {
function MyViewModel1() {
this.price = ko.observable(25.99);
- this.formattedPrice = ko.computed({
+ this.formattedPrice = ko.computed({
read: function () {
return '$' + this.price().toFixed(2);
},
@@ -124,7 +124,7 @@ function test_observableArrays() {
myObservableArray.unshift('Some new value');
myObservableArray.shift();
myObservableArray.reverse();
- myObservableArray.sort(function (left, right) { return left.lastName == right.lastName ? 0 : (left.lastName < right.lastName ? -1 : 1) });
+ myObservableArray.sort(function (left, right) { return left == right ? 0 : (left < right ? -1 : 1) });
myObservableArray.splice(1, 3);
myObservableArray.remove('Blah');
diff --git a/mapsjs/mapsjs.d.ts b/mapsjs/mapsjs.d.ts
index c43fd5d56..29627eae9 100644
--- a/mapsjs/mapsjs.d.ts
+++ b/mapsjs/mapsjs.d.ts
@@ -1158,7 +1158,7 @@ declare module 'mapsjs' {
* @param {renderer} r The renderer delegate function with
* signature renderer(quadview).
*/
- setRenderer(r: tile.renderer): void;
+ setRenderer(r: any): void;
/**
* Notifies the tile layer to check for changes to its renderer.
@@ -1548,7 +1548,7 @@ declare module 'mapsjs' {
* This should be called if the data changes or if, due to extent
* changes, the density changes.
*/
- notifyRecompute(): void;
+ notifyRecompute(extents?: envelope): void;
}
/**
@@ -1753,7 +1753,7 @@ declare module 'mapsjs' {
* The bitmap or vector tile requestor using MapDotNet REST services.
* @class requestorMDN
*/
- export class requestorMDN extends requestor {
+ export class requestorMDNRest extends requestor {
constructor(endpoint: string, options?: {
dataFormat?: string;
timeoutMs?: number;
@@ -2249,7 +2249,22 @@ declare module 'mapsjs' {
* @param {number} [durationMs] Duration in miliseconds.
* @param {function} [completeAction] Callback to perform on animaton complete.
*/
- setMapCenterToGeolocationAnimate(durationMs?: number, completeAction?: () => void): void;
+ setMapCenterToGeolocationAnimate(durationMs?: number, completeAction?: () => void): void;
+
+ /**
+ * Offsets the current map center by the specified deltas in pixels.
+ * @param {number} [dx] offset x in pixels.
+ * @param {number} [dy] offset y in pixels.
+ */
+ offsetMapCenterByPixelDelta(dx: number, dy: number): void;
+
+ /**
+ * Offsets the current map center by the specified deltas in pixels - animated version.
+ * @param {number} [dx] offset x in pixels.
+ * @param {number} [dy] offset y in pixels.
+ * @param {number} [durationMs] animation duration in mS.
+ */
+ offsetMapCenterByPixelDeltaAnimate(dx: number, dy: number, durationMs?: number): void;
/**
* Gets the current zoom level.
@@ -2382,15 +2397,15 @@ declare module 'mapsjs' {
popTileLayer(): tile.layer;
/**
- * Removes a tile layer off the display stack by reference
- * @param {tile.layer} tl - a tile layer
- */
- removeTileLayer(tl: tile.layer): void;
+ * Removes a tile layer off the display stack by reference
+ * @param {tile.layer} tl A tile layer to remove.
+ */
+ removeTileLayer(tl: tile.layer): void;
- /**
- * Removes all tile layers off the display stack
- */
- removeAllTileLayers(): void;
+ /**
+ * Removes all tile layers off the display stack
+ */
+ removeAllTileLayers(): void;
/**
* Gets the current number of tile layers in the display stack.
diff --git a/node-ffi/node-ffi-tests.ts.tscparams b/node-ffi/node-ffi-tests.ts.tscparams
deleted file mode 100644
index e16c76dff..000000000
--- a/node-ffi/node-ffi-tests.ts.tscparams
+++ /dev/null
@@ -1 +0,0 @@
-""
diff --git a/node-ffi/node-ffi.d.ts b/node-ffi/node-ffi.d.ts
index 2f7ad15d7..b2bdd522d 100644
--- a/node-ffi/node-ffi.d.ts
+++ b/node-ffi/node-ffi.d.ts
@@ -140,10 +140,10 @@ declare module "ffi" {
* accept C callback functions.
*/
export var Callback: {
- new (retType, argTypes: any[], abi: number, fn: Function): NodeBuffer;
- new (retType, argTypes: any[], fn: Function): NodeBuffer;
- (retType, argTypes: any[], abi: number, fn: Function): NodeBuffer;
- (retType, argTypes: any[], fn: Function): NodeBuffer;
+ new (retType: any, argTypes: any[], abi: number, fn: Function): NodeBuffer;
+ new (retType: any, argTypes: any[], fn: Function): NodeBuffer;
+ (retType: any, argTypes: any[], abi: number, fn: Function): NodeBuffer;
+ (retType: any, argTypes: any[], fn: Function): NodeBuffer;
}
export var ffiType: {
@@ -200,7 +200,7 @@ declare module "ref" {
/** To invoke when `ref.get` is invoked on a buffer of this type. */
get(buffer: NodeBuffer, offset: number): any;
/** To invoke when `ref.set` is invoked on a buffer of this type. */
- set(buffer: NodeBuffer, offset: number, value): void;
+ set(buffer: NodeBuffer, offset: number, value: any): void;
/** The name to use during debugging for this datatype. */
name?: string;
/** The alignment of this datatype when placed inside a struct. */
@@ -214,9 +214,9 @@ declare module "ref" {
/** Get the memory address of buffer. */
export function address(buffer: NodeBuffer): number;
/** Allocate the memory with the given value written to it. */
- export function alloc(type: Type, value?): NodeBuffer;
+ export function alloc(type: Type, value?: any): NodeBuffer;
/** Allocate the memory with the given value written to it. */
- export function alloc(type: string, value?): NodeBuffer;
+ export function alloc(type: string, value?: any): NodeBuffer;
/**
* Allocate the memory with the given string written to it with the given
@@ -310,9 +310,9 @@ declare module "ref" {
offset?: number): NodeBuffer;
/** Write pointer if the indirection is 1, otherwise write value. */
- export function set(buffer: NodeBuffer, offset: number, value, type?: Type): void;
+ export function set(buffer: NodeBuffer, offset: number, value: any, type?: Type): void;
/** Write pointer if the indirection is 1, otherwise write value. */
- export function set(buffer: NodeBuffer, offset: number, value, type?: string): void;
+ export function set(buffer: NodeBuffer, offset: number, value: any, type?: string): void;
/** Write the string as a NULL terminated. Default encoding is utf8. */
export function writeCString(buffer: NodeBuffer, offset: number,
string: string, encoding?: string): void;
@@ -347,7 +347,7 @@ declare module "ref" {
* Attach object to buffer such.
* It prevents object from being garbage collected until buffer does.
*/
- export function _attach(buffer: NodeBuffer, object: Object);
+ export function _attach(buffer: NodeBuffer, object: Object): void;
/** Same as ref.reinterpret, except that this version does not attach buffer. */
export function _reinterpret(buffer: NodeBuffer, size: number,
diff --git a/node-ffi/node-ffi.d.ts.tscparams b/node-ffi/node-ffi.d.ts.tscparams
deleted file mode 100644
index e16c76dff..000000000
--- a/node-ffi/node-ffi.d.ts.tscparams
+++ /dev/null
@@ -1 +0,0 @@
-""
diff --git a/node/node.d.ts b/node/node.d.ts
index 26ac44b94..b8fff3e27 100644
--- a/node/node.d.ts
+++ b/node/node.d.ts
@@ -67,6 +67,13 @@ declare var Buffer: {
* *
************************************************/
+interface ErrnoException extends Error {
+ errno?: any;
+ code?: string;
+ path?: string;
+ syscall?: string;
+}
+
interface EventEmitter {
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
@@ -746,87 +753,87 @@ declare module "fs" {
export interface ReadStream extends stream.ReadableStream { }
export interface WriteStream extends stream.WritableStream { }
- export function rename(oldPath: string, newPath: string, callback?: Function): void;
+ export function rename(oldPath: string, newPath: string, callback?: (err?: ErrnoException) => void): void;
export function renameSync(oldPath: string, newPath: string): void;
- export function truncate(path: string, callback?: Function): void;
- export function truncate(path: string, len: number, callback?: Function): void;
+ export function truncate(path: string, callback?: (err?: ErrnoException) => void): void;
+ export function truncate(path: string, len: number, callback?: (err?: ErrnoException) => void): void;
export function truncateSync(path: string, len?: number): void;
- export function ftruncate(fd: number, callback?: Function): void;
- export function ftruncate(fd: number, len: number, callback?: Function): void;
+ export function ftruncate(fd: number, callback?: (err?: ErrnoException) => void): void;
+ export function ftruncate(fd: number, len: number, callback?: (err?: ErrnoException) => void): void;
export function ftruncateSync(fd: number, len?: number): void;
- export function chown(path: string, uid: number, gid: number, callback?: Function): void;
+ export function chown(path: string, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
export function chownSync(path: string, uid: number, gid: number): void;
- export function fchown(fd: number, uid: number, gid: number, callback?: Function): void;
+ export function fchown(fd: number, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
export function fchownSync(fd: number, uid: number, gid: number): void;
- export function lchown(path: string, uid: number, gid: number, callback?: Function): void;
+ export function lchown(path: string, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
export function lchownSync(path: string, uid: number, gid: number): void;
- export function chmod(path: string, mode: number, callback?: Function): void;
- export function chmod(path: string, mode: string, callback?: Function): void;
+ export function chmod(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
+ export function chmod(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
export function chmodSync(path: string, mode: number): void;
export function chmodSync(path: string, mode: string): void;
- export function fchmod(fd: number, mode: number, callback?: Function): void;
- export function fchmod(fd: number, mode: string, callback?: Function): void;
+ export function fchmod(fd: number, mode: number, callback?: (err?: ErrnoException) => void): void;
+ export function fchmod(fd: number, mode: string, callback?: (err?: ErrnoException) => void): void;
export function fchmodSync(fd: number, mode: number): void;
export function fchmodSync(fd: number, mode: string): void;
- export function lchmod(path: string, mode: number, callback?: Function): void;
- export function lchmod(path: string, mode: string, callback?: Function): void;
+ export function lchmod(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
+ export function lchmod(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
export function lchmodSync(path: string, mode: number): void;
export function lchmodSync(path: string, mode: string): void;
- export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void;
- export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void;
- export function fstat(fd: number, callback?: (err: Error, stats: Stats) => any): void;
+ export function stat(path: string, callback?: (err: ErrnoException, stats: Stats) => any): void;
+ export function lstat(path: string, callback?: (err: ErrnoException, stats: Stats) => any): void;
+ export function fstat(fd: number, callback?: (err: ErrnoException, stats: Stats) => any): void;
export function statSync(path: string): Stats;
export function lstatSync(path: string): Stats;
export function fstatSync(fd: number): Stats;
- export function link(srcpath: string, dstpath: string, callback?: Function): void;
+ export function link(srcpath: string, dstpath: string, callback?: (err?: ErrnoException) => void): void;
export function linkSync(srcpath: string, dstpath: string): void;
- export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void;
+ export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: ErrnoException) => void): void;
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
- export function readlink(path: string, callback?: (err: Error, linkString: string) => any): void;
+ export function readlink(path: string, callback?: (err: ErrnoException, linkString: string) => any): void;
export function readlinkSync(path: string): string;
- export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => any): void;
- export function realpath(path: string, cache: {[path: string]: string}, callback: (err: Error, resolvedPath: string) =>any): void;
+ export function realpath(path: string, callback?: (err: ErrnoException, resolvedPath: string) => any): void;
+ export function realpath(path: string, cache: {[path: string]: string}, callback: (err: ErrnoException, resolvedPath: string) =>any): void;
export function realpathSync(path: string, cache?: {[path: string]: string}): void;
- export function unlink(path: string, callback?: Function): void;
+ export function unlink(path: string, callback?: (err?: ErrnoException) => void): void;
export function unlinkSync(path: string): void;
- export function rmdir(path: string, callback?: Function): void;
+ export function rmdir(path: string, callback?: (err?: ErrnoException) => void): void;
export function rmdirSync(path: string): void;
- export function mkdir(path: string, callback?: Function): void;
- export function mkdir(path: string, mode: number, callback?: Function): void;
- export function mkdir(path: string, mode: string, callback?: Function): void;
+ export function mkdir(path: string, callback?: (err?: ErrnoException) => void): void;
+ export function mkdir(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
+ export function mkdir(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
export function mkdirSync(path: string, mode?: number): void;
export function mkdirSync(path: string, mode?: string): void;
- export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void;
+ export function readdir(path: string, callback?: (err: ErrnoException, files: string[]) => void): void;
export function readdirSync(path: string): string[];
- export function close(fd: number, callback?: Function): void;
+ export function close(fd: number, callback?: (err?: ErrnoException) => void): void;
export function closeSync(fd: number): void;
- export function open(path: string, flags: string, callback?: (err: Error, fd: number) => any): void;
- export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: number) => any): void;
- export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: number) => any): void;
+ export function open(path: string, flags: string, callback?: (err: ErrnoException, fd: number) => any): void;
+ export function open(path: string, flags: string, mode: number, callback?: (err: ErrnoException, fd: number) => any): void;
+ export function open(path: string, flags: string, mode: string, callback?: (err: ErrnoException, fd: number) => any): void;
export function openSync(path: string, flags: string, mode?: number): number;
export function openSync(path: string, flags: string, mode?: string): number;
- export function utimes(path: string, atime: number, mtime: number, callback?: Function): void;
+ export function utimes(path: string, atime: number, mtime: number, callback?: (err?: ErrnoException) => void): void;
export function utimesSync(path: string, atime: number, mtime: number): void;
- export function futimes(fd: number, atime: number, mtime: number, callback?: Function): void;
+ export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: ErrnoException) => void): void;
export function futimesSync(fd: number, atime: number, mtime: number): void;
- export function fsync(fd: number, callback?: Function): void;
+ export function fsync(fd: number, callback?: (err?: ErrnoException) => void): void;
export function fsyncSync(fd: number): void;
- export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
+ export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: ErrnoException, written: number, buffer: NodeBuffer) => void): void;
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
- export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
+ export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: ErrnoException, bytesRead: number, buffer: NodeBuffer) => void): void;
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
- export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void;
- export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
+ export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: ErrnoException, data: any) => void): void;
+ export function readFile(filename: string, callback: (err: ErrnoException, data: NodeBuffer) => void ): void;
export function readFileSync(filename: string, options?: { flag?: string; }): NodeBuffer;
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
- export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void;
- export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
- export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
+ export function writeFile(filename: string, data: any, callback?: (err: ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: ErrnoException) => void): void;
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
- export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
- export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
- export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, callback?: (err: ErrnoException) => void): void;
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts
index ee923c59c..68d0163b6 100644
--- a/qunit/qunit.d.ts
+++ b/qunit/qunit.d.ts
@@ -175,13 +175,13 @@ interface QUnitAssert {
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- deepEqual(actual: any, expected: any, message?: string);
+ deepEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
*
* The equal assertion uses the simple comparison operator (==) to compare the actual
- * and expected arguments. When they are equal, the assertion passes; otherwise, it fails.
+ * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
* When it fails, both actual and expected values are displayed in the test result,
* in addition to a given message.
*
@@ -189,7 +189,7 @@ interface QUnitAssert {
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- equal(actual: any, expected: any, message?: string);
+ equal(actual: any, expected: any, message?: string): any;
/**
* An inverted deep recursive comparison assertion, working on primitive types,
@@ -203,13 +203,13 @@ interface QUnitAssert {
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- notDeepEqual(actual: any, expected: any, message?: string);
+ notDeepEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, checking for inequality.
*
* The notEqual assertion uses the simple inverted comparison operator (!=) to compare
- * the actual and expected arguments. When they aren't equal, the assertion passes;
+ * the actual and expected arguments. When they aren't equal, the assertion passes: any;
* otherwise, it fails. When it fails, both actual and expected values are displayed
* in the test result, in addition to a given message.
*
@@ -217,25 +217,25 @@ interface QUnitAssert {
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- notEqual(actual: any, expected: any, message?: string);
+ notEqual(actual: any, expected: any, message?: string): any;
- notPropEqual(actual: any, expected: any, message?: string);
+ notPropEqual(actual: any, expected: any, message?: string): any;
- propEqual(actual: any, expected: any, message?: string);
+ propEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, checking for inequality.
*
* The notStrictEqual assertion uses the strict inverted comparison operator (!==)
* to compare the actual and expected arguments. When they aren't equal, the assertion
- * passes; otherwise, it fails. When it fails, both actual and expected values are
+ * passes: any; otherwise, it fails. When it fails, both actual and expected values are
* displayed in the test result, in addition to a given message.
*
* @param actual Expression being tested
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- notStrictEqual(actual: any, expected: any, message?: string);
+ notStrictEqual(actual: any, expected: any, message?: string): any;
/**
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
@@ -248,7 +248,7 @@ interface QUnitAssert {
* @param state Expression being tested
* @param message A short description of the assertion
*/
- ok(state: any, message?: string);
+ ok(state: any, message?: string): any;
/**
* A strict type and value comparison assertion.
@@ -260,7 +260,7 @@ interface QUnitAssert {
* @param expected Known comparison value
* @param message A short description of the assertion
*/
- strictEqual(actual: any, expected: any, message?: string);
+ strictEqual(actual: any, expected: any, message?: string): any;
/**
* Assertion to test if a callback throws an exception when run.
@@ -272,13 +272,13 @@ interface QUnitAssert {
* @param expected Error Object to compare
* @param message A short description of the assertion
*/
- throws(block: () => any, expected: any, message?: string);
+ throws(block: () => any, expected: any, message?: string): any;
/**
* @param block Function to execute
* @param message A short description of the assertion
*/
- throws(block: () => any, message?: string);
+ throws(block: () => any, message?: string): any;
}
interface QUnitStatic extends QUnitAssert{
@@ -291,7 +291,7 @@ interface QUnitStatic extends QUnitAssert{
*
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
*/
- start(decrement?: number);
+ start(decrement?: number): any;
/**
* Stop the testrunner to wait for async tests to run. Call start() to continue.
@@ -302,7 +302,7 @@ interface QUnitStatic extends QUnitAssert{
*
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
*/
- stop(increment? : number);
+ stop(increment? : number): any;
/* CALLBACKS */
@@ -314,14 +314,14 @@ interface QUnitStatic extends QUnitAssert{
*
* @param callback Callback to execute
*/
- begin(callback: () => any);
+ begin(callback: () => any): any;
/**
* Register a callback to fire whenever the test suite ends.
*
* @param callback Callback to execute.
*/
- done(callback: (details: DoneCallbackObject) => any);
+ done(callback: (details: DoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever an assertion completes.
@@ -331,35 +331,35 @@ interface QUnitStatic extends QUnitAssert{
*
* @param callback Callback to execute.
*/
- log(callback: (details: LogCallbackObject) => any);
+ log(callback: (details: LogCallbackObject) => any): any;
/**
* Register a callback to fire whenever a module ends.
*
* @param callback Callback to execute.
*/
- moduleDone(callback: (details: ModuleDoneCallbackObject) => any);
+ moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever a module begins.
*
* @param callback Callback to execute.
*/
- moduleStart(callback: (details: ModuleStartCallbackObject) => any);
+ moduleStart(callback: (details: ModuleStartCallbackObject) => any): any;
/**
* Register a callback to fire whenever a test ends.
*
* @param callback Callback to execute.
*/
- testDone(callback: (details: TestDoneCallbackObject) => any);
+ testDone(callback: (details: TestDoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever a test begins.
*
* @param callback Callback to execute.
*/
- testStart(callback: (details: TestStartCallbackObject) => any);
+ testStart(callback: (details: TestStartCallbackObject) => any): any;
/* CONFIGURATION */
@@ -381,7 +381,7 @@ interface QUnitStatic extends QUnitAssert{
* @param expected Number of assertions in this test
* @param test Function to close over assertions
*/
- asyncTest(name: string, expected: number, test: () => any);
+ asyncTest(name: string, expected: number, test: () => any): any;
/**
* Add an asynchronous test to run. The test must include a call to start().
@@ -392,7 +392,7 @@ interface QUnitStatic extends QUnitAssert{
* @param name Title of unit being tested
* @param test Function to close over assertions
*/
- asyncTest(name: string, test: () => any);
+ asyncTest(name: string, test: () => any): any;
/**
* Specify how many assertions are expected to run within a test.
@@ -403,7 +403,7 @@ interface QUnitStatic extends QUnitAssert{
*
* @param amount Number of assertions in this test.
*/
- expect(amount: number);
+ expect(amount: number): any;
/**
* Group related tests under a single label.
@@ -415,7 +415,7 @@ interface QUnitStatic extends QUnitAssert{
* @param name Label for this group of tests
* @param lifecycle Callbacks to run before and after each test
*/
- module(name: string, lifecycle?: LifecycleObject);
+ module(name: string, lifecycle?: LifecycleObject): any;
/**
* Add a test to run.
@@ -429,18 +429,18 @@ interface QUnitStatic extends QUnitAssert{
* @param expected Number of assertions in this test
* @param test Function to close over assertions
*/
- test(title: string, expected: number, test: (assert: QUnitAssert) => any);
+ test(title: string, expected: number, test: (assert: QUnitAssert) => any): any;
/**
* @param title Title of unit being tested
* @param test Function to close over assertions
*/
- test(title: string, test: (assert: QUnitAssert) => any);
+ test(title: string, test: (assert: QUnitAssert) => any): any;
/**
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
*/
- equiv(a: any, b: any);
+ equiv(a: any, b: any): any;
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
raises: any;
@@ -448,7 +448,7 @@ interface QUnitStatic extends QUnitAssert{
/**
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L897
*/
- push(result, actual, expected, message): any;
+ push(result: any, actual: any, expected: any, message: string): any;
/**
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L839
@@ -470,13 +470,13 @@ interface QUnitStatic extends QUnitAssert{
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function deepEqual(actual: any, expected: any, message?: string);
+declare function deepEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
*
* The equal assertion uses the simple comparison operator (==) to compare the actual
-* and expected arguments. When they are equal, the assertion passes; otherwise, it fails.
+* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
* When it fails, both actual and expected values are displayed in the test result,
* in addition to a given message.
*
@@ -484,7 +484,7 @@ declare function deepEqual(actual: any, expected: any, message?: string);
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function equal(actual: any, expected: any, message?: string);
+declare function equal(actual: any, expected: any, message?: string): any;
/**
* An inverted deep recursive comparison assertion, working on primitive types,
@@ -498,7 +498,7 @@ declare function equal(actual: any, expected: any, message?: string);
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function notDeepEqual(actual: any, expected: any, message?: string);
+declare function notDeepEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, checking for inequality.
@@ -512,7 +512,7 @@ declare function notDeepEqual(actual: any, expected: any, message?: string);
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function notEqual(actual: any, expected: any, message?: string);
+declare function notEqual(actual: any, expected: any, message?: string): any;
/**
* A non-strict comparison assertion, checking for inequality.
@@ -526,7 +526,7 @@ declare function notEqual(actual: any, expected: any, message?: string);
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function notStrictEqual(actual: any, expected: any, message?: string);
+declare function notStrictEqual(actual: any, expected: any, message?: string): any;
/**
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
@@ -539,7 +539,7 @@ declare function notStrictEqual(actual: any, expected: any, message?: string);
* @param state Expression being tested
* @param message A short description of the assertion
*/
-declare function ok(state: any, message?: string);
+declare function ok(state: any, message?: string): any;
/**
* A strict type and value comparison assertion.
@@ -551,7 +551,7 @@ declare function ok(state: any, message?: string);
* @param expected Known comparison value
* @param message A short description of the assertion
*/
-declare function strictEqual(actual: any, expected: any, message?: string);
+declare function strictEqual(actual: any, expected: any, message?: string): any;
/**
* Assertion to test if a callback throws an exception when run.
@@ -563,13 +563,13 @@ declare function strictEqual(actual: any, expected: any, message?: string);
* @param expected Error Object to compare
* @param message A short description of the assertion
*/
-declare function throws(block: () => any, expected: any, message?: string);
+declare function throws(block: () => any, expected: any, message?: string): any;
/**
* @param block Function to execute
* @param message A short description of the assertion
*/
-declare function throws(block: () => any, message?: string);
+declare function throws(block: () => any, message?: string): any;
/* ASYNC CONTROL */
@@ -580,7 +580,7 @@ declare function throws(block: () => any, message?: string);
*
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
*/
-declare function start(decrement?: number);
+declare function start(decrement?: number): any;
/**
* Stop the testrunner to wait for async tests to run. Call start() to continue.
@@ -591,7 +591,7 @@ declare function start(decrement?: number);
*
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
*/
-declare function stop(increment? : number);
+declare function stop(increment? : number): any;
/* CALLBACKS */
@@ -603,14 +603,14 @@ declare function stop(increment? : number);
*
* @param callback Callback to execute
*/
-declare function begin(callback: () => any);
+declare function begin(callback: () => any): any;
/**
* Register a callback to fire whenever the test suite ends.
*
* @param callback Callback to execute.
*/
-declare function done(callback: (details: DoneCallbackObject) => any);
+declare function done(callback: (details: DoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever an assertion completes.
@@ -620,35 +620,35 @@ declare function done(callback: (details: DoneCallbackObject) => any);
*
* @param callback Callback to execute.
*/
-declare function log(callback: (details: LogCallbackObject) => any);
+declare function log(callback: (details: LogCallbackObject) => any): any;
/**
* Register a callback to fire whenever a module ends.
*
* @param callback Callback to execute.
*/
-declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any);
+declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever a module begins.
*
* @param callback Callback to execute.
*/
-declare function moduleStart(callback: (name: string) => any);
+declare function moduleStart(callback: (name: string) => any): any;
/**
* Register a callback to fire whenever a test ends.
*
* @param callback Callback to execute.
*/
-declare function testDone(callback: (details: TestDoneCallbackObject) => any);
+declare function testDone(callback: (details: TestDoneCallbackObject) => any): any;
/**
* Register a callback to fire whenever a test begins.
*
* @param callback Callback to execute.
*/
-declare function testStart(callback: (details: TestStartCallbackObject) => any);
+declare function testStart(callback: (details: TestStartCallbackObject) => any): any;
/* TEST */
@@ -662,7 +662,7 @@ declare function testStart(callback: (details: TestStartCallbackObject) => any);
* @param expected Number of assertions in this test
* @param test Function to close over assertions
*/
-declare function asyncTest(name: string, expected?: any, test?: () => any);
+declare function asyncTest(name: string, expected?: any, test?: () => any): any;
/**
* Add an asynchronous test to run. The test must include a call to start().
@@ -673,7 +673,7 @@ declare function asyncTest(name: string, expected?: any, test?: () => any);
* @param name Title of unit being tested
* @param test Function to close over assertions
*/
-declare function asyncTest(name: string, test: () => any);
+declare function asyncTest(name: string, test: () => any): any;
/**
* Specify how many assertions are expected to run within a test.
@@ -684,7 +684,7 @@ declare function asyncTest(name: string, test: () => any);
*
* @param amount Number of assertions in this test.
*/
-declare function expect(amount: number);
+declare function expect(amount: number): any;
// ** conflict with TypeScript module keyword. Must be used on QUnit namespace
//declare var module: (name: string, lifecycle?: LifecycleObject) => any;
@@ -701,20 +701,20 @@ declare function expect(amount: number);
* @param expected Number of assertions in this test
* @param test Function to close over assertions
*/
-declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any);
+declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any): any;
/**
* @param title Title of unit being tested
* @param test Function to close over assertions
*/
-declare function test(title: string, test: (assert?: QUnitAssert) => any);
+declare function test(title: string, test: (assert?: QUnitAssert) => any): any;
-declare function notPropEqual(actual: any, expected: any, message?: string);
+declare function notPropEqual(actual: any, expected: any, message?: string): any;
-declare function propEqual(actual: any, expected: any, message?: string);
+declare function propEqual(actual: any, expected: any, message?: string): any;
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
-declare function equiv(a: any, b: any);
+declare function equiv(a: any, b: any): any;
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
declare var raises: any;
diff --git a/requirejs/require.d.ts b/requirejs/require.d.ts
index 89c6f97f6..bb58e5143 100644
--- a/requirejs/require.d.ts
+++ b/requirejs/require.d.ts
@@ -290,7 +290,7 @@ interface RequireDefine {
* callback param deps module dependencies
* callback return module definition
**/
- (deps: string[], ready: (...deps: any[]) => any): void;
+ (deps: string[], ready: Function): void;
/**
* Define module with simplified CommonJS wrapper.
@@ -310,7 +310,7 @@ interface RequireDefine {
* callback deps module dependencies
* callback return module definition
**/
- (name: string, deps: string[], ready: (...deps: any[]) => any): void;
+ (name: string, deps: string[], ready: Function): void;
}
// Ambient declarations for 'require' and 'define'
diff --git a/restify/restify.d.ts b/restify/restify.d.ts
index dae93f783..cd65e6666 100644
--- a/restify/restify.d.ts
+++ b/restify/restify.d.ts
@@ -43,11 +43,12 @@ interface Response {
interface Server {
use: (... handler: any[]) => any;
- post: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
- put: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
- del: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
- get: (route: any, routeCallBack: (req: Request, res: Response, next: Function ) => any) => any;
- head: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
+ post: (route: any, routeCallBack: RequestHadler) => any;
+ patch: (route: any, routeCallBack: RequestHadler) => any;
+ put: (route: any, routeCallBack: RequestHadler) => any;
+ del: (route: any, routeCallBack: RequestHadler) => any;
+ get: (route: any, routeCallBack: RequestHadler) => any;
+ head: (route: any, routeCallBack: RequestHadler) => any;
on: (event: string, callback: Function) => any;
name: string;
version: string;
@@ -57,7 +58,7 @@ interface Server {
address: () => addressInterface;
listen: (... args: any[]) => any;
close: (... args: any[]) => any;
- pre: (routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
+ pre: (routeCallBack: RequestHadler) => any;
}
@@ -115,13 +116,17 @@ interface ThrottleOptions {
overrides?: Object;
}
+interface RequestHadler {
+ (req: Request, res: Response, next: Function): any;
+}
+
declare module "restify" {
export function createServer(options?: ServerOptions): Server;
export function createJsonClient(options?: ClientOptions): Client;
export function createStringClient(options?: ClientOptions): Client;
export function createClient(options?: ClientOptions): HttpClient;
-
+
export class ConflictError { constructor(message?: any); }
export class InvalidArguementError { constructor(message?: any); }
export class RestError { constructor(message?: any); }
@@ -140,18 +145,19 @@ declare module "restify" {
export class ResourceNotFoundError { constructor(message: any); }
export class WrongAcceptError { constructor(message: any); }
- export function acceptParser(parser: any);
- export function authorizationParser();
- export function dateParser(skew?: number);
- export function queryParser(options?: Object);
- export function urlEncodedBodyParser(options?: Object);
- export function jsonp(options?: Object);
- export function gzipResponse(options?: Object);
- export function bodyParser(options?: Object);
- export function requestLogger(options?: Object);
- export function serveStatic(options?: Object);
- export function throttle(options?: ThrottleOptions);
- export function conditionalRequest(options?: Object);
- export function auditLogger(options?: Object);
+ export function acceptParser(parser: any): RequestHadler;
+ export function authorizationParser(): RequestHadler;
+ export function dateParser(skew?: number): RequestHadler;
+ export function queryParser(options?: Object): RequestHadler;
+ export function urlEncodedBodyParser(options?: Object): RequestHadler[];
+ export function jsonp(): RequestHadler;
+ export function gzipResponse(options?: Object): RequestHadler;
+ export function bodyParser(options?: Object): RequestHadler[];
+ export function requestLogger(options?: Object): RequestHadler;
+ export function serveStatic(options?: Object): RequestHadler;
+ export function throttle(options?: ThrottleOptions): RequestHadler;
+ export function conditionalRequest(): RequestHadler[];
+ export function auditLogger(options?: Object): Function;
+ export function fullResponse(): RequestHadler;
export var defaultResponseHeaders : any;
}