import type { Engine } from 'ox' import { expectTypeOf, test } from 'vp/test' import * as core_Keystore from '../../core/Keystore.js' import * as NodeKeystore from '../Keystore.js' type Slot = Awaited> test('every implemented primitive is present', () => { expectTypeOf().toEqualTypeOf< (key: Uint8Array, iv: Uint8Array, data: Uint8Array) => Uint8Array >() expectTypeOf().toEqualTypeOf< (key: Uint8Array, iv: Uint8Array, data: Uint8Array) => Uint8Array >() expectTypeOf().toEqualTypeOf< ( password: Uint8Array, salt: Uint8Array, options: { c: number; dkLen: number }, ) => Uint8Array >() expectTypeOf().toEqualTypeOf< ( password: Uint8Array, salt: Uint8Array, options: { c: number; dkLen: number }, ) => Promise >() }) test('unsupported primitives are absent', () => { expectTypeOf().not.toHaveProperty('scrypt') expectTypeOf().not.toHaveProperty('scryptAsync') }) test('the result is the raw slot', () => { expectTypeOf<{ Keystore: Slot }>().toExtend() }) test('the Node namespace exposes the public Keystore API', () => { expectTypeOf(NodeKeystore.pbkdf2).toEqualTypeOf(core_Keystore.pbkdf2) expectTypeOf().not.toHaveProperty('create') })