mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 12:54:09 +02:00
Add a typed platform package to decouple the frontend from Tauri (#539)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0068be9ffc
commit
2383f06e71
@@ -0,0 +1,14 @@
|
||||
import { platform } from "./registry";
|
||||
import type { CapabilityName } from "./types";
|
||||
|
||||
/**
|
||||
* Whether the current host supports a feature.
|
||||
*
|
||||
* A hook so components can gate on it directly, and so this can become reactive
|
||||
* later — a browser tab gains and loses capabilities when the local bridge comes
|
||||
* and goes. Capabilities are fixed for the life of the desktop app, so today it
|
||||
* is a plain read.
|
||||
*/
|
||||
export function useCapability(name: CapabilityName): boolean {
|
||||
return platform.capabilities[name];
|
||||
}
|
||||
Reference in New Issue
Block a user