// Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { registerPackage } from "./runtime-require"; declare global { interface Window { bridgeCommand(command: string, callback?: (value: T) => void): void; } } /// HTML tag pointing to a bridge command. export function bridgeLink(command: string, label: string): string { return `${label}`; } export function bridgeCommand(command: string, callback?: (value: T) => void): void { window.bridgeCommand(command, callback); } registerPackage("anki/bridgecommand", { bridgeCommand, });