chore(deps): update to types v4 and toolkit v5

This commit is contained in:
windingwind 2025-03-29 13:04:08 +01:00
parent 585cf93055
commit 8a90c3b095
7 changed files with 79 additions and 90 deletions

3
.gitignore vendored
View File

@ -6,6 +6,9 @@ node_modules
pnpm-lock.yaml pnpm-lock.yaml
yarn.lock yarn.lock
# TSC
tsconfig.tsbuildinfo
# Scaffold # Scaffold
.env .env
.scaffold .scaffold

124
package-lock.json generated
View File

@ -9,7 +9,7 @@
"version": "3.0.4", "version": "3.0.4",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"zotero-plugin-toolkit": "^4.1.2" "zotero-plugin-toolkit": "^5.0.0-0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.23.0", "@eslint/js": "^9.23.0",
@ -19,7 +19,7 @@
"typescript": "^5.8.2", "typescript": "^5.8.2",
"typescript-eslint": "^8.28.0", "typescript-eslint": "^8.28.0",
"zotero-plugin-scaffold": "^0.4.1", "zotero-plugin-scaffold": "^0.4.1",
"zotero-types": "^3.1.9" "zotero-types": "^4.0.0-beta.3"
} }
}, },
"node_modules/@esbuild/aix-ppc64": { "node_modules/@esbuild/aix-ppc64": {
@ -652,9 +652,9 @@
} }
}, },
"node_modules/@napi-rs/canvas": { "node_modules/@napi-rs/canvas": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.68.tgz",
"integrity": "sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ==", "integrity": "sha512-LQESrePLEBLvhuFkXx9jjBXRC2ClYsO5mqQ1m/puth5z9SOuM3N/B3vDuqnC3RJFktDktyK9khGvo7dTkqO9uQ==",
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"peer": true, "peer": true,
@ -662,22 +662,22 @@
"node": ">= 10" "node": ">= 10"
}, },
"optionalDependencies": { "optionalDependencies": {
"@napi-rs/canvas-android-arm64": "0.1.65", "@napi-rs/canvas-android-arm64": "0.1.68",
"@napi-rs/canvas-darwin-arm64": "0.1.65", "@napi-rs/canvas-darwin-arm64": "0.1.68",
"@napi-rs/canvas-darwin-x64": "0.1.65", "@napi-rs/canvas-darwin-x64": "0.1.68",
"@napi-rs/canvas-linux-arm-gnueabihf": "0.1.65", "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.68",
"@napi-rs/canvas-linux-arm64-gnu": "0.1.65", "@napi-rs/canvas-linux-arm64-gnu": "0.1.68",
"@napi-rs/canvas-linux-arm64-musl": "0.1.65", "@napi-rs/canvas-linux-arm64-musl": "0.1.68",
"@napi-rs/canvas-linux-riscv64-gnu": "0.1.65", "@napi-rs/canvas-linux-riscv64-gnu": "0.1.68",
"@napi-rs/canvas-linux-x64-gnu": "0.1.65", "@napi-rs/canvas-linux-x64-gnu": "0.1.68",
"@napi-rs/canvas-linux-x64-musl": "0.1.65", "@napi-rs/canvas-linux-x64-musl": "0.1.68",
"@napi-rs/canvas-win32-x64-msvc": "0.1.65" "@napi-rs/canvas-win32-x64-msvc": "0.1.68"
} }
}, },
"node_modules/@napi-rs/canvas-android-arm64": { "node_modules/@napi-rs/canvas-android-arm64": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.68.tgz",
"integrity": "sha512-ZYwqFYEKcT5Zr8lbiaJNJj/poLaeK2TncolY914r+gD2TJNeP7ZqvE7A2SX/1C9MB4E3DQEwm3YhL3WEf0x3MQ==", "integrity": "sha512-h1KcSR4LKLfRfzeBH65xMxbWOGa1OtMFQbCMVlxPCkN1Zr+2gK+70pXO5ktojIYcUrP6KDcOwoc8clho5ccM/w==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -692,9 +692,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-darwin-arm64": { "node_modules/@napi-rs/canvas-darwin-arm64": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.68.tgz",
"integrity": "sha512-Pg1pfiJEyDIsX+V0QaJPRWvXbw5zmWAk3bivFCvt/5pwZb37/sT6E/RqPHT9NnqpDyKW6SriwY9ypjljysUA1Q==", "integrity": "sha512-/VURlrAD4gDoxW1GT/b0nP3fRz/fhxmHI/xznTq2FTwkQLPOlLkDLCvTmQ7v6LtGKdc2Ed6rvYpRan+JXThInQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -709,9 +709,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-darwin-x64": { "node_modules/@napi-rs/canvas-darwin-x64": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.68.tgz",
"integrity": "sha512-3Tr+/HjdJN7Z/VKIcsxV2DvDIibZCExgfYTgljCkUSFuoI7iNkOE6Dc1Q6j212EB9PeO8KmfrViBqHYT6IwWkA==", "integrity": "sha512-tEpvGR6vCLTo1Tx9wmDnoOKROpw57wiCWwCpDOuVlj/7rqEJOUYr9ixW4aRJgmeGBrZHgevI0EURys2ER6whmg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -726,9 +726,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.68.tgz",
"integrity": "sha512-3KP+dYObH7CVkZMZWwk1WX9jRjL+EKdQtD43H8MOI+illf+dwqLlecdQ4d9bQRIxELKJ8dyPWY4fOp/Ngufrdg==", "integrity": "sha512-U9xbJsumPOiAYeAFZMlHf62b9dGs2HJ6Q5xt7xTB0uEyPeurwhgYBWGgabdsEidyj38YuzI/c3LGBbSQB3vagw==",
"cpu": [ "cpu": [
"arm" "arm"
], ],
@ -743,9 +743,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-arm64-gnu": { "node_modules/@napi-rs/canvas-linux-arm64-gnu": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.68.tgz",
"integrity": "sha512-Ka3StKz7Dq7kjTF3nNJCq43UN/VlANS7qGE3dWkn1d+tQNsCRy/wRmyt1TUFzIjRqcTFMQNRbgYq84+53UBA0A==", "integrity": "sha512-KFkn8wEm3mPnWD4l8+OUUkxylSJuN5q9PnJRZJgv15RtCA1bgxIwTkBhI/+xuyVMcHqON9sXq7cDkEJtHm35dg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -760,9 +760,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-arm64-musl": { "node_modules/@napi-rs/canvas-linux-arm64-musl": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.68.tgz",
"integrity": "sha512-O4xMASm2JrmqYoiDyxVWi+z5C14H+oVEag2rZ5iIA67dhWqYZB+iO7wCFpBYRj31JPBR29FOsu6X9zL+DwBFdw==", "integrity": "sha512-IQzts91rCdOALXBWQxLZRCEDrfFTGDtNRJMNu+2SKZ1uT8cmPQkPwVk5rycvFpvgAcmiFiOSCp1aRrlfU8KPpQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -777,9 +777,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-riscv64-gnu": { "node_modules/@napi-rs/canvas-linux-riscv64-gnu": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.68.tgz",
"integrity": "sha512-dblWDaA59ZU8bPbkfM+riSke7sFbNZ70LEevUdI5rgiFEUzYUQlU34gSBzemTACj5rCWt1BYeu0GfkLSjNMBSw==", "integrity": "sha512-e9AS5UttoIKqXSmBzKZdd3NErSVyOEYzJfNOCGtafGk1//gibTwQXGlSXmAKuErqMp09pyk9aqQRSYzm1AQfBw==",
"cpu": [ "cpu": [
"riscv64" "riscv64"
], ],
@ -794,9 +794,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-x64-gnu": { "node_modules/@napi-rs/canvas-linux-x64-gnu": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.68.tgz",
"integrity": "sha512-wsp+atutw13OJXGU3DDkdngtBDoEg01IuK5xMe0L6VFPV8maGkh17CXze078OD5QJOc6kFyw3DDscMLOPF8+oA==", "integrity": "sha512-Pa/I36VE3j57I3Obhrr+J48KGFfkZk2cJN/2NmW/vCgmoF7kCP6aTVq5n+cGdGWLd/cN9CJ9JvNwEoMRDghu0g==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -811,9 +811,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-linux-x64-musl": { "node_modules/@napi-rs/canvas-linux-x64-musl": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.68.tgz",
"integrity": "sha512-odX+nN+IozWzhdj31INcHz3Iy9+EckNw+VqsZcaUxZOTu7/3FmktRNI6aC1qe5minZNv1m05YOS1FVf7fvmjlA==", "integrity": "sha512-9c6rkc5195wNxuUHJdf4/mmnq433OQey9TNvQ9LspJazvHbfSkTij8wtKjASVQsJyPDva4fkWOeV/OQ7cLw0GQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -828,9 +828,9 @@
} }
}, },
"node_modules/@napi-rs/canvas-win32-x64-msvc": { "node_modules/@napi-rs/canvas-win32-x64-msvc": {
"version": "0.1.65", "version": "0.1.68",
"resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.68.tgz",
"integrity": "sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg==", "integrity": "sha512-Fc5Dez23u0FoSATurT6/w1oMytiRnKWEinHivdMvXpge6nG4YvhrASrtqMk8dGJMVQpHr8QJYF45rOrx2YU2Aw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -1524,9 +1524,9 @@
} }
}, },
"node_modules/@types/react": { "node_modules/@types/react": {
"version": "19.0.2", "version": "19.0.12",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.12.tgz",
"integrity": "sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==", "integrity": "sha512-V6Ar115dBDrjbtXSrS+/Oruobc+qVbbUxDFC1RSbRqLt5SYvxxyIDrSC85RWml54g+jfNeEMZhEj7wW07ONQhA==",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -2058,9 +2058,9 @@
} }
}, },
"node_modules/core-js": { "node_modules/core-js": {
"version": "3.39.0", "version": "3.41.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.39.0.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.41.0.tgz",
"integrity": "sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==", "integrity": "sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
@ -3223,16 +3223,16 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/pdfjs-dist": { "node_modules/pdfjs-dist": {
"version": "4.10.38", "version": "5.0.375",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-5.0.375.tgz",
"integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", "integrity": "sha512-QDRlEVldf/cX88CElGAyRhjqNOO69kmB3HZlalDAfqJ/IvmqJNkipomhBZy4cWATfLVlkQTXE3H4yFvMF2uPsg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"peer": true, "peer": true,
"engines": { "engines": {
"node": ">=20" "node": ">=20"
}, },
"optionalDependencies": { "optionalDependencies": {
"@napi-rs/canvas": "^0.1.65" "@napi-rs/canvas": "^0.1.67"
} }
}, },
"node_modules/perfect-debounce": { "node_modules/perfect-debounce": {
@ -3828,21 +3828,21 @@
} }
}, },
"node_modules/zotero-plugin-toolkit": { "node_modules/zotero-plugin-toolkit": {
"version": "4.1.2", "version": "5.0.0-0",
"resolved": "https://registry.npmjs.org/zotero-plugin-toolkit/-/zotero-plugin-toolkit-4.1.2.tgz", "resolved": "https://registry.npmjs.org/zotero-plugin-toolkit/-/zotero-plugin-toolkit-5.0.0-0.tgz",
"integrity": "sha512-zM2NR6BLQKIAPa6Q0u6xdyIqjfwe9fz5lbJvg+fXN7B3m20ymC7wFyn1CJVzMCNCJitzr3K+obkyCvMYhiVDFQ==", "integrity": "sha512-CS6Myhxf3h0sHe8bfjxijeCTNn5xRIzcFWd36sm+xgehFmaKPp66BsbbqFvQ4Lggif9aifW5+UM8z1mtnqKGjw==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zotero-types": "^3.1.0" "zotero-types": "^4.0.0-beta.2"
} }
}, },
"node_modules/zotero-types": { "node_modules/zotero-types": {
"version": "3.1.9", "version": "4.0.0-beta.3",
"resolved": "https://registry.npmjs.org/zotero-types/-/zotero-types-3.1.9.tgz", "resolved": "https://registry.npmjs.org/zotero-types/-/zotero-types-4.0.0-beta.3.tgz",
"integrity": "sha512-Sdzv72yOYqOndf1TfFxw8h63Q4xFOycHm3PGBawvOzisZt23REg+kOgMVpHLST0d8nqhcObstC2dpxfGW81k4g==", "integrity": "sha512-ux0ZPRvflf1NdP+ilWzmQVoh7+9RujY9hZ4z4xDzRaP4j48ewcy16Z9QFhbgvt1TgWQpwMjKZYBbSZMDFjERow==",
"license": "MIT", "license": "MIT",
"peerDependencies": { "peerDependencies": {
"@types/bluebird": "*", "@types/bluebird": "*",

View File

@ -30,7 +30,7 @@
"update-deps": "npm update --save" "update-deps": "npm update --save"
}, },
"dependencies": { "dependencies": {
"zotero-plugin-toolkit": "^4.1.2" "zotero-plugin-toolkit": "^5.0.0-0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.23.0", "@eslint/js": "^9.23.0",
@ -40,7 +40,7 @@
"typescript": "^5.8.2", "typescript": "^5.8.2",
"typescript-eslint": "^8.28.0", "typescript-eslint": "^8.28.0",
"zotero-plugin-scaffold": "^0.4.1", "zotero-plugin-scaffold": "^0.4.1",
"zotero-types": "^3.1.9" "zotero-types": "^4.0.0-beta.3"
}, },
"prettier": { "prettier": {
"printWidth": 80, "printWidth": 80,

View File

@ -39,7 +39,7 @@ async function onStartup() {
); );
} }
async function onMainWindowLoad(win: Window): Promise<void> { async function onMainWindowLoad(win: _ZoteroTypes.MainWindow): Promise<void> {
// Create ztoolkit for every window // Create ztoolkit for every window
addon.data.ztoolkit = createZToolkit(); addon.data.ztoolkit = createZToolkit();

View File

@ -123,7 +123,7 @@ export class KeyExampleFactory {
export class UIExampleFactory { export class UIExampleFactory {
@example @example
static registerStyleSheet(win: Window) { static registerStyleSheet(win: _ZoteroTypes.MainWindow) {
const doc = win.document; const doc = win.document;
const styles = ztoolkit.UI.createElement(doc, "link", { const styles = ztoolkit.UI.createElement(doc, "link", {
properties: { properties: {
@ -132,7 +132,7 @@ export class UIExampleFactory {
href: `chrome://${addon.data.config.addonRef}/content/zoteroPane.css`, href: `chrome://${addon.data.config.addonRef}/content/zoteroPane.css`,
}, },
}); });
doc.documentElement.appendChild(styles); doc.documentElement?.appendChild(styles);
doc.getElementById("zotero-item-pane-content")?.classList.add("makeItRed"); doc.getElementById("zotero-item-pane-content")?.classList.add("makeItRed");
} }
@ -165,7 +165,7 @@ export class UIExampleFactory {
], ],
}, },
"before", "before",
win.document.querySelector( win.document?.querySelector(
"#zotero-itemmenu-addontemplate-test", "#zotero-itemmenu-addontemplate-test",
) as XUL.MenuItem, ) as XUL.MenuItem,
); );
@ -208,12 +208,9 @@ export class UIExampleFactory {
dataProvider: (item: Zotero.Item, dataKey: string) => { dataProvider: (item: Zotero.Item, dataKey: string) => {
return field + String(item.id); return field + String(item.id);
}, },
renderCell(index, data, column) { renderCell(index, data, column, isFirstColumn, doc) {
ztoolkit.log("Custom column cell is rendered!"); ztoolkit.log("Custom column cell is rendered!");
const span = Zotero.getMainWindow().document.createElementNS( const span = doc.createElement("span");
"http://www.w3.org/1999/xhtml",
"span",
);
span.className = `cell ${column.className}`; span.className = `cell ${column.className}`;
span.style.background = "#0dd068"; span.style.background = "#0dd068";
span.innerText = "⭐" + data; span.innerText = "⭐" + data;
@ -502,7 +499,7 @@ export class PromptExampleFactory {
ids.forEach((id: number) => { ids.forEach((id: number) => {
const item = Zotero.Items.get(id); const item = Zotero.Items.get(id);
const title = item.getField("title"); const title = item.getField("title");
const ele = ztoolkit.UI.createElement(window.document, "div", { const ele = ztoolkit.UI.createElement(window.document!, "div", {
namespace: "html", namespace: "html",
classList: ["command"], classList: ["command"],
listeners: [ listeners: [

View File

@ -108,10 +108,10 @@ async function updatePrefsUI() {
function bindPrefEvents() { function bindPrefEvents() {
addon.data addon.data
.prefs!.window.document.querySelector( .prefs!.window.document?.querySelector(
`#zotero-prefpane-${config.addonRef}-enable`, `#zotero-prefpane-${config.addonRef}-enable`,
) )
?.addEventListener("command", (e) => { ?.addEventListener("command", (e: Event) => {
ztoolkit.log(e); ztoolkit.log(e);
addon.data.prefs!.window.alert( addon.data.prefs!.window.alert(
`Successfully changed to ${(e.target as XUL.Checkbox).checked}!`, `Successfully changed to ${(e.target as XUL.Checkbox).checked}!`,
@ -119,10 +119,10 @@ function bindPrefEvents() {
}); });
addon.data addon.data
.prefs!.window.document.querySelector( .prefs!.window.document?.querySelector(
`#zotero-prefpane-${config.addonRef}-input`, `#zotero-prefpane-${config.addonRef}-input`,
) )
?.addEventListener("change", (e) => { ?.addEventListener("change", (e: Event) => {
ztoolkit.log(e); ztoolkit.log(e);
addon.data.prefs!.window.alert( addon.data.prefs!.window.alert(
`Successfully changed to ${(e.target as HTMLInputElement).value}!`, `Successfully changed to ${(e.target as HTMLInputElement).value}!`,

View File

@ -1,16 +1,5 @@
{ {
"compilerOptions": { "extends": "zotero-types/entries/sandbox/",
"target": "ES2016",
"lib": ["ESNext"],
"experimentalDecorators": true,
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"types": ["zotero-types"],
"strict": true,
"outDir": "build/dist/",
"skipLibCheck": true
},
"include": ["src", "typings"], "include": ["src", "typings"],
"exclude": ["build", "addon"] "exclude": ["build", "addon"]
} }