{
  "name": "tsdlocal",
  "description": "Rewrite .d.ts definitions as local modules.",
  "author": {
    "name": "Bogdan Mustiata",
    "email": "bogdan.mustiata@gmail.com"
  },
  "version": "0.1.6",
  "dependencies": {
    "colors": "^1.1.2",
    "mkdirp": "^0.5.1",
    "nomnom": "^1.8.1",
    "shelljs": "^0.5.1"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-sync": "^0.2.3",
    "grunt-typescript": "^0.6.2",
    "tsdlocal": "0.1.2"
  },
  "keywords": [
    "tsd-generator",
    "tsd",
    "local-module"
  ],
  "bin": {
    "tsdlocal": "target/launcher.js"
  },
  "main": "./target/out.js",
  "bugs": {
    "url": "https://github.com/bmustiata/tsdlocal/issues"
  },
  "licenses": [
    {
      "type": "BSD",
      "url": "https://github.com/bmustiata/tsdlocal/blob/master/LICENSE"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/bmustiata/tsdlocal.git"
  },
  "readme": "# tsdlocal\nTransform `.d.ts` files to look like local modules. Then rewrite your\noutput javascript file to use actual `require()` statements. All this\nwithout using `--module` in tsc.\n## Usage\nTo generate a definition:\n```\ntsdlocal in.d.ts out.local.d.ts\n```\nTo process code that uses local definitions.\n```\ntsdlocal --parsejs in.js out.js\n```\nFor example for using the `require(\"path\")`, you would need to write:\n```typescript\n/// <reference path=\"/typings/node/node.local.d.ts\"/>\nimport path = __require__path; // require(\"path\")\n```\n## Grunt Parsing\nGrunt support is embedded. In order to parse your outputed sources as\npart of the build, you just need to add it:\n```javascript\n/**\n * Grunt project configuration.\n */\nmodule.exports = function(grunt) {\n    // configuration for the plugins.\n    grunt.initConfig({\n        tsdlocal : {\n            dist : {\n                files : [\n                    {\n                        expand: true,\n                        cwd: 'dest/',\n                        src: ['**/*.js'],\n                        dest: 'dest/'\n                    }\n                ]\n            }\n        }\n    });\n    // load NPM tasks:\n    grunt.loadNpmTasks('tsdlocal');\n    // register our task:\n    grunt.registerTask('default', ['tsdlocal']);\n};\n```\nUsing the same source and destination works, since the task will first read the file,\nthen process it, and only after rewriting it.\nThis is equivalent with running `tsdlocal --parsejs` for each js file.\n### Local definitions generation\nIf you want to generate namespace definitions from some module definitions,\nyou can use the generateDefinitions option.\n```javascript\n    tsdlocal : {\n        \"dist\" : {\n            options : {\n                generateDefinitions : true\n            },\n            files : [\n                {\n                    src: [\n                        \"./core-promise.d.ts\"\n                    ],\n                    dest: \"./core-promise.local.d.ts\"\n                }\n            ]\n        }\n    }\n```\n## Note\nThere is a high chance that the local .d.ts to still need a bit\nof fidling from your side, namely for modules that export instances\nfor the exports. Like so:\n```typescript\ndeclare module \"x\" {\n    export = someInstance;\n}\n```\nIf that's the case, then you probably need to assign a variable, declare\nthe variable with the name `__require__x`, and the type of the instance:\n```typescript\ndeclare var __require__x : someInstanceType;\n```\n and in the client do:\n```typescript\n// instead of:\n//\n// import mymodule = __require__x; // require(\"x\")\n//\n// do:\nvar mymodule = __require__x; // require(\"x\")\n```\nThe static type checking will still function as expected.\n## ChangeLog\n* v0.1.6  2015-08-28  **Bugfix** Imports that have also classes are working. (`import A = __require__x.A;`)\n* v0.1.5  2015-07-22  The grunt task can also parse definitions now.\n* v0.1.4  2015-07-20  Use out.js for the standalone launcher, duh.\n* v0.1.3  2015-07-15  Use v0.1.2 grunt task to build itself.\n* v0.1.2  2015-07-15  Added Grunt task.\n* v0.1.1  2015-07-14  Documentation update.\n* v0.1.0  2015-07-10  Initial implementation.\n",
  "readmeFilename": "README.md",
  "homepage": "http://blog.ciplogic.com"
}
