UNPKG

mock-violentmonkey

Version:

Mock violentmonkey's globals for testing userscripts

37 lines (36 loc) 1.49 kB
import { type AddStyle } from './add-style.js'; import { type SetClipboard } from './clipboard.js'; import { type ScriptInfo } from './info.js'; import { type Notification } from './notification.js'; import { type OpenInTab } from './open-in-tab.js'; import { type GetResourceURL } from './resource.js'; import { type DeleteValue, type GetValue, type ListValues, type SetValue } from './storage.js'; import { type XmlHttpRequest } from './xmlhttprequest.js'; type MakeFunctionAsync<T extends (...arguments_: any[]) => void> = (...arguments_: Parameters<T>) => Promise<ReturnType<T>>; type GM_type = Readonly<{ setValue: MakeFunctionAsync<SetValue>; getValue: MakeFunctionAsync<GetValue>; listValues: MakeFunctionAsync<ListValues>; deleteValue: MakeFunctionAsync<DeleteValue>; addStyle: AddStyle; getResourceURL: MakeFunctionAsync<GetResourceURL>; notification: Notification; setClipboard: SetClipboard; openInTab: OpenInTab; xmlHttpRequest: XmlHttpRequest; info: ScriptInfo; }>; declare const GM: Readonly<{ setValue: MakeFunctionAsync<SetValue>; getValue: MakeFunctionAsync<GetValue>; listValues: MakeFunctionAsync<ListValues>; deleteValue: MakeFunctionAsync<DeleteValue>; addStyle: AddStyle; getResourceURL: MakeFunctionAsync<GetResourceURL>; notification: Notification; setClipboard: SetClipboard; openInTab: OpenInTab; xmlHttpRequest: XmlHttpRequest; info: ScriptInfo; }>; export { GM, type GM_type };