{"name":"deprecated-decorator","version":"0.1.4","description":"A simple decorator for deprecated methods and properties.","main":"bld/index.js","typings":"bld/index.d.ts","scripts":{"build":"tsc","test":"node node_modules/mocha/bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/vilic/deprecated-decorator.git"},"keywords":["deprecated","decorator","typescript","babel","es7"],"author":{"name":"vilicvane"},"license":"MIT","bugs":{"url":"https://github.com/vilic/deprecated-decorator/issues"},"homepage":"https://github.com/vilic/deprecated-decorator#readme","devDependencies":{"chai":"latest","mocha":"latest","sinon":"latest","source-map-support":"latest","typescript":"latest"},"gitHead":"28a7e2407b3ee73ad5df2a6e03a7c072b5671333","_id":"deprecated-decorator@0.1.4","_shasum":"4648498a749f4d0ff9f3ab251f0b8c6c49fe9e3e","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"vilic","email":"i@vilic.info"},"maintainers":[{"name":"vilic","email":"i@vilic.info"}],"dist":{"shasum":"4648498a749f4d0ff9f3ab251f0b8c6c49fe9e3e","tarball":"http://registry-npm.ywwl.com/deprecated-decorator/download/deprecated-decorator-0.1.4.tgz","integrity":"sha512-m7T5KtxN99r1tnmvXOBmDchsWk5bWvVLrHDtN/blsGFZlU7xOF+WR/sep9nDUNtpUhN41qtRPmkp77d7eKeOUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkrsNqiVbs9jC3qSMC7M7l4tMygO50ucmqsFVItvU9dAiBpz8SnJSZISc71+UKxViZI/OU6FGpdM1+85bpiC2WByw=="}],"size":4997,"noattachment":false,"key":"/deprecated-decorator/-/deprecated-decorator-0.1.4.tgz"},"directories":{},"readme":"[![NPM Package](https://badge.fury.io/js/deprecated-decorator.svg)](https://www.npmjs.com/package/deprecated-decorator)\n[![Build Status](https://travis-ci.org/vilic/deprecated-decorator.svg)](https://travis-ci.org/vilic/deprecated-decorator) \n\n# Deprecated Decorator\n\nA simple decorator for deprecated properties, methods and classes. It can also wrap normal functions via the old-fashioned way.\n\nTranspilers supported:\n\n- **TypeScript** with `experimentalDecorators` option enabled.\n- **Babel** with [transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) for version 6.x.\n\n## Install\n\n```sh\nnpm install deprecated-decorator --save\n```\n\n## API References\n\n```ts\nexport declare type DeprecatedDecorator = ClassDecorator & PropertyDecorator;\n\nexport interface DeprecatedOptions {\n    alternative?: string;\n    version?: string;\n    url?: string;\n}\n\nexport declare function deprecated(options?: DeprecatedOptions): DeprecatedDecorator;\nexport declare function deprecated(alternative?: string, version?: string, url?: string): DeprecatedDecorator;\n\nexport declare function deprecated<T extends Function>(fn: T): T;\nexport declare function deprecated<T extends Function>(options: DeprecatedOptions, fn: T): T;\nexport declare function deprecated<T extends Function>(alternative: string, fn: T): T;\nexport declare function deprecated<T extends Function>(alternative: string, version: string, fn: T): T;\nexport declare function deprecated<T extends Function>(alternative: string, version: string, url: string, fn: T): T;\n\nexport default deprecated;\n```\n\n## Usage\n\nDecorating a class will enable warning on constructor and static methods (including static getters and setters):\n\n```ts\nimport deprecated from 'deprecated-decorator';\n\n// alternative, since version, url\n@deprecated('Bar', '0.1.0', 'http://vane.life/')\nclass Foo {\n    static method() { }\n}\n```\n\nOr you can decorate methods respectively:\n\n```ts\nimport deprecated from 'deprecated-decorator';\n\nclass Foo {\n    @deprecated('otherMethod')\n    method() { }\n    \n    @deprecated({\n        alternative: 'otherProperty',\n        version: '0.1.2',\n        url: 'http://vane.life/'\n    })\n    get property() { }\n}\n```\n\nFor functions:\n\n```ts\nimport deprecated from 'deprecated-decorator';\n\nlet foo = deprecated({\n    alternative: 'bar',\n    version: '0.1.0'\n}, function foo() {\n    // ...\n});\n```\n\n## License\n\nMIT License.\n","publish_time":1451915758709,"_cnpm_publish_time":1451915758709,"dist-tags":{"latest":"0.1.6"}}