import { expectTypeOf, test } from 'vp/test' import type * as Engine from '../../core/Engine.js' import * as core_Ed25519 from '../../core/Ed25519.js' import * as NodeEd25519 from '../Ed25519.js' type Slot = Awaited> test('every implemented primitive is present', () => { expectTypeOf().toEqualTypeOf< (privateKey: Uint8Array) => Uint8Array >() expectTypeOf().toEqualTypeOf< (payload: Uint8Array, privateKey: Uint8Array) => Uint8Array >() expectTypeOf().toEqualTypeOf< (privateKey: Uint8Array) => Uint8Array >() }) test('unsupported primitives are absent', () => { expectTypeOf().not.toHaveProperty('randomSecretKey') expectTypeOf().not.toHaveProperty('toMontgomery') expectTypeOf().not.toHaveProperty('verify') }) test('the result is the raw slot', () => { expectTypeOf<{ Ed25519: Slot }>().toExtend() }) test('the Node namespace exposes the public Ed25519 API', () => { expectTypeOf(NodeEd25519.getPublicKey).toEqualTypeOf( core_Ed25519.getPublicKey, ) expectTypeOf().not.toHaveProperty('create') })