Files
wxt/src/client/defineBackgroundScript.ts
T
2023-06-25 10:53:35 -05:00

15 lines
453 B
TypeScript

import { BackgroundScriptDefintition } from '..';
export function defineBackgroundScript(
main: () => void,
): BackgroundScriptDefintition;
export function defineBackgroundScript(
definition: BackgroundScriptDefintition,
): BackgroundScriptDefintition;
export function defineBackgroundScript(
arg: (() => void) | BackgroundScriptDefintition,
): BackgroundScriptDefintition {
if (typeof arg === 'function') return { main: arg };
return arg;
}