Merge from master.

This commit is contained in:
Markus Peloso
2015-05-01 09:37:02 +02:00
15 changed files with 296 additions and 225 deletions
+1 -12
View File
@@ -28,18 +28,7 @@ _infrastructure/tests/build
.idea
*.iml
*.js.map
#decimal.js
!decimal.js
#egg.js
!egg.js
#rx.js
!rx.js
#zip.js
!zip.js
!*.js/
node_modules
+30 -26
View File
@@ -927,7 +927,7 @@ declare module dojo {
*
*
*/
class __Promise extends dojo.promise.Promise {
class __Promise implements dojo.promise.Promise<any> {
constructor();
/**
* A promise resolving to an object representing
@@ -988,7 +988,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.Receives the rejection error.
* @param progback OptionalCallback to be invoked when the promise emits a progressupdate. Receives the progress update.
*/
then(callback?: Function, errback?: Function, progback?: Function): dojo.promise.Promise;
then(callback?: Function, errback?: Function, progback?: Function): dojo.promise.Promise<any>;
/**
*
*/
@@ -996,11 +996,11 @@ declare module dojo {
/**
*
*/
trace(): dojo.promise.Promise;
trace(): dojo.promise.Promise<any>;
/**
*
*/
traceRejected(): dojo.promise.Promise;
traceRejected(): dojo.promise.Promise<any>;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/request/default.html
@@ -1590,7 +1590,7 @@ declare module dojo {
* @param listener
* @param dontFix
*/
once(target: any, type: any, listener: any, dontFix: any): any;
once(target: any, type: any, listener: any, dontFix?: any): any;
/**
*
* @param target
@@ -1783,7 +1783,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.
* @param progback OptionalCallback to be invoked when the promise emits a progress update.
*/
interface when{(valueOrPromise: any, callback?: Function, errback?: Function, progback?: Function): void}
interface when { <T, U>(value: T|dojo.promise.Promise<T>, callback: dojo.promise.Callback<T, U>, errback?: any, progback?: any): U|dojo.promise.Promise<U> }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/DeferredList.html
*
@@ -1822,7 +1822,7 @@ declare module dojo {
/**
*
*/
"promise": dojo.promise.Promise;
"promise": dojo.promise.Promise<any>;
/**
* Inform the deferred it may cancel its asynchronous operation.
* Inform the deferred it may cancel its asynchronous operation.
@@ -1863,7 +1863,7 @@ declare module dojo {
* @param update The progress update. Passed to progbacks.
* @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently no progress can be emitted.
*/
progress(update: any, strict: boolean): dojo.promise.Promise;
progress(update: any, strict: boolean): dojo.promise.Promise<any>;
/**
* Reject the deferred.
* Reject the deferred, putting it in an error state.
@@ -1879,7 +1879,7 @@ declare module dojo {
* @param value The result of the deferred. Passed to callbacks.
* @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently cannot be resolved.
*/
resolve(value: any, strict?: boolean): dojo.promise.Promise;
resolve(value: any, strict?: boolean): dojo.promise.Promise<any>;
/**
* Add new callbacks to the deferred.
* Add new callbacks to the deferred. Callbacks can be added
@@ -1889,7 +1889,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.Receives the rejection error.
* @param progback OptionalCallback to be invoked when the promise emits a progressupdate. Receives the progress update.
*/
then(callback: Function, errback: Function, progback: Function): dojo.promise.Promise;
then(callback: Function, errback: Function, progback: Function): dojo.promise.Promise<any>;
/**
*
*/
@@ -9119,7 +9119,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.
* @param progback OptionalCallback to be invoked when the promise emits a progress update.
*/
when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): dojo.promise.Promise;
when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): dojo.promise.Promise<any>;
/**
* signal fired by impending window destruction. You may use
* dojo.addOnWIndowUnload() or dojo.connect() to this method to perform
@@ -16050,7 +16050,7 @@ declare module dojo {
*
* @param objectOrArray OptionalThe promise will be fulfilled with a list of results if invoked with anarray, or an object of results when passed an object (using the samekeys). If passed neither an object or array it is resolved with anundefined value.
*/
interface all{(objectOrArray?: Object): void}
interface all{<T>(value: Promise<T>[]): Promise<T[]>}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/promise/all.html
*
@@ -16063,7 +16063,7 @@ declare module dojo {
*
* @param objectOrArray OptionalThe promise will be fulfilled with a list of results if invoked with anarray, or an object of results when passed an object (using the samekeys). If passed neither an object or array it is resolved with anundefined value.
*/
interface all{(objectOrArray?: any[]): void}
interface all{(value: Object): Promise<any>}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/promise/first.html
*
@@ -16107,6 +16107,11 @@ declare module dojo {
* @param Deferred
*/
interface instrumentation{(Deferred: any): void}
interface Callback<T, U> {
(arg: T): U|Promise<U>;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/promise/Promise.html
*
@@ -16115,15 +16120,14 @@ declare module dojo {
* instances of this class.
*
*/
class Promise {
constructor();
interface Promise<T> {
/**
* Add a callback to be invoked when the promise is resolved
* or rejected.
*
* @param callbackOrErrback OptionalA function that is used both as a callback and errback.
*/
always(callbackOrErrback: Function): any;
always<U>(callbackOrErrback: Callback<any, U>): Promise<U>;
/**
* Inform the deferred it may cancel its asynchronous operation.
* Inform the deferred it may cancel its asynchronous operation.
@@ -16160,7 +16164,7 @@ declare module dojo {
*
* @param errback OptionalCallback to be invoked when the promise is rejected.
*/
otherwise(errback: Function): any;
otherwise<U>(errback: Callback<any, U>): Promise<U>;
/**
* Add new callbacks to the promise.
* Add new callbacks to the deferred. Callbacks can be added
@@ -16170,7 +16174,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.Receives the rejection error.
* @param progback OptionalCallback to be invoked when the promise emits a progressupdate. Receives the progress update.
*/
then(callback: Function, errback?: Function, progback?: Function): dojo.promise.Promise;
then<U>(callback: Callback<T, U>, errback?: Callback<any, U>, progback?: Callback<any, U>): Promise<U>;
/**
*
*/
@@ -16184,7 +16188,7 @@ declare module dojo {
* to handle traces.
*
*/
trace(): dojo.promise.Promise;
trace(): Promise<T>;
/**
* Trace rejection of the promise.
* Tracing allows you to transparently log progress,
@@ -16194,7 +16198,7 @@ declare module dojo {
* to handle traces.
*
*/
traceRejected(): dojo.promise.Promise;
traceRejected(): Promise<T>;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/promise/tracer.html
@@ -17467,7 +17471,7 @@ declare module dojo {
*
* @param results The result set as an array, or a promise for an array.
*/
interface QueryResults{(results: dojo.promise.Promise): void}
interface QueryResults{(results: dojo.promise.Promise<any>): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/store/util/SimpleQueryEngine.html
*
@@ -20456,7 +20460,7 @@ declare module dojo {
* @param value the number to be formatted
* @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.places (Number, optional): fixed number of decimal places to show. This overrides anyinformation in the provided pattern.round (Number, optional): 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1means do not round.locale (String, optional): override the locale used to determine formatting rulesfractional (Boolean, optional): If false, show no decimal places, overriding places and pattern settings.
*/
format(value: number, options: Object): any;
format(value: number, options?: Object): any;
/**
* Convert a properly formatted string to a primitive Number, using
* locale-specific settings.
@@ -20782,7 +20786,7 @@ declare module dojo {
* @param root OptionalA default starting root node from which to start the parsing. Can beomitted, defaulting to the entire document. If omitted, the optionsobject can be passed in this place. If the options object has arootNode member, that is used.
* @param options a kwArgs options object, see parse() for details
*/
scan(root: HTMLElement, options: Object): dojo.promise.Promise;
scan(root: HTMLElement, options: Object): dojo.promise.Promise<any>;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/regexp.html
@@ -24419,7 +24423,7 @@ declare module dojo {
* @param errback OptionalCallback to be invoked when the promise is rejected.
* @param progback OptionalCallback to be invoked when the promise emits a progress update.
*/
when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): dojo.promise.Promise;
when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): dojo.promise.Promise<any>;
/**
* signal fired by impending window destruction. You may use
* dojo.addOnWIndowUnload() or dojo.connect() to this method to perform
@@ -28268,8 +28272,8 @@ declare module "dojo/promise/tracer" {
export=exp;
}
declare module "dojo/promise/Promise" {
var exp: typeof dojo.promise.Promise
export=exp;
interface Promise<T> extends dojo.promise.Promise<T> { }
export = Promise;
}
declare module "dojo/rpc/JsonpService" {
var exp: typeof dojo.rpc.JsonpService
+8 -2
View File
@@ -5,11 +5,11 @@
import util = require('util')
import express = require('express')
import expressValidator = require('express-validator')
var app = express()
var app = express();
app.use(expressValidator());
app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: express.Response) {
app.post('/:urlparam', function(req: express.Request, res: express.Response) {
// checkBody only checks req.body; none of the other req parameters
// Similarly checkParams only checks in req.params (URL params) and
@@ -17,6 +17,9 @@ app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: exp
req.checkBody('postparam', 'Invalid postparam').notEmpty().isInt();
req.checkParams('urlparam', 'Invalid urlparam').isAlpha();
req.checkQuery('getparam', 'Invalid getparam').isInt();
req.checkHeader('testHeader', 'Invalid testHeader').isLowercase().isUppercase();
req.checkFiles('testFiles', 'Invalid testFiles').isUrl();
// OR assert can be used to check on all 3 types of params.
// req.assert('postparam', 'Invalid postparam').notEmpty().isInt();
@@ -24,8 +27,11 @@ app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: exp
// req.assert('getparam', 'Invalid getparam').isInt();
req.sanitize('postparam').toBoolean();
req.filter('postparam').toBoolean();
var errors = req.validationErrors();
var mappedErrors = req.validationErrors(true);
if (errors) {
res.status(400).send('There have been validation errors: ' + util.inspect(errors));
return;
+172 -169
View File
@@ -5,185 +5,188 @@
/// <reference path="../express/express.d.ts" />
// Add RequestValidation Interface on to Express's Request Interface.
declare module Express {
interface Request extends ExpressValidator.RequestValidation {}
}
// External express-validator module.
declare module "express-validator" {
import express = require('express');
import express = require('express');
module ExpressValidator {
/**
*
* @middlewareOptions see: https://github.com/ctavan/express-validator#middleware-options
*/
function ExpressValidator(middlewareOptions?:any):express.RequestHandler;
export interface ValidationError {
msg: string;
param: string;
}
export = ExpressValidator;
}
interface ValidatorFunction { (item: string, message: string): Validator; }
interface SanitizerFunction { (item: string): Sanitizer; }
interface Dictionary<T> { [key: string]: T; }
// Internal Module.
declare module ExpressValidator {
export interface RequestValidation {
assert: ValidatorFunction;
check: ValidatorFunction;
checkBody: ValidatorFunction;
checkFiles: ValidatorFunction;
checkHeader: ValidatorFunction;
checkParams: ValidatorFunction;
checkQuery: ValidatorFunction;
validate: ValidatorFunction;
export interface ValidationError {
msg: string;
param: string;
}
filter: SanitizerFunction;
sanitize: SanitizerFunction;
interface ValidatorFunction { (item: string, message: string): Validator; }
interface SanitizerFunction { (item: string): Sanitizer; }
interface Dictionary<T> { [key: string]: T; }
onValidationError(errback: (msg: string) => void): void;
validationErrors(mapped?: boolean): Dictionary<any> | any[];
}
export interface RequestValidation {
assert: ValidatorFunction;
check: ValidatorFunction;
checkBody: ValidatorFunction;
checkFiles: ValidatorFunction;
checkHeader: ValidatorFunction;
checkParams: ValidatorFunction;
checkQuery: ValidatorFunction;
validate: ValidatorFunction;
/**
* Interface for use when using express-validator as middleware for requests
*/
export interface ValidatedRequest extends express.Request, RequestValidation {}
filter: SanitizerFunction;
sanitize: SanitizerFunction;
export interface Validator {
/**
* Alias for regex()
*/
is(): Validator;
/**
* Alias for notRegex()
*/
not(): Validator;
isEmail(): Validator;
/**
* Accepts http, https, ftp
*/
isUrl(): Validator;
/**
* Combines isIPv4 and isIPv6
*/
isIP(): Validator;
isIPv4(): Validator;
isIPv6(): Validator;
isAlpha(): Validator;
isAlphanumeric(): Validator;
isNumeric(): Validator;
isHexadecimal(): Validator;
/**
* Accepts valid hexcolors with or without # prefix
*/
isHexColor(): Validator;
/**
* isNumeric accepts zero padded numbers, e.g. '001', isInt doesn't
*/
isInt(): Validator;
isLowercase(): Validator;
isUppercase(): Validator;
isDecimal(): Validator;
/**
* Alias for isDecimal
*/
isFloat(): Validator;
/**
* Check if length is 0
*/
notNull(): Validator;
isNull(): Validator;
/**
* Not just whitespace (input.trim().length !== 0)
*/
notEmpty(): Validator;
equals(equals:any): Validator;
contains(str:string): Validator;
notContains(str:string): Validator;
/**
* Usage: regex(/[a-z]/i) or regex('[a-z]','i')
*/
regex(pattern:string, modifiers:string): Validator;
notRegex(pattern:string, modifiers:string): Validator;
/**
* max is optional
*/
len(min:number, max?:number): Validator;
/**
* Version can be 3, 4 or 5 or empty, see http://en.wikipedia.org/wiki/Universally_unique_identifier
*/
isUUID(version:number): Validator;
/**
* Alias for isUUID(3)
*/
isUUIDv3(): Validator;
/**
* Alias for isUUID(4)
*/
isUUIDv4(): Validator;
/**
* Alias for isUUID(5)
*/
isUUIDv5(): Validator;
/**
* Uses Date.parse() - regex is probably a better choice
*/
isDate(): Validator;
/**
* Argument is optional and defaults to today. Comparison is non-inclusive
*/
isAfter(date:Date): Validator;
/**
* Argument is optional and defaults to today. Comparison is non-inclusive
*/
isBefore(date:Date): Validator;
isIn(options:string): Validator;
isIn(options:string[]): Validator;
notIn(options:string): Validator;
notIn(options:string[]): Validator;
max(val:string): Validator;
min(val:string): Validator;
/**
* Will work against Visa, MasterCard, American Express, Discover, Diners Club, and JCB card numbering formats
*/
isCreditCard(): Validator;
}
onValidationError(errback: (msg: string) => void): void;
validationErrors(mapped?: boolean): Dictionary<any> | any[];
}
interface Sanitizer {
/**
* Trim optional `chars`, default is to trim whitespace (\r\n\t )
*/
trim(...chars:string[]): Sanitizer;
ltrim(...chars:string[]): Sanitizer;
rtrim(...chars:string[]): Sanitizer;
ifNull(replace:any): Sanitizer;
toFloat(): Sanitizer;
toInt(): Sanitizer;
/**
* True unless str = '0', 'false', or str.length == 0
*/
toBoolean(): Sanitizer;
/**
* False unless str = '1' or 'true'
*/
toBooleanStrict(): Sanitizer;
/**
* Decode HTML entities
*/
entityDecode(): Sanitizer;
entityEncode(): Sanitizer;
/**
* Escape &, <, >, and "
*/
escape(): Sanitizer;
/**
* Remove common XSS attack vectors from user-supplied HTML
*/
xss(): Sanitizer;
/**
* Remove common XSS attack vectors from images
*/
xss(fromImages:boolean): Sanitizer;
}
}
export interface Validator {
/**
* Alias for regex()
*/
is(): Validator;
/**
* Alias for notRegex()
*/
not(): Validator;
isEmail(): Validator;
/**
* Accepts http, https, ftp
*/
isUrl(): Validator;
/**
* Combines isIPv4 and isIPv6
*/
isIP(): Validator;
isIPv4(): Validator;
isIPv6(): Validator;
isAlpha(): Validator;
isAlphanumeric(): Validator;
isNumeric(): Validator;
isHexadecimal(): Validator;
/**
* Accepts valid hexcolors with or without # prefix
*/
isHexColor(): Validator;
/**
* isNumeric accepts zero padded numbers, e.g. '001', isInt doesn't
*/
isInt(): Validator;
isLowercase(): Validator;
isUppercase(): Validator;
isDecimal(): Validator;
/**
* Alias for isDecimal
*/
isFloat(): Validator;
/**
* Check if length is 0
*/
notNull(): Validator;
isNull(): Validator;
/**
* Not just whitespace (input.trim().length !== 0)
*/
notEmpty(): Validator;
equals(equals:any): Validator;
contains(str:string): Validator;
notContains(str:string): Validator;
/**
* Usage: regex(/[a-z]/i) or regex('[a-z]','i')
*/
regex(pattern:string, modifiers:string): Validator;
notRegex(pattern:string, modifiers:string): Validator;
/**
* max is optional
*/
len(min:number, max?:number): Validator;
/**
* Version can be 3, 4 or 5 or empty, see http://en.wikipedia.org/wiki/Universally_unique_identifier
*/
isUUID(version:number): Validator;
/**
* Alias for isUUID(3)
*/
isUUIDv3(): Validator;
/**
* Alias for isUUID(4)
*/
isUUIDv4(): Validator;
/**
* Alias for isUUID(5)
*/
isUUIDv5(): Validator;
/**
* Uses Date.parse() - regex is probably a better choice
*/
isDate(): Validator;
/**
* Argument is optional and defaults to today. Comparison is non-inclusive
*/
isAfter(date:Date): Validator;
/**
* Argument is optional and defaults to today. Comparison is non-inclusive
*/
isBefore(date:Date): Validator;
isIn(options:string): Validator;
isIn(options:string[]): Validator;
notIn(options:string): Validator;
notIn(options:string[]): Validator;
max(val:string): Validator;
min(val:string): Validator;
/**
* Will work against Visa, MasterCard, American Express, Discover, Diners Club, and JCB card numbering formats
*/
isCreditCard(): Validator;
}
/**
*
* @middlewareOptions see: https://github.com/ctavan/express-validator#middleware-options
*/
function ExpressValidator(middlewareOptions?:any):express.RequestHandler;
interface Sanitizer {
/**
* Trim optional `chars`, default is to trim whitespace (\r\n\t )
*/
trim(...chars:string[]): Sanitizer;
ltrim(...chars:string[]): Sanitizer;
rtrim(...chars:string[]): Sanitizer;
ifNull(replace:any): Sanitizer;
toFloat(): Sanitizer;
toInt(): Sanitizer;
/**
* True unless str = '0', 'false', or str.length == 0
*/
toBoolean(): Sanitizer;
/**
* False unless str = '1' or 'true'
*/
toBooleanStrict(): Sanitizer;
/**
* Decode HTML entities
*/
entityDecode(): Sanitizer;
entityEncode(): Sanitizer;
/**
* Escape &, <, >, and "
*/
escape(): Sanitizer;
/**
* Remove common XSS attack vectors from user-supplied HTML
*/
xss(): Sanitizer;
/**
* Remove common XSS attack vectors from images
*/
xss(fromImages:boolean): Sanitizer;
}
export = ExpressValidator;
}
+11 -1
View File
@@ -68,7 +68,17 @@ exports = (grunt: IGrunt) => {
asyncedTwoArgs(2, "values", (result: string) => {
console.log(result);
});
var fileMaps = grunt.file.expandMapping([''], '', { ext: '.js' });
// tests for module grunt.file
var expandedFilesConfig: grunt.file.IExpandedFilesConfig = {
expand: true,
cwd: 'src',
src: ['**/*.ts'],
dest: 'build',
ext: '.js',
flatten: false
};
var fileMaps = grunt.file.expandMapping([''], '', expandedFilesConfig);
fileMaps.length;
fileMaps[0].src.length;
fileMaps[0].dest;
+1 -1
View File
@@ -604,7 +604,7 @@ declare module grunt {
/**
* All {@link IExpandedFilesConfig.src} matches are relative to (but don't include) this path.
*/
cwd?: boolean
cwd?: string
/**
* Replace any existing extension with this value in generated {@link IExpandedFilesConfig.dest} paths.
+6 -1
View File
@@ -44,6 +44,9 @@ $(document).ready(function () {
};
var colDataFunc: DataTables.FunctionColumnData = function (row, type, set, meta) {
meta.col;
meta.row;
meta.settings;
};
var colRenderObject: DataTables.ObjectColumnRender = {
@@ -54,7 +57,9 @@ $(document).ready(function () {
};
var colRenderFunc: DataTables.FunctionColumnRender = function (data, type, row, meta) {
meta.col;
meta.row;
meta.settings;
};
var col: DataTables.ColumnSettings =
+8 -2
View File
@@ -1498,7 +1498,7 @@ declare module DataTables {
}
interface FunctionColumnData {
(row: any, t: string, s: any, meta: Object): void;
(row: any, t: string, s: any, meta: CellMetaSettings): void;
}
interface ObjectColumnData {
@@ -1513,7 +1513,13 @@ declare module DataTables {
}
interface FunctionColumnRender {
(data: Node, t: Node, row: Node, meta: Object): void;
(data: any, t: string, row: any, meta: CellMetaSettings): void;
}
interface CellMetaSettings {
row: number;
col: number;
settings: DataTables.Settings;
}
//#endregion "colunm-settings"
+1
View File
@@ -340,6 +340,7 @@ declare module "http" {
export interface Server extends events.EventEmitter {
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
listen(port: number, hostname?: string, callback?: Function): Server;
listen(path: string, callback?: Function): Server;
listen(handle: any, listeningListener?: Function): Server;
close(cb?: any): Server;
+9
View File
@@ -64,6 +64,15 @@ Q.allResolved([])
})
});
Q(42)
.tap(() => "hello")
.tap(x => {
console.log(x);
})
.then(x => {
console.log("42 == " + x);
});
declare var arrayPromise: Q.IPromise<number[]>;
declare var stringPromise: Q.IPromise<string>;
declare function returnsNumPromise(text: string): Q.Promise<number>;
Vendored
+6
View File
@@ -122,6 +122,12 @@ declare module Q {
* A sugar method, equivalent to promise.then(function () { throw reason; }).
*/
thenReject(reason: any): Promise<T>;
/**
* Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler.
*/
tap(onFulfilled: (value: T) => any): Promise<T>;
timeout(ms: number, message?: string): Promise<T>;
/**
* Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed.
@@ -0,0 +1,6 @@
/// <reference path="recursive-readdir.d.ts" />
import recursiveReaddir = require("recursive-readdir");
recursiveReaddir("some/path", (err, files) => {});
recursiveReaddir("some/path", ["foo.cs", "*.html"], (err, files) => {});
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for recursive-readdir v1.2.1
// Project: https://github.com/jergason/recursive-readdir/
// Definitions by: Elisée Maurer <https://github.com/elisee/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "recursive-readdir" {
module RecursiveReaddir {
interface readdir {
(path: string, callback: (error: Error, files: string[]) => any): void;
// ignorePattern supports glob syntax via https://github.com/isaacs/minimatch
(path: string, ignorePattern: string[], callback: (error: Error, files: string[]) => any): void;
}
}
var r: RecursiveReaddir.readdir;
export = r;
}
+12
View File
@@ -46,6 +46,7 @@ declare module SocketIO {
name: string;
connected: { [id: string]: Socket };
use(fn: Function): Namespace;
in(room: string): Namespace;
on(event: 'connection', listener: (socket: Socket) => void): Namespace;
on(event: 'connect', listener: (socket: Socket) => void): Namespace;
@@ -58,6 +59,17 @@ declare module SocketIO {
conn: any;
request: any;
id: string;
handshake: {
headers: any;
time: string;
address: any;
xdomain: boolean;
secure: boolean;
issued: number;
url: string;
query: any;
};
emit(name: string, ...args: any[]): Socket;
join(name: string, fn?: Function): Socket;
leave(name: string, fn?: Function): Socket;
+7 -11
View File
@@ -8,24 +8,20 @@
declare module NodeJS {
interface WritableStream {
write(buffer: any/* Vinyl.IFile */, cb?: Function): boolean;
write(buffer: any/* Vinyl.File */, cb?: Function): boolean;
}
}
declare module "vinyl-fs" {
import _events = require("events");
import File = require("vinyl");
function src(globs:string, opt?:{read?:boolean;buffer?:boolean;}):NodeJS.ReadWriteStream;
function src(globs:string|string[], opt?:{read?:boolean;buffer?:boolean;}):NodeJS.ReadWriteStream;
function src(globs:string[], opt?:{read?:boolean;buffer?:boolean;}):NodeJS.ReadWriteStream;
function watch(globs:string|string[], cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function watch(globs:string, cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function watch(globs:string|string[], opt?:{interval?:number;debounceDelay?:number;cwd?:string;maxListeners?:Function;}, cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function watch(globs:string[], cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function watch(globs:string, opt?:{interval?:number;debounceDelay?:number;cwd?:string;maxListeners?:Function;}, cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function watch(globs:string[], opt?:{interval?:number;debounceDelay?:number;cwd?:string;maxListeners?:Function;}, cb?:(outEvt:{type:any;path:any;old:any;})=>void):_events.EventEmitter;
function dest(folder:string, opt?:{cwd?:string; mode?:any/* number or string */;}):NodeJS.ReadWriteStream;
function dest(folder: string, opt?: { cwd?: string; mode?: number|string; }): NodeJS.ReadWriteStream;
function dest(getFolderPath: (file: File) => string): NodeJS.ReadWriteStream;
}