import * as inputContract from './contract.ts'; import type { HostInputIngressCapability } from './contract.ts'; import * as inputPublic from './index.ts'; type LegacyInputPointerLockBackendMember = 'exitPointerLock' | 'hasPointerLock'; type LegacyInputPointerLockIngressOperation = Extract< keyof HostInputIngressCapability, LegacyInputPointerLockBackendMember >; const LEGACY_INPUT_POINTER_LOCK_EXPORTS = [ 'exitInputPointerLock', 'hasInputPointerLock', 'requestInputPointerLock', ] as const; const LEGACY_WEB_INPUT_INGRESS_EXPORTS = [ 'createWebInputIngressBackend', 'getCoalescedInputPointerEvents', 'getKeyCodeFromDomKeyboardEvent', 'getKeyModifierFromDomKeyboardEvent', 'getMouseWheelModeFromDomWheelEvent', 'initializeWebInputIngressBackend', 'releaseInputPointerCapture', 'setInputPointerCapture', ] as const; describe('input exports', () => { it('excludes the legacy pointer-lock surface from both export lanes', () => { for (const name of LEGACY_INPUT_POINTER_LOCK_EXPORTS) { expect(name in inputPublic).toBe(false); expect(name in inputContract).toBe(false); } }); it('excludes legacy pointer-lock operations from listener ingress', () => { const hasNoLegacyOperations: LegacyInputPointerLockIngressOperation extends never ? true : false = true; expect(hasNoLegacyOperations).toBe(true); }); it('excludes Web ingress construction and DOM helpers from both export lanes', () => { for (const name of LEGACY_WEB_INPUT_INGRESS_EXPORTS) { expect(name in inputPublic).toBe(false); expect(name in inputContract).toBe(false); } }); });