vite-userscript-plugin 1.9.2 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -3
- package/dist/index.d.ts +20 -4
- package/dist/index.js +294 -4
- package/dist/ws.js +14 -1
- package/package.json +30 -31
- package/types/greasemonkey.d.ts +275 -213
- package/types/tampermonkey.d.ts +593 -120
- package/types/violentmonkey.d.ts +85 -10
- package/dist/index.cjs +0 -5
- package/dist/index.d.cts +0 -171
package/types/violentmonkey.d.ts
CHANGED
|
@@ -9,10 +9,21 @@ declare type VMScriptRunAt =
|
|
|
9
9
|
/** Injection mode of a script. */
|
|
10
10
|
declare type VMScriptInjectInto = 'auto' | 'page' | 'content'
|
|
11
11
|
|
|
12
|
+
declare type GenericObject = Record<string, unknown>
|
|
13
|
+
|
|
12
14
|
declare interface VMScriptGMInfoPlatform {
|
|
13
|
-
arch:
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
arch:
|
|
16
|
+
| 'aarch64'
|
|
17
|
+
| 'arm'
|
|
18
|
+
| 'arm64'
|
|
19
|
+
| 'mips'
|
|
20
|
+
| 'mips64'
|
|
21
|
+
| 'ppc64'
|
|
22
|
+
| 's390x'
|
|
23
|
+
| 'sparc64'
|
|
24
|
+
| 'x86-32'
|
|
25
|
+
| 'x86-64'
|
|
26
|
+
browserName: 'chrome' | 'firefox' | string
|
|
16
27
|
browserVersion: string
|
|
17
28
|
os: 'mac' | 'win' | 'android' | 'cros' | 'linux' | 'openbsd' | 'fuchsia'
|
|
18
29
|
}
|
|
@@ -53,6 +64,10 @@ declare interface VMScriptGMInfoScriptMeta {
|
|
|
53
64
|
declare interface VMScriptGMInfoObject {
|
|
54
65
|
/** Unique ID of the script. */
|
|
55
66
|
uuid: string
|
|
67
|
+
/** The injection mode of current script. */
|
|
68
|
+
injectInto: VMScriptInjectInto
|
|
69
|
+
/** Contains structured fields from the *Metadata Block*. */
|
|
70
|
+
script: VMScriptGMInfoScriptMeta
|
|
56
71
|
/** The meta block of the script. */
|
|
57
72
|
scriptMetaStr: string
|
|
58
73
|
/** Whether the script will be updated automatically. */
|
|
@@ -68,10 +83,14 @@ declare interface VMScriptGMInfoObject {
|
|
|
68
83
|
* extension API (`browser.runtime.getPlatformInfo` and `getBrowserInfo`).
|
|
69
84
|
*/
|
|
70
85
|
platform: VMScriptGMInfoPlatform
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
/**
|
|
87
|
+
* A copy of navigator.userAgentData from the content script of the extension.
|
|
88
|
+
* @since VM2.20.2 */
|
|
89
|
+
userAgentData?: {
|
|
90
|
+
brands: { brand: string; version: string }[]
|
|
91
|
+
mobile: boolean
|
|
92
|
+
platform: string
|
|
93
|
+
}
|
|
75
94
|
}
|
|
76
95
|
|
|
77
96
|
/**
|
|
@@ -84,10 +103,18 @@ declare function GM_log(...args: any): void
|
|
|
84
103
|
|
|
85
104
|
/** Retrieves a value for current script from storage. */
|
|
86
105
|
declare function GM_getValue<T>(name: string, defaultValue?: T): T
|
|
106
|
+
/** @since VM2.19.1 */
|
|
107
|
+
declare function GM_getValues(names: string[]): GenericObject
|
|
108
|
+
/** @since VM2.19.1 */
|
|
109
|
+
declare function GM_getValues(namesWithDefaults: GenericObject): GenericObject
|
|
87
110
|
/** Sets a key / value pair for current script to storage. */
|
|
88
111
|
declare function GM_setValue<T>(name: string, value: T): void
|
|
112
|
+
/** @since VM2.19.1 */
|
|
113
|
+
declare function GM_setValues(values: GenericObject): void
|
|
89
114
|
/** Deletes an existing key / value pair for current script from storage. */
|
|
90
115
|
declare function GM_deleteValue(name: string): void
|
|
116
|
+
/** @since VM2.19.1 */
|
|
117
|
+
declare function GM_deleteValues(names: string[]): void
|
|
91
118
|
/** Returns an array of keys of all available values within this script. */
|
|
92
119
|
declare function GM_listValues(): string[]
|
|
93
120
|
|
|
@@ -214,13 +241,25 @@ declare function GM_openInTab(
|
|
|
214
241
|
|
|
215
242
|
/**
|
|
216
243
|
* Registers a command in Violentmonkey popup menu.
|
|
244
|
+
* Returns the command's id since VM2.12.5, see description of the `id` parameter.
|
|
217
245
|
* If you want to add a shortcut, please see `@violentmonkey/shortcut`.
|
|
218
246
|
*/
|
|
219
247
|
declare function GM_registerMenuCommand(
|
|
220
248
|
/** The name to show in the popup menu. */
|
|
221
249
|
caption: string,
|
|
222
250
|
/** Callback function when the command is clicked in the menu. */
|
|
223
|
-
onClick: (event: MouseEvent | KeyboardEvent) => void
|
|
251
|
+
onClick: (event: MouseEvent | KeyboardEvent) => void,
|
|
252
|
+
/** @since VM2.15.9 */
|
|
253
|
+
options?: {
|
|
254
|
+
/** Default: the `caption` parameter.
|
|
255
|
+
* In 2.15.9-2.16.1 the default was a randomly generated string. */
|
|
256
|
+
id?: string
|
|
257
|
+
/** A hint shown in the status bar when hovering the command. */
|
|
258
|
+
title?: string
|
|
259
|
+
/** Default: `true`.
|
|
260
|
+
* Whether to auto-close the popup after the user invoked the command. */
|
|
261
|
+
autoClose?: boolean
|
|
262
|
+
}
|
|
224
263
|
): string
|
|
225
264
|
/** Unregisters a command which has been registered to Violentmonkey popup menu. */
|
|
226
265
|
declare function GM_unregisterMenuCommand(
|
|
@@ -244,6 +283,30 @@ declare interface VMScriptGMNotificationOptions {
|
|
|
244
283
|
title?: string
|
|
245
284
|
/** URL of an image to show in the notification. */
|
|
246
285
|
image?: string
|
|
286
|
+
/** No sounds/vibrations when showing the notification.
|
|
287
|
+
* @since VM2.15.2, Chrome 70. */
|
|
288
|
+
silent?: boolean
|
|
289
|
+
/**
|
|
290
|
+
* Unique name of the notification, e.g. 'abc', same as the web Notification API.
|
|
291
|
+
* Names are scoped to each userscript i.e. your tag won't clash with another script's tag.
|
|
292
|
+
* The purpose of a tagged notification is to replace an older notification with the same tag,
|
|
293
|
+
* even if it was shown in another tab (or before this tab was navigated elsewhere
|
|
294
|
+
* and your notification had `zombieTimeout`).
|
|
295
|
+
* @since VM2.15.4
|
|
296
|
+
*/
|
|
297
|
+
tag?: string
|
|
298
|
+
/**
|
|
299
|
+
* Number of milliseconds to keep the notification after the userscript "dies",
|
|
300
|
+
* i.e. when its tab or frame is reloaded/closed/navigated. If not specified or invalid,
|
|
301
|
+
* the default behavior is to immediately remove the notifications.
|
|
302
|
+
* @since VM2.15.4
|
|
303
|
+
*/
|
|
304
|
+
zombieTimeout?: number
|
|
305
|
+
/**
|
|
306
|
+
* URL to open when a zombie notification is clicked, see `zombieTimeout` for more info.
|
|
307
|
+
* @since VM2.16.1
|
|
308
|
+
*/
|
|
309
|
+
zombieUrl?: string
|
|
247
310
|
/** Callback when the notification is clicked by user. */
|
|
248
311
|
onclick?: () => void
|
|
249
312
|
/** Callback when the notification is closed, either by user or by system. */
|
|
@@ -408,10 +471,20 @@ declare interface VMScriptGMObjectVMExtensions {
|
|
|
408
471
|
addElement: typeof GM_addElement
|
|
409
472
|
addStyle: typeof GM_addStyle
|
|
410
473
|
addValueChangeListener: typeof GM_addValueChangeListener
|
|
411
|
-
|
|
474
|
+
/** @since VM2.19.1 */
|
|
475
|
+
deleteValues: (names: string[]) => Promise<void>
|
|
476
|
+
download:
|
|
477
|
+
| ((options: VMScriptGMDownloadOptions) => Promise<Blob> | void)
|
|
478
|
+
| ((url: string, name: string) => Promise<Blob> | void)
|
|
412
479
|
getResourceText: typeof GM_getResourceText
|
|
480
|
+
/** @since VM2.19.1 */
|
|
481
|
+
getValues:
|
|
482
|
+
| ((names: string[]) => Promise<GenericObject>)
|
|
483
|
+
| ((namesWithDefaults: GenericObject) => Promise<GenericObject>)
|
|
413
484
|
log: typeof GM_log
|
|
414
485
|
removeValueChangeListener: typeof GM_removeValueChangeListener
|
|
486
|
+
/** @since VM2.19.1 */
|
|
487
|
+
setValues: (values: GenericObject) => Promise<void>
|
|
415
488
|
unregisterMenuCommand: typeof GM_unregisterMenuCommand
|
|
416
489
|
}
|
|
417
490
|
|
|
@@ -428,7 +501,9 @@ declare interface VMScriptGMObject extends VMScriptGMObjectVMExtensions {
|
|
|
428
501
|
notification: typeof GM_notification
|
|
429
502
|
openInTab: typeof GM_openInTab
|
|
430
503
|
setClipboard: typeof GM_setClipboard
|
|
431
|
-
xmlHttpRequest:
|
|
504
|
+
xmlHttpRequest: <T = string | Blob | ArrayBuffer | Document | object>(
|
|
505
|
+
details: VMScriptGMXHRDetails<T>
|
|
506
|
+
) => Promise<T> & VMScriptXHRControl
|
|
432
507
|
}
|
|
433
508
|
|
|
434
509
|
declare const GM: VMScriptGMObject
|
package/dist/index.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var te=Object.create;var b=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(e,t)=>{for(var r in t)b(e,r,{get:t[r],enumerable:!0})},_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ne(t))!oe.call(e,s)&&s!==r&&b(e,s,{get:()=>t[s],enumerable:!(n=re(t,s))||n.enumerable});return e};var v=(e,t,r)=>(r=e!=null?te(se(e)):{},_(t||!e||!e.__esModule?b(r,"default",{value:e,enumerable:!0}):r,e)),ae=e=>_(b({},"__esModule",{value:!0}),e);var me={};ie(me,{default:()=>B});module.exports=ae(me);var c=require("fs"),N=require("http"),p=require("path"),V=v(require("get-port"),1),H=v(require("open"),1),S=v(require("picocolors"),1),W=v(require("serve-handler"),1),q=require("vite"),z=require("websocket");var f=class{constructor(t){this.config=t;this.addHomepageMeta(),this.maxKeyLength=Math.max(...Object.keys(this.config).map(r=>r.length))+1}header=[];maxKeyLength;addHomepageMeta(){let t=this.config.homepage??this.config.homepageURL;t&&(this.config.updateURL=new URL(`${this.config.name}.meta.js`,t).href,this.config.downloadURL=new URL(`${this.config.name}.user.js`,t).href)}addSpaces(t){return" ".repeat(this.maxKeyLength-t.length)}addMetadata(t,r){r=Array.isArray(r)?r.join(" "):r===!0?"":r,this.header.push(`// @${t}${this.addSpaces(t)}${r}`)}generate(){for(let[t,r]of Object.entries(this.config))if(Array.isArray(r))r.forEach(n=>this.addMetadata(t,n));else{if(r===void 0)continue;this.addMetadata(t,r)}return["// ==UserScript==",...this.header,"// ==/UserScript=="].join(`
|
|
2
|
-
`)}};var O=require("path"),E=require("url"),pe={},L=(0,O.dirname)((0,E.fileURLToPath)(pe.url)),j="vite-userscript-plugin",R='console.warn("__STYLE__")',D=new RegExp(/\.(t|j)sx?$/),C=new RegExp(/\.(s[ac]|c|le)ss$/),le=["setValue","getValue","deleteValue","listValues","setClipboard","addStyle","addElement","addValueChangeListener","removeValueChangeListener","registerMenuCommand","unregisterMenuCommand","download","getTab","getTabs","saveTab","openInTab","notification","getResourceURL","getResourceText","xmlhttpRequest","log","info"],ce=["unsafeWindow","window.onurlchange","window.focus","window.close"],g=le.map(e=>[`GM_${e}`,`GM.${e}`]).flat();g.push(...ce);var k=require("vite");function U(e){return[...new Set(Array.isArray(e)?e:e?[e]:[])]}async function h({minify:e,file:t,name:r,loader:n}){let{code:s}=await(0,k.transformWithEsbuild)(t,r,{minify:e,loader:n,sourcemap:!1,legalComments:"none"});return s}function A(e){let t=[];for(let r of g)e.indexOf(r)!==-1&&t.push(r);return t}var G=class{styles=new Map;async add(t,r,n){let s=await h({name:t,file:r,minify:n,loader:"css"});return this.styles.set(t,s.replace(`
|
|
3
|
-
`,"")),""}inject(){return this.styles.size?`GM_addStyle(\`${[...this.styles.values()].join("")}\`)`:void 0}merge(t){let r=[];for(let n of t){let s=this.styles.get(n);s&&r.push([n,s])}this.styles.clear(),r.forEach(n=>this.styles.set(...n))}},$=new G;function B(e){try{let t,r,n=null,s=(0,q.createLogger)("info",{prefix:`[${j}]`,allowClearScreen:!0}),y=(0,N.createServer)((o,i)=>(0,W.default)(o,i,{public:t.build.outDir})),K=z.server;return new K({httpServer:y}).on("request",o=>{n=o.accept(null,o.origin)}),{name:j,apply:"build",config(){return{build:{target:"esnext",minify:!1,lib:{entry:e.entry,name:e.header.name,formats:["iife"],fileName:()=>`${e.header.name}.js`},rollupOptions:{output:{extend:!0}}}}},async configResolved(o){t=o,r=o.build.watch??!1,e.entry=(0,p.resolve)(o.root,e.entry),Array.from(["match","require","include","exclude","resource","connect"]).forEach(i=>{let a=e.header[i];e.header[i]=U(a)}),e.server={port:await(0,V.default)(),open:!1,...e.server}},async transform(o,i){let a=o;return C.test(i)&&(a=await $.add(i,a,!r)),i.includes(e.entry)&&(a=o+R),{code:a,map:null}},generateBundle(o,i){for(let a of Object.values(i)){if(a.type==="asset")continue;let m=Object.keys(a.modules).filter(u=>C.test(u));m.length&&$.merge(m)}},async writeBundle(o,i){let{open:a,port:m}=e.server,u=o.sanitizeFileName(e.header.name),I=`${u}.user.js`,F=`${u}.proxy.user.js`,J=`${u}.meta.js`;for(let[d]of Object.entries(i))if(D.test(d)){let w=t.root,x=t.build.outDir,M=(0,p.resolve)(w,x,d),Y=(0,p.resolve)(w,x,I),Q=(0,p.resolve)(w,x,F),X=(0,p.resolve)(w,x,J),P=(0,p.resolve)(L,`ws-${u}.js`);try{let l=(0,c.readFileSync)(M,"utf8");if(l=l.replace(R,`${$.inject()}`),l=await h({minify:!r,file:l,name:d,loader:"js"}),e.header.grant=U(r?g:[...A(l),...e.header.grant??[]]),r){let Z=(0,c.readFileSync)((0,p.resolve)(L,"ws.js"),"utf8"),ee=await h({minify:!r,file:Z.replace("__WS__",`ws://localhost:${m}`),name:P,loader:"js"});(0,c.writeFileSync)(P,ee),(0,c.writeFileSync)(Q,new f({...e.header,require:[...e.header.require??[],"file://"+P,"file://"+M]}).generate())}let T=new f(e.header).generate();(0,c.writeFileSync)(M,l),(0,c.writeFileSync)(X,T),(0,c.writeFileSync)(Y,`${T}
|
|
4
|
-
|
|
5
|
-
${l}`)}catch(l){console.log(l)}}if(r&&!y.listening){let d=`http://localhost:${m}`;y.listen(m,()=>{s.clearScreen("info"),s.info(S.default.bold(`${S.default.cyan(">>> [vite-userscript-plugin]")} ${S.default.gray(d)}`))}),a&&await(0,H.default)(`${d}/${F}`)}else r||(y.close(),process.exit(0))},buildEnd(){r&&(s.clearScreen("info"),n&&n.sendUTF(JSON.stringify({message:"reload"})))}}}catch(t){return console.error(t),{name:j}}}
|
package/dist/index.d.cts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { PluginOption } from 'vite';
|
|
2
|
-
|
|
3
|
-
declare const GM: readonly ["setValue", "getValue", "deleteValue", "listValues", "setClipboard", "addStyle", "addElement", "addValueChangeListener", "removeValueChangeListener", "registerMenuCommand", "unregisterMenuCommand", "download", "getTab", "getTabs", "saveTab", "openInTab", "notification", "getResourceURL", "getResourceText", "xmlhttpRequest", "log", "info"];
|
|
4
|
-
declare const GMwindow: readonly ["unsafeWindow", "window.onurlchange", "window.focus", "window.close"];
|
|
5
|
-
|
|
6
|
-
type RunAt = 'document-start' | 'document-body' | 'document-end' | 'document-idle' | 'context-menu';
|
|
7
|
-
type GMLiterals<T extends string> = [`GM_${T}` | `GM.${T}`];
|
|
8
|
-
type GMWindow = typeof GMwindow[number];
|
|
9
|
-
type Grants = GMWindow | GMLiterals<typeof GM[number]>[number];
|
|
10
|
-
type HeaderConfig = {
|
|
11
|
-
[property: string]: any;
|
|
12
|
-
/**
|
|
13
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:name
|
|
14
|
-
*/
|
|
15
|
-
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:namespace
|
|
18
|
-
*/
|
|
19
|
-
namespace?: string;
|
|
20
|
-
/**
|
|
21
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:copyright
|
|
22
|
-
*/
|
|
23
|
-
copyright?: string;
|
|
24
|
-
/**
|
|
25
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:version
|
|
26
|
-
*/
|
|
27
|
-
version: string;
|
|
28
|
-
/**
|
|
29
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:description
|
|
30
|
-
*/
|
|
31
|
-
description?: string;
|
|
32
|
-
/**
|
|
33
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:icon
|
|
34
|
-
*/
|
|
35
|
-
icon?: string;
|
|
36
|
-
/**
|
|
37
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:icon
|
|
38
|
-
*/
|
|
39
|
-
iconURL?: string;
|
|
40
|
-
/**
|
|
41
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:icon
|
|
42
|
-
*/
|
|
43
|
-
defaulticon?: string;
|
|
44
|
-
/**
|
|
45
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:icon64
|
|
46
|
-
*/
|
|
47
|
-
icon64?: string;
|
|
48
|
-
/**
|
|
49
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:icon64
|
|
50
|
-
*/
|
|
51
|
-
icon64URL?: string;
|
|
52
|
-
/**
|
|
53
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:grant
|
|
54
|
-
*/
|
|
55
|
-
grant?: Grants[];
|
|
56
|
-
/**
|
|
57
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:author
|
|
58
|
-
*/
|
|
59
|
-
author?: string;
|
|
60
|
-
/**
|
|
61
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:homepage
|
|
62
|
-
*/
|
|
63
|
-
homepage?: string;
|
|
64
|
-
/**
|
|
65
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:homepage
|
|
66
|
-
*/
|
|
67
|
-
homepageURL?: string;
|
|
68
|
-
/**
|
|
69
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:homepage
|
|
70
|
-
*/
|
|
71
|
-
website?: string;
|
|
72
|
-
/**
|
|
73
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:homepage
|
|
74
|
-
*/
|
|
75
|
-
source?: string;
|
|
76
|
-
/**
|
|
77
|
-
* @see https://www.tampermonkey.net/documentation.phpmeta:antifeature
|
|
78
|
-
*/
|
|
79
|
-
antifeature?: [type: string, description: string][];
|
|
80
|
-
/**
|
|
81
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:require
|
|
82
|
-
*/
|
|
83
|
-
require?: string[] | string;
|
|
84
|
-
/**
|
|
85
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:resource
|
|
86
|
-
*/
|
|
87
|
-
resource?: [key: string, value: string][];
|
|
88
|
-
/**
|
|
89
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:include
|
|
90
|
-
*/
|
|
91
|
-
include?: string[] | string;
|
|
92
|
-
/**
|
|
93
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:match
|
|
94
|
-
* @see https://violentmonkey.github.io/api/metadata-block/#match--exclude-match
|
|
95
|
-
*/
|
|
96
|
-
match: string[] | string;
|
|
97
|
-
/**
|
|
98
|
-
* @see https://violentmonkey.github.io/api/metadata-block/#match--exclude-match
|
|
99
|
-
*/
|
|
100
|
-
'exclude-match'?: string[] | string;
|
|
101
|
-
/**
|
|
102
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:exclude
|
|
103
|
-
*/
|
|
104
|
-
exclude?: string[] | string;
|
|
105
|
-
/**
|
|
106
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:run_at
|
|
107
|
-
*/
|
|
108
|
-
'run-at'?: RunAt;
|
|
109
|
-
/**
|
|
110
|
-
* @see https://www.tampermonkey.net/documentation.phpmeta:sandbox
|
|
111
|
-
*/
|
|
112
|
-
sandbox?: string;
|
|
113
|
-
/**
|
|
114
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:connect
|
|
115
|
-
*/
|
|
116
|
-
connect?: string[] | string;
|
|
117
|
-
/**
|
|
118
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:noframes
|
|
119
|
-
*/
|
|
120
|
-
noframes?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:updateURL
|
|
123
|
-
*/
|
|
124
|
-
updateURL?: string;
|
|
125
|
-
/**
|
|
126
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:downloadURL
|
|
127
|
-
*/
|
|
128
|
-
downloadURL?: string;
|
|
129
|
-
/**
|
|
130
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:supportURL
|
|
131
|
-
*/
|
|
132
|
-
supportURL?: string;
|
|
133
|
-
/**
|
|
134
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:webRequest
|
|
135
|
-
*/
|
|
136
|
-
webRequest?: string[];
|
|
137
|
-
/**
|
|
138
|
-
* @see https://www.tampermonkey.net/documentation.php#meta:unwrap
|
|
139
|
-
*/
|
|
140
|
-
unwrap?: boolean;
|
|
141
|
-
};
|
|
142
|
-
interface ServerConfig {
|
|
143
|
-
/**
|
|
144
|
-
* {@link https://github.com/sindresorhus/get-port}
|
|
145
|
-
*/
|
|
146
|
-
port?: number;
|
|
147
|
-
/**
|
|
148
|
-
* @default false
|
|
149
|
-
*/
|
|
150
|
-
open?: boolean;
|
|
151
|
-
}
|
|
152
|
-
interface UserscriptPluginConfig {
|
|
153
|
-
/**
|
|
154
|
-
* Path of userscript entry.
|
|
155
|
-
*/
|
|
156
|
-
entry: string;
|
|
157
|
-
/**
|
|
158
|
-
* Userscript header config.
|
|
159
|
-
*
|
|
160
|
-
* @see https://www.tampermonkey.net/documentation.php
|
|
161
|
-
*/
|
|
162
|
-
header: HeaderConfig;
|
|
163
|
-
/**
|
|
164
|
-
* Server config.
|
|
165
|
-
*/
|
|
166
|
-
server?: ServerConfig;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
declare function UserscriptPlugin(config: UserscriptPluginConfig): PluginOption;
|
|
170
|
-
|
|
171
|
-
export { UserscriptPluginConfig, UserscriptPlugin as default };
|