browser-extension-utils 0.0.12 → 0.0.13
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/lib/index.d.ts +9 -2
- package/lib/userscript.js +5 -4
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -51,7 +51,8 @@ export function addStyle(styleText: string): HTMLElement
|
|
|
51
51
|
export function addEventListener(
|
|
52
52
|
element: HTMLElement | Document | EventTarget,
|
|
53
53
|
type: string,
|
|
54
|
-
listener:
|
|
54
|
+
listener: EventListenerOrEventListenerObject,
|
|
55
|
+
options?: boolean | AddEventListenerOptions
|
|
55
56
|
): () => void
|
|
56
57
|
|
|
57
58
|
export function addEventListener(
|
|
@@ -67,6 +68,12 @@ export function setAttribute(
|
|
|
67
68
|
value: string
|
|
68
69
|
): void
|
|
69
70
|
|
|
71
|
+
export type SetStyle = (
|
|
72
|
+
element: HTMLElement,
|
|
73
|
+
style: string | Record<string, unknown>,
|
|
74
|
+
overwrite?: boolean
|
|
75
|
+
) => void
|
|
76
|
+
|
|
70
77
|
export function setStyle(
|
|
71
78
|
element: HTMLElement,
|
|
72
79
|
style: string | Record<string, unknown>,
|
|
@@ -77,6 +84,6 @@ export function toStyleMap(styleText: string): Record<string, string>
|
|
|
77
84
|
|
|
78
85
|
export function noStyleSpace(text: string): string
|
|
79
86
|
|
|
80
|
-
export function createSetStyle(styleText: string):
|
|
87
|
+
export function createSetStyle(styleText: string): SetStyle
|
|
81
88
|
|
|
82
89
|
export function isUrl(text: string): boolean
|
package/lib/userscript.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./index.js"
|
|
2
|
-
/* eslint-disable camelcase */
|
|
2
|
+
/* eslint-disable camelcase, new-cap */
|
|
3
3
|
// eslint-disable-next-line no-unused-expressions, n/prefer-global/process
|
|
4
4
|
process.env.PLASMO_TAG === "dev" &&
|
|
5
5
|
(() => {
|
|
@@ -14,7 +14,8 @@ process.env.PLASMO_TAG === "dev" &&
|
|
|
14
14
|
}
|
|
15
15
|
})()
|
|
16
16
|
|
|
17
|
-
export const addElement =
|
|
17
|
+
export const addElement = (parentNode, tagName, attributes) =>
|
|
18
|
+
GM_addElement(parentNode, tagName, attributes)
|
|
18
19
|
|
|
19
|
-
export const addStyle = GM_addStyle
|
|
20
|
-
/* eslint-enable camelcase */
|
|
20
|
+
export const addStyle = (styleText) => GM_addStyle(styleText)
|
|
21
|
+
/* eslint-enable camelcase, new-cap */
|