feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
export function installFixtureVaultDesktopBridgeInBrowser(): void {
|
||||
const dispatchBrowserMenuCommand =
|
||||
window.__laputaTest?.dispatchBrowserMenuCommand
|
||||
?? (() => { throw new Error('Tolaria test bridge is missing dispatchBrowserMenuCommand') })
|
||||
|
||||
const specialHandlers: Record<string, (args?: Record<string, unknown>) => unknown> = {
|
||||
trigger_menu_command: (args) => {
|
||||
dispatchBrowserMenuCommand(String(args?.id ?? ''))
|
||||
return null
|
||||
},
|
||||
}
|
||||
|
||||
const invoke = (command: string, args?: Record<string, unknown>) => {
|
||||
const handler = specialHandlers[command] ?? window.__mockHandlers?.[command]
|
||||
if (!handler) throw new Error(`Unhandled invoke: ${command}`)
|
||||
return handler(args)
|
||||
}
|
||||
|
||||
Object.defineProperty(window, '__TAURI__', {
|
||||
configurable: true,
|
||||
value: {},
|
||||
})
|
||||
Object.defineProperty(window, '__TAURI_INTERNALS__', {
|
||||
configurable: true,
|
||||
value: { invoke },
|
||||
})
|
||||
}
|
||||
Loading…
Reference in a new issue