import { convertSb2Md } from "./convert.ts"; import { ask } from "./ask.ts"; import { Scrapbox } from "../scrapbox-jp%2Ftypes/userscript.ts"; declare const scrapbox: Scrapbox; scrapbox.PopupMenu.addButton({ title: "Ask GPT", onClick: (text) => { // @ts-ignore 型定義略 if (!globalThis.GM_fetch) { alert('Please install "GM_fetch" from https://scrapbox.io/api/code/takker/GM_fetch/scrapbox.user.js'); return undefined; } const question = convertSb2Md(text); if (!question) return undefined; ask(question); return undefined; }, });