Skip to content

Commit

Permalink
Merge pull request #13 from dutchenkoOleg/master
Browse files Browse the repository at this point in the history
Add TypeScript support
  • Loading branch information
OlehDutchenko authored Feb 17, 2020
2 parents a6b87bf + e122741 commit 970bd50
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---

Expand Down
9 changes: 9 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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
}
26 changes: 1 addition & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,38 @@
/**
* @module WebPluginInterface
* @author OlegDutchenko <[email protected]>
* @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
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-plugin-interface",
"version": "3.1.2",
"version": "3.2.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 970bd50

Please sign in to comment.