Merge pull request #1958 from Bartvds/def/stubs

added definitions for a batch of small npm modules
This commit is contained in:
Bart van der Schoor
2014-04-01 02:19:21 +02:00
18 changed files with 228 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="assertion-error.d.ts" />
import AssertionError = require('assertion-error');
var e: AssertionError;
var str: string;
function foo () {
}
e = new AssertionError(str);
e = new AssertionError(str, {a:1, b:2});
e = new AssertionError(str, {a:1, b:2}, foo);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for assertion-error 1.0 0
// Project: https://github.com/chaijs/assertion-error
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'assertion-error' {
class AssertionError implements Error {
constructor(message: string, props?: any, ssf?: Function);
name: string;
message: string;
showDiff: boolean;
stack: string;
}
export = AssertionError;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="buffer-equal.d.ts" />
import bufferEqual = require('buffer-equal');
var bool: boolean;
var buf: NodeBuffer;
bool = bufferEqual(buf, buf);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for buffer-equal 1.0 0
// Project: https://github.com/chaijs/assertion-error
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'buffer-equal' {
function bufferEqual(actual:NodeBuffer, expected:NodeBuffer): boolean;
export = bufferEqual;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="detect-indent.d.ts" />
import di = require('detect-indent');
var str: string;
str = di(str);
str = di(str, str);
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for detect-indent 0.1.3
// Project: https://github.com/sindresorhus/detect-indent
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'detect-indent' {
function DetectIndent (dir: string, alt?: string): string;
export = DetectIndent;
}
+5
View File
@@ -0,0 +1,5 @@
/// <reference path="exit.d.ts" />
import exit = require('exit');
exit(42);
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for exit 0.1.2
// Project: https://github.com/cowboy/node-exit
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'exit' {
function exit(code: number): void;
export = exit;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="graceful-fs.d.ts" />
import fs = require('graceful-fs');
var str: string;
var buf: NodeBuffer;
fs.renameSync(str, str);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for graceful-fs 2.0.0
// Project: https://github.com/cowboy/graceful-fs
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'graceful-fs' {
import fs = require('fs');
export = fs;
}
+45
View File
@@ -0,0 +1,45 @@
/// <reference path="jsesc.d.ts" />
import jsesc = require('jsesc');
import Opts = jsesc.Opts;
// ---- ---- ---- ---- ---- ---- ----
var num: number;
var str: string;
var bool: boolean;
var opts: Opts;
var opts: Opts;
// ---- ---- ---- ---- ---- ---- ----
str = jsesc.version;
// ---- ---- ---- ---- ---- ---- ----
opts = {
quotes: str
};
opts = {
wrap: bool
};
opts = {
es6: bool
};
opts = {
escapeEverything: bool
};
opts = {
compact: bool
};
opts = {
indent: str
};
opts = {
json: bool
};
// ---- ---- ---- ---- ---- ---- ----
str = jsesc(str);
str = jsesc(str, opts);
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for jsesc 0.4.3
// Project: https://github.com/mathiasbynens/jsesc
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'jsesc' {
function jsesc(str: string, opts?: any): string;
module jsesc {
var version: string;
interface Opts {
quotes?: string;
wrap?: boolean;
es6?: boolean;
escapeEverything?: boolean;
compact?: boolean;
indent?: string;
json?: boolean;
}
}
export = jsesc;
}
+16
View File
@@ -0,0 +1,16 @@
/// <reference path="mkdirp.d.ts" />
import mkdirp = require('mkdirp');
var str: string;
var num: number;
mkdirp(str, num, (err, made) => {
str = made;
});
mkdirp(str, (err, made) => {
str = made;
});
str = mkdirp.sync(str, num);
str = mkdirp.sync(str);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for mkdirp 0.3.0
// Project: http://github.com/substack/node-mkdirp
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'mkdirp' {
function mkdirp(dir: string, cb: (err: any, made: string) => void): void;
function mkdirp(dir: string, flags: any, cb: (err: any, made: string) => void): void;
module mkdirp {
function sync(dir: string, flags?: any): string;
}
export = mkdirp;
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="open.d.ts" />
import open = require('open');
open('foo');
open('foo', 'bar');
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for open 0.0.3
// Project: https://github.com/jjrdn/node-open
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'open' {
function open(target: string, app?: string): void;
export = open;
}
@@ -0,0 +1,5 @@
/// <reference path="source-map-support.d.ts" />
import sms = require('source-map-support');
sms.install();
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for source-map-support 0.2.5
// Project: https://github.com/evanw/source-map-support
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'source-map-support' {
export function install(): any;
}