diff --git a/packages/interface-blockstore/src/index.ts b/packages/interface-blockstore/src/index.ts index eedf1e84..68662013 100644 --- a/packages/interface-blockstore/src/index.ts +++ b/packages/interface-blockstore/src/index.ts @@ -1,3 +1,9 @@ +/* eslint-disable @typescript-eslint/ban-types */ +// this ignore is so we can use {} as the default value for the options +// extensions below - it normally means "any non-nullish value" but here +// we are using it as an intersection type - see the aside at the bottom: +// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + import type { AbortOptions, AwaitIterable, @@ -10,10 +16,10 @@ export interface Pair { block: Uint8Array } -export interface Blockstore extends Store extends Store { diff --git a/packages/interface-datastore/src/index.ts b/packages/interface-datastore/src/index.ts index 91cc7f4b..251495c3 100644 --- a/packages/interface-datastore/src/index.ts +++ b/packages/interface-datastore/src/index.ts @@ -1,3 +1,9 @@ +/* eslint-disable @typescript-eslint/ban-types */ +// this ignore is so we can use {} as the default value for the options +// extensions below - it normally means "any non-nullish value" but here +// we are using it as an intersection type - see the aside at the bottom: +// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + import { Key } from './key.js' import type { Await, @@ -11,18 +17,18 @@ export interface Pair { value: Uint8Array } -export interface Batch { +export interface Batch { put: (key: Key, value: Uint8Array) => void delete: (key: Key) => void commit: (options?: AbortOptions & BatchOptionsExtension) => Await } -export interface Datastore extends Store { +export interface Store { /** * Check for the existence of a value for the passed key *