mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
web: migrate platform.js to typescript (#2163)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
This commit is contained in:
committed by
GitHub
parent
159b6f3ca6
commit
966bedbb49
1
apps/web/src/global.d.ts
vendored
1
apps/web/src/global.d.ts
vendored
@@ -32,6 +32,7 @@ type DesktopIntegrationSettings = {
|
||||
};
|
||||
|
||||
declare interface Window {
|
||||
os: typeof process.platform & "mas";
|
||||
config: {
|
||||
static spellChecker(): Promise<SpellCheckerOptions>;
|
||||
static desktopIntegration(): Promise<DesktopIntegrationSettings>;
|
||||
|
||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
export function getPlatform() {
|
||||
if (window.os) return window.os;
|
||||
|
||||
var userAgent = window.navigator.userAgent,
|
||||
const userAgent = window.navigator.userAgent,
|
||||
platform = window.navigator.platform,
|
||||
macosPlatforms = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"],
|
||||
windowsPlatforms = ["Win32", "Win64", "Windows", "WinCE"],
|
||||
@@ -42,7 +42,7 @@ export function getPlatform() {
|
||||
return os;
|
||||
}
|
||||
|
||||
export function getDownloadLink(platform) {
|
||||
export function getDownloadLink(platform: string) {
|
||||
const baseurl = `https://notesnook.com/releases/${platform.toLowerCase()}`;
|
||||
switch (platform) {
|
||||
case "iOS":
|
||||
Reference in New Issue
Block a user