From e122741283771ddc507f018b6c0269a0fd98da58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D1=82=D1=87=D0=B5=D0=BD=D0=BA=D0=BE=20=D0=9E?= =?UTF-8?q?=D0=BB=D0=B5=D0=B3?= Date: Mon, 17 Feb 2020 12:21:22 +0200 Subject: [PATCH] Add TypeScript support --- README.md | 1 + index.d.ts | 9 +++++++++ index.js | 26 +------------------------- package.json | 2 +- 4 files changed, 12 insertions(+), 26 deletions(-) create mode 100644 index.d.ts diff --git a/README.md b/README.md index 9d9adb6..ed6a5a2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/WezomAgency/web-plugin-interface/blob/master/LICENSE) [![npm](https://img.shields.io/badge/npm-install-orange.svg)](https://www.npmjs.com/package/web-plugin-interface) [![Javascript Style Guide](https://img.shields.io/badge/code_style-wezom_relax-red.svg)](https://github.com/WezomAgency/eslint-config-wezom-relax#readme) +![types](https://img.shields.io/badge/types-TypeScript-blue) --- diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..f9b2bfb --- /dev/null +++ b/index.d.ts @@ -0,0 +1,9 @@ +export abstract class WebPluginInterface { + public get defaultSettings (): {[p: string]: any} + public get defaultProps (): {[p: string]: any} + protected _setup (): any + protected _beforeInitialize (): any + protected _afterInitialize (): any + protected _initialize (): any + public initialize (): any +} diff --git a/index.js b/index.js index 3d0e8c5..1fe4f35 100644 --- a/index.js +++ b/index.js @@ -3,62 +3,38 @@ /** * @module WebPluginInterface * @author OlegDutchenko - * @version 3.0.3 + * @version 3.2.0 */ -/** - * @interface - */ export class WebPluginInterface { constructor () { // eslint-disable-line no-useless-constructor // code } - /** - * @type {Object} - */ get defaultSettings () { return {}; } - /** - * @type {Object} - */ get defaultProps () { return {}; } - /** - * @protected - */ _setup () { // code } - /** - * @protected - */ _beforeInitialize () { // code } - /** - * @protected - */ _afterInitialize () { // code } - /** - * @protected - */ _initialize () { // code } - /** - * @public - */ initialize () { // code } diff --git a/package.json b/package.json index 091d123..60b9dfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-plugin-interface", - "version": "3.1.2", + "version": "3.2.0", "description": "", "main": "index.js", "scripts": {