Skip to content

Commit b814133

Browse files
committed
refactor: typed all official plugins
1 parent cb07377 commit b814133

File tree

24 files changed

+79
-23
lines changed

24 files changed

+79
-23
lines changed

packages/@vuepress/plugin-active-header-links/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const { path } = require('@vuepress/shared-utils')
22

3-
module.exports = (options) => ({
3+
/**
4+
* @type {import('@vuepress/types').Plugin}
5+
*/
6+
module.exports = options => ({
47
clientRootMixin: path.resolve(__dirname, 'clientRootMixin.js'),
58
define: {
69
AHL_SIDEBAR_LINK_SELECTOR: options.sidebarLinkSelector || '.sidebar-link',

packages/@vuepress/plugin-active-header-links/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"author": "ULIVZ <chl814@foxmail.com>",
2222
"main": "index.js",
2323
"dependencies": {
24+
"@vuepress/types": "1.9.1",
2425
"lodash.debounce": "^4.0.8"
2526
},
2627
"publishConfig": {

packages/@vuepress/plugin-back-to-top/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const { path } = require('@vuepress/shared-utils')
22

3+
/**
4+
* @type {import('@vuepress/types').Plugin}
5+
*/
36
module.exports = {
47
enhanceAppFiles: [
58
path.resolve(__dirname, 'enhanceAppFile.js')

packages/@vuepress/plugin-back-to-top/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"author": "ULIVZ <chl814@foxmail.com>",
2222
"main": "index.js",
2323
"dependencies": {
24+
"@vuepress/types": "1.9.1",
2425
"lodash.debounce": "^4.0.8"
2526
},
2627
"publishConfig": {

packages/@vuepress/plugin-google-analytics/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const { path } = require('@vuepress/shared-utils')
22

3+
/**
4+
* @type {import('@vuepress/types').Plugin}
5+
*/
36
module.exports = (options = {}, context) => ({
47
define () {
58
const { siteConfig = {}} = context

packages/@vuepress/plugin-google-analytics/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"license": "MIT",
2121
"author": "ULIVZ <chl814@foxmail.com>",
2222
"main": "index.js",
23+
"dependencies": {
24+
"@vuepress/types": "1.9.1"
25+
},
2326
"publishConfig": {
2427
"access": "public"
2528
}

packages/@vuepress/plugin-last-updated/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const path = require('path')
22
const spawn = require('cross-spawn')
33

4+
/**
5+
* @type {import('@vuepress/types').Plugin}
6+
*/
47
module.exports = (options = {}, context) => ({
58
extendPageData ($page) {
69
const { transformer, dateOptions } = options

packages/@vuepress/plugin-last-updated/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"author": "ULIVZ <chl814@foxmail.com>",
2222
"main": "index.js",
2323
"dependencies": {
24+
"@vuepress/types": "1.9.1",
2425
"cross-spawn": "^6.0.5"
2526
},
2627
"publishConfig": {

packages/@vuepress/plugin-medium-zoom/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const { path } = require('@vuepress/shared-utils')
22

3+
/**
4+
* @type {import('@vuepress/types').Plugin}
5+
*/
36
module.exports = (options, context) => ({
47
define: {
58
SELECTOR: options.selector || '.theme-default-content :not(a) > img',

packages/@vuepress/plugin-medium-zoom/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"author": "ULIVZ <chl814@foxmail.com>",
2222
"main": "index.js",
2323
"dependencies": {
24+
"@vuepress/types": "1.9.1",
2425
"medium-zoom": "^1.0.4"
2526
},
2627
"publishConfig": {

0 commit comments

Comments
 (0)