greg 4d1d2f8c52
Some checks failed
continuous-integration/drone Build is failing
maj
2023-06-11 20:17:11 +02:00

15 lines
523 B
TypeScript

import { expectType } from 'tsd'
import { open, RootDatabase } from '../..'
const path = 'type-test-store'
expectType<RootDatabase>(open(path, { compression: true }))
expectType<RootDatabase>(open({ path, compression: true }))
const defaultStore = open({ path, compression: true })
expectType<boolean>(await defaultStore.put('foo', { bar: 'baz' }))
expectType<any>(defaultStore.get('foo'))
const typedStore = open<string>({ path, compression: true })
expectType<string | undefined>(typedStore.get('foo'))