mock-violentmonkey
Version:
Mock violentmonkey's globals for testing userscripts
20 lines (19 loc) • 598 B
TypeScript
type Tab = Readonly<{
url: string;
options: Required<OpenInTabOptions>;
close: () => void;
}>;
type OpenInTabOptions = {
active?: boolean | undefined;
container?: number | undefined;
insert?: boolean | undefined;
pinned?: boolean | undefined;
};
type OpenInTab = (url: string, options?: OpenInTabOptions | boolean) => {
onclose?: (() => void) | undefined | null;
closed: boolean;
close: () => void;
};
declare const openInTab: OpenInTab;
declare const getTabs: (url?: string | RegExp) => Tab[];
export { openInTab as GM_openInTab, getTabs, type OpenInTab };