'use strict'; import type { Shareable, ShareableHost, ShareableHostDecorator } from './types'; export function __installUnpacker() { function shareableHostUnpacker( initial: TValue, hostDecorator?: ShareableHostDecorator ): Shareable { let hostShareable = { isHost: true, __shareableRef: true, value: initial, } as ShareableHost; if (hostDecorator) { hostShareable = hostDecorator(hostShareable); } const shareable = hostShareable; return shareable; } globalThis.__shareableHostUnpacker = shareableHostUnpacker; } export type ShareableHostUnpacker = ( initial: TValue, decorateHost?: ShareableHostDecorator ) => Shareable;