From 3e61fe7c3f2137ba3cc524d781ac8705047b39d8 Mon Sep 17 00:00:00 2001 From: Justin Bush <158503966+buzsh@users.noreply.github.com> Date: Sun, 2 Jun 2024 12:55:40 -0600 Subject: [PATCH] docs: add todo for WKScriptMessageHandlers --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index b674213..b97695e 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,33 @@ npm install -g swiftgen ### Additional Information For more details, refer to the [TypeSwift project on GitHub](https://github.com/TypeSwift/TypeSwift). + +## TODO + +### Generate WKScriptMessageHandlers + +```ts +declare global { + interface Window { + webkit: { + messageHandlers: { + copilotMessageProcessed: { + postMessage: (message: string) => void; + }; + copilotSidebarHidden: { + postMessage: (message: string) => void; + }; + copilotPopupHidden: { + postMessage: (message: string) => void; + }; + }; + }; + sendMessageToCopilot: (message: string) => void; + showCopilotSidebar: () => void; + hideCopilotSidebar: () => void; + showCopilotPopup: () => void; + hideCopilotPopup: () => void; + } +} +``` +