mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
chore: Fix lint issues
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
if (window.Notification.permission !== "default") {
|
if (window.Notification.permission !== "default") {
|
||||||
return Promise.resolve(window.Notification.permission === "granted");
|
return Promise.resolve(window.Notification.permission === "granted");
|
||||||
}
|
}
|
||||||
return __TAURI__.invoke("plugin:notification|is_permission_granted");
|
return window.__TAURI__.invoke("plugin:notification|is_permission_granted");
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNotificationPermission(value) {
|
function setNotificationPermission(value) {
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requestPermission() {
|
function requestPermission() {
|
||||||
return __TAURI__
|
return window.__TAURI__
|
||||||
.invoke("plugin:notification|request_permission")
|
.invoke("plugin:notification|request_permission")
|
||||||
.then(function (permission) {
|
.then(function (permission) {
|
||||||
setNotificationPermission(permission);
|
setNotificationPermission(permission);
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
Object.freeze(options);
|
Object.freeze(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __TAURI__.invoke("plugin:notification|notify", {
|
return window.__TAURI__.invoke("plugin:notification|notify", {
|
||||||
options:
|
options:
|
||||||
typeof options === "string"
|
typeof options === "string"
|
||||||
? {
|
? {
|
||||||
|
|||||||
@@ -143,9 +143,10 @@ async function execute<O extends IOPayload>(
|
|||||||
/**
|
/**
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
class EventEmitter<E extends Record<string, any>> {
|
class EventEmitter<E extends Record<string, any>> {
|
||||||
/** @ignore */
|
/** @ignore */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
||||||
private eventListeners: Record<keyof E, Array<(arg: any) => void>> =
|
private eventListeners: Record<keyof E, Array<(arg: any) => void>> =
|
||||||
Object.create(null);
|
Object.create(null);
|
||||||
|
|
||||||
@@ -320,6 +321,7 @@ class EventEmitter<E extends Record<string, any>> {
|
|||||||
eventName: N,
|
eventName: N,
|
||||||
listener: (arg: E[typeof eventName]) => void
|
listener: (arg: E[typeof eventName]) => void
|
||||||
): this {
|
): this {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const wrapper = (arg: any): void => {
|
const wrapper = (arg: any): void => {
|
||||||
this.removeListener(eventName, wrapper);
|
this.removeListener(eventName, wrapper);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
|
|||||||
Reference in New Issue
Block a user