diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-01-20 23:13:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 04:13:17 +0000 |
commit | 6ba1ffe74558dd174e3308d48885fb068fa37d55 (patch) | |
tree | 5519bbf972096e0e3370171d2b62a26d6164d671 /types/ext | |
parent | ebdde1ee612a262256ad0384131e53bc29b1e10f (diff) |
WebExtension class (#551)
* Add WebExtension class
* Use WebExtension class
* Use WebExtension instance for all runtime message sending
* Use getUrl
* Add a sendMessage variant which ignores the response and error
Diffstat (limited to 'types/ext')
-rw-r--r-- | types/ext/extension.d.ts | 32 | ||||
-rw-r--r-- | types/ext/web-extension.d.ts | 20 |
2 files changed, 20 insertions, 32 deletions
diff --git a/types/ext/extension.d.ts b/types/ext/extension.d.ts index d738936e..dc4657f0 100644 --- a/types/ext/extension.d.ts +++ b/types/ext/extension.d.ts @@ -15,38 +15,6 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import type * as Core from './core'; - -export type ChromeRuntimeSendMessageArgs1 = [ - message: Core.SafeAny, -]; - -export type ChromeRuntimeSendMessageArgs2 = [ - message: Core.SafeAny, - responseCallback: (response: Core.SafeAny) => void, -]; - -export type ChromeRuntimeSendMessageArgs3 = [ - message: Core.SafeAny, - options: chrome.runtime.MessageOptions, - responseCallback: (response: Core.SafeAny) => void, -]; - -export type ChromeRuntimeSendMessageArgs4 = [ - extensionId: string | undefined | null, - message: Core.SafeAny, - responseCallback: (response: Core.SafeAny) => void, -]; - -export type ChromeRuntimeSendMessageArgs5 = [ - extensionId: string | undefined | null, - message: Core.SafeAny, - options: chrome.runtime.MessageOptions, - responseCallback: (response: Core.SafeAny) => void, -]; - -export type ChromeRuntimeSendMessageArgs = ChromeRuntimeSendMessageArgs1 | ChromeRuntimeSendMessageArgs2 | ChromeRuntimeSendMessageArgs3 | ChromeRuntimeSendMessageArgs4 | ChromeRuntimeSendMessageArgs5; - export type HtmlElementWithContentWindow = HTMLIFrameElement | HTMLFrameElement | HTMLObjectElement; export type ContentOrigin = { diff --git a/types/ext/web-extension.d.ts b/types/ext/web-extension.d.ts new file mode 100644 index 00000000..287e7a72 --- /dev/null +++ b/types/ext/web-extension.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2024 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +export type Events = { + unloaded: Record<string, never>; +}; |