Skip to content

Commit e122741

Browse files
committed
Add TypeScript support
1 parent a6b87bf commit e122741

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/WezomAgency/web-plugin-interface/blob/master/LICENSE)
44
[![npm](https://img.shields.io/badge/npm-install-orange.svg)](https://www.npmjs.com/package/web-plugin-interface)
55
[![Javascript Style Guide](https://img.shields.io/badge/code_style-wezom_relax-red.svg)](https://github.com/WezomAgency/eslint-config-wezom-relax#readme)
6+
![types](https://img.shields.io/badge/types-TypeScript-blue)
67

78
---
89

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export abstract class WebPluginInterface {
2+
public get defaultSettings (): {[p: string]: any}
3+
public get defaultProps (): {[p: string]: any}
4+
protected _setup (): any
5+
protected _beforeInitialize (): any
6+
protected _afterInitialize (): any
7+
protected _initialize (): any
8+
public initialize (): any
9+
}

index.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,38 @@
33
/**
44
* @module WebPluginInterface
55
* @author OlegDutchenko <[email protected]>
6-
* @version 3.0.3
6+
* @version 3.2.0
77
*/
88

9-
/**
10-
* @interface
11-
*/
129
export class WebPluginInterface {
1310
constructor () { // eslint-disable-line no-useless-constructor
1411
// code
1512
}
1613

17-
/**
18-
* @type {Object}
19-
*/
2014
get defaultSettings () {
2115
return {};
2216
}
2317

24-
/**
25-
* @type {Object}
26-
*/
2718
get defaultProps () {
2819
return {};
2920
}
3021

31-
/**
32-
* @protected
33-
*/
3422
_setup () {
3523
// code
3624
}
3725

38-
/**
39-
* @protected
40-
*/
4126
_beforeInitialize () {
4227
// code
4328
}
4429

45-
/**
46-
* @protected
47-
*/
4830
_afterInitialize () {
4931
// code
5032
}
5133

52-
/**
53-
* @protected
54-
*/
5534
_initialize () {
5635
// code
5736
}
5837

59-
/**
60-
* @public
61-
*/
6238
initialize () {
6339
// code
6440
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-plugin-interface",
3-
"version": "3.1.2",
3+
"version": "3.2.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)