Files
BrowserOS/apps/agent/lib/browseros/toggleSidePanel.ts
Dani Akash 025780faea feat: agent code in monorepo (#137)
* feat: added agent code to monorepo

* chore: update bun lock file
2025-12-29 18:39:52 +05:30

25 lines
666 B
TypeScript

/**
* @public
*/
export async function openSidePanel(
tabId: number,
): Promise<{ opened: boolean }> {
// @ts-expect-error browserosIsOpen is a BrowserOS-specific API
const isAlreadyOpen = await chrome.sidePanel.browserosIsOpen({ tabId })
if (isAlreadyOpen) {
return { opened: true }
}
// @ts-expect-error browserosToggle is a BrowserOS-specific API
return await chrome.sidePanel.browserosToggle({ tabId })
}
/**
* @public
*/
export async function toggleSidePanel(
tabId: number,
): Promise<{ opened: boolean }> {
// @ts-expect-error browserosToggle is a BrowserOS-specific API
return await chrome.sidePanel.browserosToggle({ tabId })
}