mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(types): fix errors in website
This commit is contained in:
parent
296c95e800
commit
6f5c66f324
@ -4,9 +4,9 @@ export type App = "desktop" | "server";
|
||||
|
||||
export type Architecture = 'x64' | 'arm64';
|
||||
|
||||
export type Platform = 'macos' | 'windows' | 'linux';
|
||||
export type Platform = "macos" | "windows" | "linux" | "pikapod";
|
||||
|
||||
let version = rootPackageJson.version;
|
||||
const version = rootPackageJson.version;
|
||||
|
||||
export interface DownloadInfo {
|
||||
recommended?: boolean;
|
||||
@ -20,7 +20,7 @@ export interface DownloadMatrixEntry {
|
||||
downloads: Record<string, DownloadInfo>;
|
||||
}
|
||||
|
||||
type DownloadMatrix = Record<App, Record<Platform, DownloadMatrixEntry>>;
|
||||
type DownloadMatrix = Record<App, { [ P in Platform ]?: DownloadMatrixEntry }>;
|
||||
|
||||
// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support.
|
||||
export const downloadMatrix: DownloadMatrix = {
|
||||
@ -131,7 +131,7 @@ export function buildDownloadUrl(app: App, platform: Platform, format: string, a
|
||||
if (app === "desktop") {
|
||||
return `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-v${version}-${platform}-${architecture}.${format}`;
|
||||
} else if (app === "server") {
|
||||
return downloadMatrix.server[platform].downloads[format].url ?? "#";
|
||||
return downloadMatrix.server[platform]?.downloads[format].url ?? "#";
|
||||
} else {
|
||||
return "#";
|
||||
}
|
||||
@ -149,7 +149,7 @@ export function getArchitecture(): Architecture {
|
||||
function getPlatform(): Platform {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) {
|
||||
return "mac";
|
||||
return "macos";
|
||||
} else if (userAgent.includes('windows') || userAgent.includes('win32')) {
|
||||
return "windows";
|
||||
} else {
|
||||
|
@ -9,7 +9,8 @@
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
"moduleResolution": "bundler",
|
||||
"composite": true
|
||||
}
|
||||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||
|
@ -59,6 +59,9 @@
|
||||
},
|
||||
{
|
||||
"path": "./packages/share-theme"
|
||||
},
|
||||
{
|
||||
"path": "./apps/website"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user