INNER CODE UNIT · TypeScript

getPlatform

opensquilla/opensquilla · opensquilla-webui/src/platform/index.ts:8

export function getPlatform(): Platform {
  const platformId = detectPlatformId()
  if (cachedPlatform?.id === platformId) return cachedPlatform
  cachedPlatform = platformId === 'desktop'
    ? createDesktopPlatform()
    : createWebPlatform()
  return cachedPlatform
}

export function usePlatform(): Platform {
  return getPlatform()
}

export type {
  ArtifactNativeOpenResult,
  ArtifactOpenRequest,
  CliInvocation,
  DesktopMainWindowCloseBehavior,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…