mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
* Add missing JSDoc to exported members in app and server utils Documents all exported functions, classes, enums, and constants in app/utils and server/utils that were missing JSDoc, per the project documentation guidelines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU * Use @returns tag to match codebase convention Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU --------- Co-authored-by: Claude <noreply@anthropic.com>
41 lines
897 B
TypeScript
41 lines
897 B
TypeScript
import { isMac, isWindows } from "@shared/utils/browser";
|
|
|
|
/**
|
|
* Helper methods for detecting and interacting with the desktop application
|
|
* wrapper.
|
|
*/
|
|
export default class Desktop {
|
|
/**
|
|
* Returns true if the client has inset/floating window controls.
|
|
*/
|
|
static hasInsetTitlebar() {
|
|
return this.isMacApp();
|
|
}
|
|
|
|
/**
|
|
* Returns true if the client is running in the macOS app.
|
|
*/
|
|
static isMacApp() {
|
|
return this.isElectron() && isMac;
|
|
}
|
|
|
|
/**
|
|
* Returns true if the client is running in the Windows app.
|
|
*/
|
|
static isWindowsApp() {
|
|
return this.isElectron() && isWindows;
|
|
}
|
|
|
|
/**
|
|
* Returns true if the client is running in a desktop app.
|
|
*/
|
|
static isElectron() {
|
|
return navigator?.userAgent?.includes("Electron");
|
|
}
|
|
|
|
/**
|
|
* The bridge provides secure access to API's in desktop wrapper.
|
|
*/
|
|
static bridge = window.DesktopBridge;
|
|
}
|