diff --git a/browser-pack/browser-pack-tests.ts b/browser-pack/browser-pack-tests.ts index 4cf20249e8..b6b7446d31 100644 --- a/browser-pack/browser-pack-tests.ts +++ b/browser-pack/browser-pack-tests.ts @@ -1,11 +1,9 @@ -/// - import browserPack = require("browser-pack"); module BrowserPackTest { - export function packIt(opts?: BrowserPack.Options) { - var packOpts: BrowserPack.Options = { + export function packIt(opts?: browserPack.Options) { + var packOpts: browserPack.Options = { basedir: opts.basedir || "./", externalRequireName: opts.externalRequireName || "require", hasExports: opts.hasExports || false, diff --git a/browser-pack/browser-pack.d.ts b/browser-pack/index.d.ts similarity index 86% rename from browser-pack/browser-pack.d.ts rename to browser-pack/index.d.ts index 52b96ce134..4006eb4f3f 100644 --- a/browser-pack/browser-pack.d.ts +++ b/browser-pack/index.d.ts @@ -3,11 +3,11 @@ // Definitions by: TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /** pack node-style source files from a json stream into a browser bundle */ -declare module BrowserPack { +declare namespace browserPack { export interface Options { /** Whether the bundle should include require= (or the opts.externalRequireName) so that @@ -50,12 +50,10 @@ declare module BrowserPack { */ sourceMapPrefix?: string; } - } -declare module "browser-pack" { - /** pack node-style source files from a json stream into a browser bundle - */ - function browserPack(opts?: BrowserPack.Options): NodeJS.ReadWriteStream; - export = browserPack; -} \ No newline at end of file +/** pack node-style source files from a json stream into a browser bundle + */ +declare function browserPack(opts?: browserPack.Options): NodeJS.ReadWriteStream; +export = browserPack; +export as namespace browserPack; \ No newline at end of file diff --git a/browser-pack/tsconfig.json b/browser-pack/tsconfig.json new file mode 100644 index 0000000000..aa0bdc75fd --- /dev/null +++ b/browser-pack/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "browser-pack-tests.ts" + ] +} \ No newline at end of file