This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from agiledigital/ts-conversion
Convert to TypeScript
- Loading branch information
Showing
27 changed files
with
2,404 additions
and
3,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export const messages = Object.freeze({ | ||
export const messages: Readonly<Record<string, string>> = { | ||
ToggleDiff: "ToggleDiff", | ||
Reset: "Reset", | ||
Supported: "Supported", | ||
BitbucketDataScraped: "BitbucketDataScraped" | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { browser } from "webextension-polyfill-ts"; | ||
import { messages } from "./constants"; | ||
import { Message } from "./types/messenging"; | ||
|
||
const sendMessageRobust = async (currentTabId: number, message: Message) => | ||
browser.tabs.sendMessage(currentTabId, message).catch((error: unknown) => { | ||
console.warn(`Could not send message: [${error}]. Ignoring...`); | ||
}); | ||
|
||
export const setTabSupportsMulePreview = async (supported: boolean) => { | ||
await browser.runtime.sendMessage({ | ||
type: messages.Supported, | ||
value: supported | ||
}); | ||
}; | ||
|
||
export const resetTab = async (tabId: number) => | ||
sendMessageRobust(tabId, { | ||
type: messages.Reset | ||
}); | ||
|
||
export const toggleDiffOnTab = async (tabId: number) => | ||
sendMessageRobust(tabId, { | ||
type: messages.ToggleDiff | ||
}); |
Oops, something went wrong.