mirror of
https://github.com/outline/outline.git
synced 2026-11-28 08:14:58 +03:00
* Run passkey login inside the desktop app when supported Desktop apps that configure a platform authenticator expose isPasskeySupported on the bridge. When available, the WebAuthn ceremony runs in the app instead of the system browser. If it fails, the user can still use a passkey from their browser. * Name passkeys registered in the desktop app The Chromium Touch ID authenticator reports the same AAGUID as any Chromium browser, so passkeys from the desktop app were named "Chromium Browser". * Allow more than one passkey from the Chromium authenticator The Chromium Touch ID authenticator reports the same AAGUID on every device, so users could not register the desktop app on a second Mac. * Disable adding passkeys in desktop apps without passkey support
187 lines
5.3 KiB
TypeScript
187 lines
5.3 KiB
TypeScript
/// <reference types="google.analytics" />
|
|
import type RootStore from "~/stores/RootStore";
|
|
|
|
declare global {
|
|
interface ImportMeta {
|
|
/**
|
|
* A special feature that allows you to get all matching modules starting from some base directory.
|
|
*/
|
|
glob: {
|
|
(
|
|
pattern: string | string[],
|
|
option: { eager: true }
|
|
): Record<string, unknown>;
|
|
(
|
|
pattern: string | string[],
|
|
option?: { eager?: false }
|
|
): Record<string, () => Promise<unknown>>;
|
|
};
|
|
}
|
|
|
|
interface Window {
|
|
dataLayer: any[];
|
|
gtag: (...args: any[]) => void;
|
|
|
|
stores: RootStore;
|
|
|
|
DesktopBridge?: {
|
|
/**
|
|
* The name of the platform running on.
|
|
*/
|
|
platform: string;
|
|
|
|
/**
|
|
* The version of the loaded application.
|
|
*/
|
|
version: () => string;
|
|
|
|
/**
|
|
* Restarts the application.
|
|
*/
|
|
restart: () => Promise<void>;
|
|
|
|
/**
|
|
* Restarts the application and installs the update.
|
|
*/
|
|
restartAndInstall: () => Promise<void>;
|
|
|
|
/**
|
|
* Tells the updater to check for updates now.
|
|
*/
|
|
checkForUpdates: () => Promise<void>;
|
|
|
|
/**
|
|
* Passes double click events from titlebar area
|
|
*/
|
|
onTitlebarDoubleClick: () => Promise<void>;
|
|
|
|
/**
|
|
* Passes log out events from the app to the main process
|
|
*/
|
|
onLogout: () => Promise<void>;
|
|
|
|
/**
|
|
* Adds a custom host to config
|
|
*/
|
|
addCustomHost: (host: string) => Promise<void>;
|
|
|
|
/**
|
|
* Loads the authentication configuration for the given host from the main
|
|
* process, bypassing renderer CORS restrictions. Used to verify a host is
|
|
* a reachable Outline installation before switching to it.
|
|
*/
|
|
loadAuthConfig: (host: string) => Promise<{ providers: unknown[] }>;
|
|
|
|
/**
|
|
* Returns true when passkeys can be created and used inside the app, rather
|
|
* than in the system browser. Not present in older desktop apps.
|
|
*/
|
|
isPasskeySupported?: () => Promise<boolean>;
|
|
|
|
/**
|
|
* Clears the desktop configuration, removing any custom hosts. Intended
|
|
* for debugging use.
|
|
*/
|
|
clearConfig: () => Promise<void>;
|
|
|
|
/**
|
|
* Set the language used by the spellchecker on Windows/Linux.
|
|
*/
|
|
setSpellCheckerLanguages: (languages: string[]) => Promise<void>;
|
|
|
|
/**
|
|
* Set the badge on the app icon.
|
|
*/
|
|
setNotificationCount: (count: number | string) => Promise<void>;
|
|
|
|
/**
|
|
* Registers a callback to be called when the window is focused.
|
|
*/
|
|
focus: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the window loses focus.
|
|
*/
|
|
blur: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when a route change is requested from the main process.
|
|
* This would usually be when it is responding to a deeplink.
|
|
*/
|
|
redirect: (callback: (path: string, replace: boolean) => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the application is ready to update.
|
|
*/
|
|
updateDownloaded: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the application wants to open keyboard shortcuts.
|
|
*/
|
|
openKeyboardShortcuts: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Go back in history, if possible
|
|
*/
|
|
goBack: () => void;
|
|
|
|
/**
|
|
* Go forward in history, if possible
|
|
*/
|
|
goForward: () => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the navigation state changes (e.g. after
|
|
* navigating to a new page). Receives whether back/forward navigation is possible.
|
|
*/
|
|
onNavigationStateChanged: (
|
|
callback: (state: { canGoBack: boolean; canGoForward: boolean }) => void
|
|
) => () => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the application wants to open the find in page dialog.
|
|
*/
|
|
onFindInPage: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when the application wants to open the replace in page dialog.
|
|
*/
|
|
onReplaceInPage: (callback: () => void) => void;
|
|
|
|
/**
|
|
* Registers a callback to be called when a file download completes. The
|
|
* callback receives the name and saved path of the file, which can be
|
|
* passed back to `openDownload` or `showDownloadInFolder`.
|
|
*/
|
|
onDownloadComplete: (
|
|
callback: (file: { fileName: string; filePath: string }) => void
|
|
) => void;
|
|
|
|
/**
|
|
* Opens a downloaded file with the default application for its type.
|
|
* Resolves with whether the file was opened.
|
|
*/
|
|
openDownload: (filePath: string) => Promise<boolean>;
|
|
|
|
/**
|
|
* Reveals a downloaded file in the file manager of the operating system.
|
|
* Resolves with whether the file was revealed.
|
|
*/
|
|
showDownloadInFolder: (filePath: string) => Promise<boolean>;
|
|
|
|
/**
|
|
* Get whether the app is configured to launch at login.
|
|
*/
|
|
getAutoLaunch: () => Promise<boolean>;
|
|
|
|
/**
|
|
* Enable or disable launching the app at login. Resolves with the
|
|
* resulting state as reported by the OS.
|
|
*/
|
|
setAutoLaunch: (enabled: boolean) => Promise<boolean>;
|
|
};
|
|
}
|
|
}
|
|
|
|
export {};
|