mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 08:02:31 +00:00
25 lines
779 B
TypeScript
25 lines
779 B
TypeScript
export type RuntimeBrowserServerPlacement = Readonly<{ kind: 'server' }>
|
|
|
|
export type RuntimeBrowserClientPlacement = Readonly<{
|
|
kind: 'client'
|
|
browserHostClientId: string
|
|
browserHostGeneration: number
|
|
pageHostGeneration: number
|
|
}>
|
|
|
|
export type RuntimeBrowserPlacement = RuntimeBrowserServerPlacement | RuntimeBrowserClientPlacement
|
|
|
|
export function sameRuntimeBrowserPlacement(
|
|
left: RuntimeBrowserPlacement,
|
|
right: RuntimeBrowserPlacement
|
|
): boolean {
|
|
return (
|
|
left.kind === right.kind &&
|
|
(left.kind === 'server' ||
|
|
(right.kind === 'client' &&
|
|
left.browserHostClientId === right.browserHostClientId &&
|
|
left.browserHostGeneration === right.browserHostGeneration &&
|
|
left.pageHostGeneration === right.pageHostGeneration))
|
|
)
|
|
}
|