diff --git a/bootstrap-table/bootstrap-table-tests.ts b/bootstrap-table/bootstrap-table-tests.ts new file mode 100644 index 0000000000..6336ba4f8d --- /dev/null +++ b/bootstrap-table/bootstrap-table-tests.ts @@ -0,0 +1 @@ +$().bootstrapTable({}); diff --git a/bootstrap-table/bootstrap-table.d.ts b/bootstrap-table/index.d.ts similarity index 87% rename from bootstrap-table/bootstrap-table.d.ts rename to bootstrap-table/index.d.ts index d0356dff84..5ed1b5e529 100644 --- a/bootstrap-table/bootstrap-table.d.ts +++ b/bootstrap-table/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Talat Baig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface JQuery { bootstrapTable(options?: any): JQuery; diff --git a/bootstrap-table/tsconfig.json b/bootstrap-table/tsconfig.json new file mode 100644 index 0000000000..ad183f608a --- /dev/null +++ b/bootstrap-table/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bootstrap-table-tests.ts" + ] +} \ No newline at end of file diff --git a/bwip-js/bwip-js-tests.ts b/bwip-js/bwip-js-tests.ts index 71601f111a..29cc419d2c 100644 --- a/bwip-js/bwip-js-tests.ts +++ b/bwip-js/bwip-js-tests.ts @@ -1,7 +1,3 @@ -/// -/// -'use strict'; - import * as bwipjs from 'bwip-js'; import * as http from 'http'; import * as fs from 'fs'; @@ -13,7 +9,7 @@ bwipjs.loadFont('Inconsolata', 108, http.createServer(function(req, res) { // If the url does not begin /?bcid= then 404. Otherwise, we end up // returning 400 on requests like favicon.ico. - if (req.url.indexOf('/?bcid=') != 0) { + if (req.url!.indexOf('/?bcid=') != 0) { res.writeHead(404, { 'Content-Type':'text/plain' }); res.end('BWIPJS: Unknown request format.', 'utf8'); } else { diff --git a/bwip-js/index.d.ts b/bwip-js/index.d.ts index 0f40b5771e..9c37fa6e44 100644 --- a/bwip-js/index.d.ts +++ b/bwip-js/index.d.ts @@ -3,84 +3,81 @@ // Definitions by: TANAKA Koichi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// -declare module 'bwip-js' { - import {IncomingMessage as Request, ServerResponse as Response} from 'http'; +import {IncomingMessage as Request, ServerResponse as Response} from 'http'; - module BwipJs { - export function loadFont(fontName:string, sizeMulti: number, fontFile: string): void; - export function toBuffer(opts: ToBufferOptions, callback:(err: string|Error, png: Buffer) => void): void; - interface ToBufferOptions { - bcid: string; - text: string; +declare namespace BwipJs { + export function loadFont(fontName:string, sizeMulti: number, fontFile: string): void; + export function toBuffer(opts: ToBufferOptions, callback:(err: string|Error, png: Buffer) => void): void; + interface ToBufferOptions { + bcid: string; + text: string; - parse?: boolean; - parsefunc?: boolean; + parse?: boolean; + parsefunc?: boolean; - height?: number; - width?: number; + height?: number; + width?: number; - scaleX?: number; - scaleY?: number; - scale?: number; + scaleX?: number; + scaleY?: number; + scale?: number; - rotate?: 'N'|'R'|'L'|'I'; + rotate?: 'N'|'R'|'L'|'I'; - paddingwidth?: number; - paddingheight?: number; + paddingwidth?: number; + paddingheight?: number; - monochrome?: boolean; - alttext?: boolean; + monochrome?: boolean; + alttext?: boolean; - includetext?: boolean; - textfont?: string; - textsize?: number; - textgaps?: number; + includetext?: boolean; + textfont?: string; + textsize?: number; + textgaps?: number; - textxalign?:'offleft'|'left'|'center'|'right'|'offright'|'justify'; - textyalign?:'below'|'center'|'above'; - textxoffset?: number; - textyoffset?: number; + textxalign?:'offleft'|'left'|'center'|'right'|'offright'|'justify'; + textyalign?:'below'|'center'|'above'; + textxoffset?: number; + textyoffset?: number; - showborder?: boolean; - borderwidth?: number; - borderleft?: number; - borderright?: number; - bordertop?: number; - boraderbottom?: number; + showborder?: boolean; + borderwidth?: number; + borderleft?: number; + borderright?: number; + bordertop?: number; + boraderbottom?: number; - barcolor?: string; - backgroundcolor?: string; - bordercolor?: string; - textcolor?: string; + barcolor?: string; + backgroundcolor?: string; + bordercolor?: string; + textcolor?: string; - addontextxoffset?: number; - addontextyoffset?: number; - addontextfont?: string; - addontextsize?: number; + addontextxoffset?: number; + addontextyoffset?: number; + addontextfont?: string; + addontextsize?: number; - guardwhitespace?: boolean; - guardwidth?: number; - guardheight?: number; - guardleftpos?: number; - guardrightpos?: number; - guardleftypos?: number; - guardrightypos?: number; + guardwhitespace?: boolean; + guardwidth?: number; + guardheight?: number; + guardleftpos?: number; + guardrightpos?: number; + guardleftypos?: number; + guardrightypos?: number; - sizelimit?: number; + sizelimit?: number; - includecheck?: boolean; - includecheckintext?: boolean; + includecheck?: boolean; + includecheckintext?: boolean; - inkspread?: number; - inkspreadh?: number; - inkspreadv?: number; - } + inkspread?: number; + inkspreadh?: number; + inkspreadv?: number; } - - - function BwipJs(req: Request, res: Response, opts?:BwipJs.ToBufferOptions): void; - - export = BwipJs; } + +declare function BwipJs(req: Request, res: Response, opts?:BwipJs.ToBufferOptions): void; + +export = BwipJs; diff --git a/bwip-js/tsconfig.json b/bwip-js/tsconfig.json new file mode 100644 index 0000000000..33e3e21f35 --- /dev/null +++ b/bwip-js/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bwip-js-tests.ts" + ] +} \ No newline at end of file diff --git a/fossil-delta/fossil-delta-tests.ts b/fossil-delta/fossil-delta-tests.ts index 113757c677..f3a7635a7c 100644 --- a/fossil-delta/fossil-delta-tests.ts +++ b/fossil-delta/fossil-delta-tests.ts @@ -1,4 +1,3 @@ -/// import * as fossilDelta from "fossil-delta"; var origin = new Array(1,2,3); diff --git a/fossil-delta/index.d.ts b/fossil-delta/index.d.ts index fddb8f50af..c72e914df6 100644 --- a/fossil-delta/index.d.ts +++ b/fossil-delta/index.d.ts @@ -3,11 +3,10 @@ // Definitions by: Endel Dreyer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -declare module "fossil-delta" { - type ByteArray = Array | Uint8Array | Buffer; +/// - export function create(origin: ByteArray, target: ByteArray): Array; - export function apply(origin: ByteArray, delta: Array): Array; - export function outputSize(delta: Array): number; -} +type ByteArray = Array | Uint8Array | Buffer; + +export function create(origin: ByteArray, target: ByteArray): Array; +export function apply(origin: ByteArray, delta: Array): Array; +export function outputSize(delta: Array): number; diff --git a/fossil-delta/tsconfig.json b/fossil-delta/tsconfig.json new file mode 100644 index 0000000000..434d0761b7 --- /dev/null +++ b/fossil-delta/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fossil-delta-tests.ts" + ] +} \ No newline at end of file diff --git a/gulp-cache/gulp-cache-tests.ts b/gulp-cache/gulp-cache-tests.ts index 2efa3975fc..31df7b0259 100644 --- a/gulp-cache/gulp-cache-tests.ts +++ b/gulp-cache/gulp-cache-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as fs from "fs"; import * as gulp from "gulp"; import * as cache from "gulp-cache"; @@ -29,7 +26,7 @@ var jsHintVersion = '2.4.1', jshintOptions = fs.readFileSync('.jshintrc'); function makeHashKey(file: File) { - return [file.contents.toString('utf8'), jsHintVersion, jshintOptions].join(''); + return [(file.contents as Buffer).toString('utf8'), jsHintVersion, jshintOptions].join(''); } gulp.task('clear', function (done: any) { diff --git a/gulp-cache/index.d.ts b/gulp-cache/index.d.ts index cfb1cb2514..d576427f3d 100644 --- a/gulp-cache/index.d.ts +++ b/gulp-cache/index.d.ts @@ -3,92 +3,88 @@ // Definitions by: Arun Aravind // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// -/// +/// -declare module "gulp-cache" { - import File = require("vinyl"); - import { Transform } from "stream"; - import { PluginError } from "gulp-util"; +import File = require("vinyl"); +import { Transform } from "stream"; +import { PluginError } from "gulp-util"; - namespace gc { - type Predicate = (arg: T) => boolean; +declare namespace gc { + type Predicate = (arg: T) => boolean; - interface IGulpCacheOptions { - /** - * The cache instance to use for caching. - */ - fileCache?: IGulpCache; - - /** - * The name of the bucket which stores the cached objects. - * Default value = 'default' - */ - name?: string, - - /** - * The hash generator to use. - */ - key?: (file: File, callback?: (err: any, result: string) => void) => string | Promise; - - /** - * Value representing the success of a task. - */ - success?: boolean | Predicate; - - /** - * Content that is to be cached. - */ - value?: (result: any) => Object | Promise | string; - } - - interface ICacheOptions { - /** - * Specifies the name of the directory where the cache - * is to be stored. - */ - cacheDirName: string; - } - - interface IGulpCacheStatic { - /** - * Caches the result of a task. - * @param task The task whose result is to be cached. - */ - (task: NodeJS.ReadWriteStream): Transform; - - /** - * Caches the result of a task. - * @param task Task whose result is to be cached. - * @param options Override values for available settings. - */ - (task: NodeJS.ReadWriteStream, options: IGulpCacheOptions): Transform; - - clear(options: IGulpCacheOptions): Transform; - - /** - * Represents a cache store. - */ - Cache: IGulpCache; - - /** - * Purges the cache. - * @param err PluginError instance in case of a plugin error. - * If callback is not specified an exception of type - * 'PluginError' is thrown. - */ - clearAll(callback?: (err: PluginError) => void): void; - } + interface IGulpCacheOptions { + /** + * The cache instance to use for caching. + */ + fileCache?: IGulpCache; /** - * Represents a cach store. + * The name of the bucket which stores the cached objects. + * Default value = 'default' */ - interface IGulpCache { - new (options: ICacheOptions): any; - } + name?: string, + + /** + * The hash generator to use. + */ + key?: (file: File, callback?: (err: any, result: string) => void) => string | Promise; + + /** + * Value representing the success of a task. + */ + success?: boolean | Predicate; + + /** + * Content that is to be cached. + */ + value?: (result: any) => Object | Promise | string; } - const _: gc.IGulpCacheStatic; - export = _; + interface ICacheOptions { + /** + * Specifies the name of the directory where the cache + * is to be stored. + */ + cacheDirName: string; + } + + interface IGulpCacheStatic { + /** + * Caches the result of a task. + * @param task The task whose result is to be cached. + */ + (task: NodeJS.ReadWriteStream): Transform; + + /** + * Caches the result of a task. + * @param task Task whose result is to be cached. + * @param options Override values for available settings. + */ + (task: NodeJS.ReadWriteStream, options: IGulpCacheOptions): Transform; + + clear(options: IGulpCacheOptions): Transform; + + /** + * Represents a cache store. + */ + Cache: IGulpCache; + + /** + * Purges the cache. + * @param err PluginError instance in case of a plugin error. + * If callback is not specified an exception of type + * 'PluginError' is thrown. + */ + clearAll(callback?: (err: PluginError) => void): void; + } + + /** + * Represents a cach store. + */ + interface IGulpCache { + new (options: ICacheOptions): any; + } } + +declare const _: gc.IGulpCacheStatic; +export = _; diff --git a/gulp-cache/tsconfig.json b/gulp-cache/tsconfig.json new file mode 100644 index 0000000000..fb841a90ec --- /dev/null +++ b/gulp-cache/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-cache-tests.ts" + ] +} \ No newline at end of file diff --git a/gulp-copy/gulp-copy-tests.ts b/gulp-copy/gulp-copy-tests.ts index acb225bbe5..f4bc3ac023 100644 --- a/gulp-copy/gulp-copy-tests.ts +++ b/gulp-copy/gulp-copy-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as gulp from "gulp"; import * as gulpCopy from "gulp-copy"; diff --git a/gulp-copy/index.d.ts b/gulp-copy/index.d.ts index 68f652ed9a..18a85d1292 100644 --- a/gulp-copy/index.d.ts +++ b/gulp-copy/index.d.ts @@ -3,37 +3,32 @@ // Definitions by: Arun Aravind // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import through = require("through"); -declare module "gulp-copy" { - import through = require("through"); +/** + * Copy files to destination and expose those files as source streams for the gulp pipeline. + * + * @param outDirectory The name of the destination directory. If this directory + * does not exist, it will be created atomatically. + */ +declare function gulpCopy(outDirectory: string): through.ThroughStream; - /** - * Copy files to destination and expose those files as source streams for the gulp pipeline. - * - * @param outDirectory The name of the destination directory. If this directory - * does not exist, it will be created atomatically. - */ - function gulpCopy(outDirectory: string): through.ThroughStream; +/** + * Copy files to destination and expose those files as source streams for the gulp pipeline. + * + * @param outDirectory The name of the destination directory. If this directory + * does not exist, it will be created atomatically. + * @param options Override values for available settings. + */ +declare function gulpCopy(outDirectory: string, options: gulpCopy.GulpCopyOptions): through.ThroughStream; - /** - * Copy files to destination and expose those files as source streams for the gulp pipeline. - * - * @param outDirectory The name of the destination directory. If this directory - * does not exist, it will be created atomatically. - * @param options Override values for available settings. - */ - function gulpCopy(outDirectory: string, options: gulpCopy.GulpCopyOptions): through.ThroughStream; - - namespace gulpCopy { - - export interface GulpCopyOptions { - /** - * Specifies the number of parts of the path to be ignored as path prefixes. - */ - prefix: number; - } +declare namespace gulpCopy { + export interface GulpCopyOptions { + /** + * Specifies the number of parts of the path to be ignored as path prefixes. + */ + prefix: number; } - - export = gulpCopy; } + +export = gulpCopy; diff --git a/gulp-copy/tsconfig.json b/gulp-copy/tsconfig.json new file mode 100644 index 0000000000..052c9b42f7 --- /dev/null +++ b/gulp-copy/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-copy-tests.ts" + ] +} \ No newline at end of file diff --git a/koa-passport/index.d.ts b/koa-passport/index.d.ts index f89d534ee2..f17bf87f39 100644 --- a/koa-passport/index.d.ts +++ b/koa-passport/index.d.ts @@ -10,59 +10,54 @@ app.use(passport.session()); =============================================== */ -/// -/// -declare module "koa-passport" { +import * as Koa from "koa"; +declare module "koa" { + interface Request { + authInfo?: any; + user?: any; - import * as Koa from "koa"; - module "koa" { - interface Request { - authInfo?: any; - user?: any; + login(user: any): Promise; + login(user: any, options: Object): Promise; + logIn(user: any): Promise; + logIn(user: any, options: Object): Promise; - login(user: any): Promise; - login(user: any, options: Object): Promise; - logIn(user: any): Promise; - logIn(user: any, options: Object): Promise; + logout(): void; + logOut(): void; - logout(): void; - logOut(): void; - - isAuthenticated(): boolean; - isUnauthenticated(): boolean; - } + isAuthenticated(): boolean; + isUnauthenticated(): boolean; } - - import * as passport from "passport"; - - interface Middleware { (ctx: Koa.Context, next: () => Promise): any; } - interface KoaPassport { - use(strategy: passport.Strategy): this; - use(name: string, strategy: passport.Strategy): this; - unuse(name: string): this; - framework(fw: passport.Framework): this; - initialize(options?: { userProperty: string; }): Middleware; - session(options?: { pauseStream: boolean; }): Middleware; - - authenticate(strategy: string, callback?: Function): Middleware; - authenticate(strategy: string, options: Object, callback?: Function): Middleware; - authenticate(strategies: string[], callback?: Function): Middleware; - authenticate(strategies: string[], options: Object, callback?: Function): Middleware; - authorize(strategy: string, callback?: Function): Middleware; - authorize(strategy: string, options: Object, callback?: Function): Middleware; - authorize(strategies: string[], callback?: Function): Middleware; - authorize(strategies: string[], options: Object, callback?: Function): Middleware; - serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; - deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; - transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; - } - const koaPassport: KoaPassport; - - namespace KoaPassport { - interface Profile extends passport.Profile { } - interface Framework extends passport.Framework { } - } - - export = koaPassport; } + +import * as passport from "passport"; + +interface Middleware { (ctx: Koa.Context, next: () => Promise): any; } +interface KoaPassport { + use(strategy: passport.Strategy): this; + use(name: string, strategy: passport.Strategy): this; + unuse(name: string): this; + framework(fw: passport.Framework): this; + initialize(options?: { userProperty: string; }): Middleware; + session(options?: { pauseStream: boolean; }): Middleware; + + authenticate(strategy: string, callback?: Function): Middleware; + authenticate(strategy: string, options: Object, callback?: Function): Middleware; + authenticate(strategies: string[], callback?: Function): Middleware; + authenticate(strategies: string[], options: Object, callback?: Function): Middleware; + authorize(strategy: string, callback?: Function): Middleware; + authorize(strategy: string, options: Object, callback?: Function): Middleware; + authorize(strategies: string[], callback?: Function): Middleware; + authorize(strategies: string[], options: Object, callback?: Function): Middleware; + serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; + deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; + transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; +} +declare const koaPassport: KoaPassport; + +declare namespace KoaPassport { + interface Profile extends passport.Profile { } + interface Framework extends passport.Framework { } +} + +export = koaPassport; diff --git a/koa-passport/koa-passport-tests.ts b/koa-passport/koa-passport-tests.ts index cdfe4938f4..eebb67a3b1 100644 --- a/koa-passport/koa-passport-tests.ts +++ b/koa-passport/koa-passport-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as Koa from 'koa'; import * as passport from 'koa-passport'; diff --git a/koa-passport/tsconfig.json b/koa-passport/tsconfig.json new file mode 100644 index 0000000000..8e0b10ae18 --- /dev/null +++ b/koa-passport/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-passport-tests.ts" + ] +} \ No newline at end of file diff --git a/koa-session-minimal/index.d.ts b/koa-session-minimal/index.d.ts index e0369fcc1b..1c55660dc9 100644 --- a/koa-session-minimal/index.d.ts +++ b/koa-session-minimal/index.d.ts @@ -13,38 +13,32 @@ =============================================== */ -/// -/// +import * as Koa from "koa"; +import * as cookies from "cookies"; -declare module "koa-session-minimal" { - - import * as Koa from "koa"; - import * as cookies from "cookies"; - - module "koa" { - interface Request { - session: any; - sessionHandler: { regenerateId: () => void }; - } +declare module "koa" { + interface Request { + session: any; + sessionHandler: { regenerateId: () => void }; } - - function session(opts?: { - /** - * session cookie name and store key prefix. Default is 'koa:sess' - */ - key?: string; - - /** - * cookie options - */ - cookie?: cookies.IOptions | { (ctx?: Koa.Context): cookies.IOptions }; - - /** - * session store - */ - store?: any; - }): { (ctx: Koa.Context, next?: () => any): any }; - - namespace session {} - export = session; } + +declare function session(opts?: { + /** + * session cookie name and store key prefix. Default is 'koa:sess' + */ + key?: string; + + /** + * cookie options + */ + cookie?: cookies.IOptions | { (ctx?: Koa.Context): cookies.IOptions }; + + /** + * session store + */ + store?: any; +}): { (ctx: Koa.Context, next?: () => any): any }; + +declare namespace session {} +export = session; diff --git a/koa-session-minimal/koa-session-minimal-tests.ts b/koa-session-minimal/koa-session-minimal-tests.ts index 7ee723d3aa..b58f441d8e 100644 --- a/koa-session-minimal/koa-session-minimal-tests.ts +++ b/koa-session-minimal/koa-session-minimal-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as Koa from "koa"; import * as session from "koa-session-minimal"; diff --git a/koa-session-minimal/tsconfig.json b/koa-session-minimal/tsconfig.json new file mode 100644 index 0000000000..d269751272 --- /dev/null +++ b/koa-session-minimal/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-session-minimal-tests.ts" + ] +} \ No newline at end of file diff --git a/nodemailer-stub-transport/index.d.ts b/nodemailer-stub-transport/index.d.ts index 36eca75240..5bae849df7 100644 --- a/nodemailer-stub-transport/index.d.ts +++ b/nodemailer-stub-transport/index.d.ts @@ -3,36 +3,32 @@ // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare module "nodemailer-stub-transport" { - import * as nodemailer from "nodemailer"; - - namespace StubTransportStatic { - /** - * Options. - * @interface - */ - export interface Options { - /** - * Specifies a custom error. - * @type {any} - */ - error?: any; - - /** - * Value that indicates if the BCC addresses must be included in generated message. - * @type {boolean} - */ - keepBcc?: boolean; - } - } +import * as nodemailer from "nodemailer"; +declare namespace StubTransportStatic { /** - * Creates a stub transport. - * @param {Options} [options] Options. - * @return {Transport} The stub transport. + * Options. + * @interface */ - function stubTransport(options?: StubTransportStatic.Options): nodemailer.Transport; - export = stubTransport; + export interface Options { + /** + * Specifies a custom error. + * @type {any} + */ + error?: any; + + /** + * Value that indicates if the BCC addresses must be included in generated message. + * @type {boolean} + */ + keepBcc?: boolean; + } } + +/** + * Creates a stub transport. + * @param {Options} [options] Options. + * @return {Transport} The stub transport. + */ +declare function stubTransport(options?: StubTransportStatic.Options): nodemailer.Transport; +export = stubTransport; diff --git a/nodemailer-stub-transport/nodemailer-stub-transport-tests.ts b/nodemailer-stub-transport/nodemailer-stub-transport-tests.ts index e77bf89b41..b232717739 100644 --- a/nodemailer-stub-transport/nodemailer-stub-transport-tests.ts +++ b/nodemailer-stub-transport/nodemailer-stub-transport-tests.ts @@ -1,5 +1,3 @@ -/// - import nodemailer = require("nodemailer"); import stubTransport = require("nodemailer-stub-transport"); diff --git a/nodemailer-stub-transport/tsconfig.json b/nodemailer-stub-transport/tsconfig.json new file mode 100644 index 0000000000..655c43e6de --- /dev/null +++ b/nodemailer-stub-transport/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nodemailer-stub-transport-tests.ts" + ] +} \ No newline at end of file diff --git a/page-icon/index.d.ts b/page-icon/index.d.ts index 1e183ea289..60db62caa9 100644 --- a/page-icon/index.d.ts +++ b/page-icon/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: rhysd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace PageIcon { interface Icon { diff --git a/page-icon/page-icon-tests.ts b/page-icon/page-icon-tests.ts index 88dac1b6aa..4a6bc8c2b6 100644 --- a/page-icon/page-icon-tests.ts +++ b/page-icon/page-icon-tests.ts @@ -1,5 +1,3 @@ -/// - import * as pageIcon from "page-icon"; const siteUrl = "https://www.facebook.com/"; diff --git a/page-icon/tsconfig.json b/page-icon/tsconfig.json new file mode 100644 index 0000000000..1af988fca2 --- /dev/null +++ b/page-icon/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "page-icon-tests.ts" + ] +} \ No newline at end of file diff --git a/passport-http/index.d.ts b/passport-http/index.d.ts index 8efefc0c95..efd474404d 100644 --- a/passport-http/index.d.ts +++ b/passport-http/index.d.ts @@ -3,9 +3,6 @@ // Definitions by: Christophe Vidal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// - import passport = require("passport"); import express = require("express"); diff --git a/react-side-effect/index.d.ts b/react-side-effect/index.d.ts index edca0f08e8..ed76d56af4 100644 --- a/react-side-effect/index.d.ts +++ b/react-side-effect/index.d.ts @@ -3,25 +3,20 @@ // Definitions by: Remo H. Jansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import React = require("react"); -declare module "react-side-effect" { +declare function withSideEffect( + reducePropsToState: (propsList: any[]) => any, + handleStateChangeOnClient: (state: any) => any, + mapStateOnServer?: (state: any) => any +): ClassDecorator; - import React = __React; +declare class ElementClass extends React.Component {} - function withSideEffect( - reducePropsToState: (propsList: any[]) => any, - handleStateChangeOnClient: (state: any) => any, - mapStateOnServer?: (state: any) => any - ): ClassDecorator; - - class ElementClass extends React.Component {} - - interface ClassDecorator { - (component:T): T; - } - - namespace withSideEffect {} // https://github.com/Microsoft/TypeScript/issues/5073 - - export = withSideEffect; +interface ClassDecorator { + (component:T): T; } + +declare namespace withSideEffect {} // https://github.com/Microsoft/TypeScript/issues/5073 + +export = withSideEffect; diff --git a/react-side-effect/react-side-effect-tests.ts b/react-side-effect/react-side-effect-tests.ts index 8dab67d235..353b0754f5 100644 --- a/react-side-effect/react-side-effect-tests.ts +++ b/react-side-effect/react-side-effect-tests.ts @@ -1,5 +1,3 @@ -/// - import * as React from "react"; import * as withSideEffect from "react-side-effect"; diff --git a/react-side-effect/tsconfig.json b/react-side-effect/tsconfig.json new file mode 100644 index 0000000000..47bcf759b7 --- /dev/null +++ b/react-side-effect/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-side-effect-tests.ts" + ] +} \ No newline at end of file diff --git a/send/index.d.ts b/send/index.d.ts index d48a66cc23..4b738fa011 100644 --- a/send/index.d.ts +++ b/send/index.d.ts @@ -3,240 +3,237 @@ // Definitions by: Mike Jerred // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// +/// -declare module "send" { - import * as stream from "stream"; - import * as fs from "fs"; +import * as stream from "stream"; +import * as fs from "fs"; - /** - * Create a new SendStream for the given path to send to a res. - * The req is the Node.js HTTP request and the path is a urlencoded path to send (urlencoded, not the actual file-system path). - */ - function send(req: stream.Readable, path: string, options?: send.SendOptions): send.SendStream; +/** + * Create a new SendStream for the given path to send to a res. + * The req is the Node.js HTTP request and the path is a urlencoded path to send (urlencoded, not the actual file-system path). + */ +declare function send(req: stream.Readable, path: string, options?: send.SendOptions): send.SendStream; - import * as m from "mime"; +import * as m from "mime"; - namespace send { - var mime: typeof m; - interface SendOptions { - /** - * Enable or disable accepting ranged requests, defaults to true. - * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header. - */ - acceptRanges?: boolean; +declare namespace send { + var mime: typeof m; + interface SendOptions { + /** + * Enable or disable accepting ranged requests, defaults to true. + * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header. + */ + acceptRanges?: boolean; - /** - * Enable or disable setting Cache-Control response header, defaults to true. - * Disabling this will ignore the maxAge option. - */ - cacheControl?: boolean; + /** + * Enable or disable setting Cache-Control response header, defaults to true. + * Disabling this will ignore the maxAge option. + */ + cacheControl?: boolean; - /** - * Set how "dotfiles" are treated when encountered. - * A dotfile is a file or directory that begins with a dot ("."). - * Note this check is done on the path itself without checking if the path actually exists on the disk. - * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). - * 'allow' No special treatment for dotfiles. - * 'deny' Send a 403 for any request for a dotfile. - * 'ignore' Pretend like the dotfile does not exist and 404. - * The default value is similar to 'ignore', with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility. - */ - dotfiles?: "allow" | "deny" | "ignore"; + /** + * Set how "dotfiles" are treated when encountered. + * A dotfile is a file or directory that begins with a dot ("."). + * Note this check is done on the path itself without checking if the path actually exists on the disk. + * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). + * 'allow' No special treatment for dotfiles. + * 'deny' Send a 403 for any request for a dotfile. + * 'ignore' Pretend like the dotfile does not exist and 404. + * The default value is similar to 'ignore', with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility. + */ + dotfiles?: "allow" | "deny" | "ignore"; - /** - * Byte offset at which the stream ends, defaults to the length of the file minus 1. - * The end is inclusive in the stream, meaning end: 3 will include the 4th byte in the stream. - */ - end?: number; + /** + * Byte offset at which the stream ends, defaults to the length of the file minus 1. + * The end is inclusive in the stream, meaning end: 3 will include the 4th byte in the stream. + */ + end?: number; - /** - * Enable or disable etag generation, defaults to true. - */ - etag?: boolean; + /** + * Enable or disable etag generation, defaults to true. + */ + etag?: boolean; - /** - * If a given file doesn't exist, try appending one of the given extensions, in the given order. - * By default, this is disabled (set to false). - * An example value that will serve extension-less HTML files: ['html', 'htm']. - * This is skipped if the requested file already has an extension. - */ - extensions?: string[] | string | boolean; + /** + * If a given file doesn't exist, try appending one of the given extensions, in the given order. + * By default, this is disabled (set to false). + * An example value that will serve extension-less HTML files: ['html', 'htm']. + * This is skipped if the requested file already has an extension. + */ + extensions?: string[] | string | boolean; - /** - * By default send supports "index.html" files, to disable this set false or to supply a new index pass a string or an array in preferred order. - */ - index?: string[] | string | boolean; + /** + * By default send supports "index.html" files, to disable this set false or to supply a new index pass a string or an array in preferred order. + */ + index?: string[] | string | boolean; - /** - * Enable or disable Last-Modified header, defaults to true. - * Uses the file system's last modified value. - */ - lastModified?: boolean; + /** + * Enable or disable Last-Modified header, defaults to true. + * Uses the file system's last modified value. + */ + lastModified?: boolean; - /** - * Provide a max-age in milliseconds for http caching, defaults to 0. - * This can also be a string accepted by the ms module. - */ - maxAge?: string | number; + /** + * Provide a max-age in milliseconds for http caching, defaults to 0. + * This can also be a string accepted by the ms module. + */ + maxAge?: string | number; - /** - * Serve files relative to path. - */ - root?: string; + /** + * Serve files relative to path. + */ + root?: string; - /** - * Byte offset at which the stream starts, defaults to 0. - * The start is inclusive, meaning start: 2 will include the 3rd byte in the stream. - */ - start?: number; - } - - interface SendStream extends stream.Stream { - /** - * @deprecated pass etag as option - * Enable or disable etag generation. - */ - etag(val: boolean): SendStream; - - /** - * @deprecated use dotfiles option - * Enable or disable "hidden" (dot) files. - */ - hidden(val: boolean): SendStream; - - /** - * @deprecated pass index as option - * Set index `paths`, set to a falsy value to disable index support. - */ - index(paths: string[] | string): SendStream; - - /** - * @deprecated pass root as option - * Set root `path`. - */ - root(paths: string): SendStream; - - /** - * @deprecated pass root as option - * Set root `path`. - */ - from(paths: string): SendStream; - - /** - * @deprecated pass maxAge as option - * Set max-age to `maxAge`. - */ - maxage(maxAge: string | number): SendStream; - - /** - * Emit error with `status`. - * @private - */ - error(status: number, error?: Error): void; - - /** - * Check if the pathname ends with "/". - * @private - */ - hasTrailingSlash(): boolean; - - /** - * Check if this is a conditional GET request. - * @private - */ - isConditionalGET(): boolean; - - /** - * Strip content-* header fields. - * @private - */ - removeContentHeaderFields(): void; - - /** - * Respond with 304 not modified. - * @private - */ - notModified(): void; - - /** - * Raise error that headers already sent. - * @private - */ - headersAlreadySent(): void; - - /** - * Check if the request is cacheable, aka responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). - * @private - */ - isCachable(): boolean; - - /** - * Handle stat() error. - * @private - */ - onStatError(error: Error): void; - - /** - * Check if the cache is fresh. - * @private - */ - isFresh(): boolean; - - /** - * Check if the range is fresh. - * @private - */ - isRangeFresh(): boolean; - - /** - * Redirect to path. - * @private - */ - redirect(path: string): void; - - /** - * Pipe to `res`. - */ - pipe(res: stream.Writable): stream.Writable; - - /** - * Transfer `path`. - */ - send(path: string, stat?: fs.Stats): void; - - /** - * Transfer file for `path`. - * @private - */ - sendFile(path: string): void; - - /** - * Transfer index for `path`. - * @private - */ - sendIndex(path: string): void; - - /** - * Transfer index for `path`. - * @private - */ - stream(path: string, options?: {}): void; - - /** - * Set content-type based on `path` if it hasn't been explicitly set. - * @private - */ - type(path: string): void; - - /** - * Set response header fields, most fields may be pre-defined. - * @private - */ - setHeader(path: string, stat: fs.Stats): void; - } + /** + * Byte offset at which the stream starts, defaults to 0. + * The start is inclusive, meaning start: 2 will include the 3rd byte in the stream. + */ + start?: number; } - export = send; -} \ No newline at end of file + interface SendStream extends stream.Stream { + /** + * @deprecated pass etag as option + * Enable or disable etag generation. + */ + etag(val: boolean): SendStream; + + /** + * @deprecated use dotfiles option + * Enable or disable "hidden" (dot) files. + */ + hidden(val: boolean): SendStream; + + /** + * @deprecated pass index as option + * Set index `paths`, set to a falsy value to disable index support. + */ + index(paths: string[] | string): SendStream; + + /** + * @deprecated pass root as option + * Set root `path`. + */ + root(paths: string): SendStream; + + /** + * @deprecated pass root as option + * Set root `path`. + */ + from(paths: string): SendStream; + + /** + * @deprecated pass maxAge as option + * Set max-age to `maxAge`. + */ + maxage(maxAge: string | number): SendStream; + + /** + * Emit error with `status`. + * @private + */ + error(status: number, error?: Error): void; + + /** + * Check if the pathname ends with "/". + * @private + */ + hasTrailingSlash(): boolean; + + /** + * Check if this is a conditional GET request. + * @private + */ + isConditionalGET(): boolean; + + /** + * Strip content-* header fields. + * @private + */ + removeContentHeaderFields(): void; + + /** + * Respond with 304 not modified. + * @private + */ + notModified(): void; + + /** + * Raise error that headers already sent. + * @private + */ + headersAlreadySent(): void; + + /** + * Check if the request is cacheable, aka responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). + * @private + */ + isCachable(): boolean; + + /** + * Handle stat() error. + * @private + */ + onStatError(error: Error): void; + + /** + * Check if the cache is fresh. + * @private + */ + isFresh(): boolean; + + /** + * Check if the range is fresh. + * @private + */ + isRangeFresh(): boolean; + + /** + * Redirect to path. + * @private + */ + redirect(path: string): void; + + /** + * Pipe to `res`. + */ + pipe(res: stream.Writable): stream.Writable; + + /** + * Transfer `path`. + */ + send(path: string, stat?: fs.Stats): void; + + /** + * Transfer file for `path`. + * @private + */ + sendFile(path: string): void; + + /** + * Transfer index for `path`. + * @private + */ + sendIndex(path: string): void; + + /** + * Transfer index for `path`. + * @private + */ + stream(path: string, options?: {}): void; + + /** + * Set content-type based on `path` if it hasn't been explicitly set. + * @private + */ + type(path: string): void; + + /** + * Set response header fields, most fields may be pre-defined. + * @private + */ + setHeader(path: string, stat: fs.Stats): void; + } +} + +export = send; diff --git a/send/send-tests.ts b/send/send-tests.ts index 25a3e457ee..22e3e171f2 100644 --- a/send/send-tests.ts +++ b/send/send-tests.ts @@ -1,5 +1,4 @@ -/// -/// +/// import * as express from 'express'; import * as send from 'send'; diff --git a/send/tsconfig.json b/send/tsconfig.json new file mode 100644 index 0000000000..3d9a6c0bd6 --- /dev/null +++ b/send/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "send-tests.ts" + ] +} \ No newline at end of file diff --git a/sinon-mongoose/index.d.ts b/sinon-mongoose/index.d.ts index 13e8a3f3a6..f2d15651e8 100644 --- a/sinon-mongoose/index.d.ts +++ b/sinon-mongoose/index.d.ts @@ -3,16 +3,13 @@ // Definitions by: stevehipwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare namespace Sinon { +import * as s from "sinon"; +declare module "sinon" { export interface SinonStub { - /** * When called, the stub will create a new stub to represent a mongoose chained function. */ chain(name: string): SinonStub } - } diff --git a/sinon-mongoose/sinon-mongoose-tests.ts b/sinon-mongoose/sinon-mongoose-tests.ts index 1d32e25776..b16ed166eb 100644 --- a/sinon-mongoose/sinon-mongoose-tests.ts +++ b/sinon-mongoose/sinon-mongoose-tests.ts @@ -1,4 +1,5 @@ -/// +import * as sinon from "sinon"; + function testChain() { sinon.stub().chain('exec'); } diff --git a/sinon-mongoose/tsconfig.json b/sinon-mongoose/tsconfig.json new file mode 100644 index 0000000000..e7413b6c50 --- /dev/null +++ b/sinon-mongoose/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sinon-mongoose-tests.ts" + ] +} \ No newline at end of file