Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: interface exports #6

Merged
merged 5 commits into from Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bucket.ts
Expand Up @@ -3,7 +3,7 @@ import SparseArray from 'sparse-array'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { InfiniteHash } from './consumable-hash.js'

interface BucketChild<V> {
export interface BucketChild<V> {
key: string
value: V
hash: InfiniteHash
Expand All @@ -20,14 +20,14 @@ interface SA<B> {
unset: (i: number) => void
}

interface BucketPosition<T> {
export interface BucketPosition<T> {
bucket: Bucket<T>
pos: number
hash: InfiniteHash
existingChild?: BucketChild<T>
}

interface BucketOptions {
export interface BucketOptions {
bits: number
hash: (value: Uint8Array | InfiniteHash) => InfiniteHash
}
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
@@ -1,4 +1,4 @@
import { Bucket } from './bucket.js'
import { Bucket, BucketOptions, BucketPosition, BucketChild } from './bucket.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the linter not complain these aren't being used and should be import type instead?

import { wrapHash } from './consumable-hash.js'

interface UserBucketOptions {
Expand All @@ -20,3 +20,4 @@ export function createHAMT<T> (options: UserBucketOptions) {
}

export { Bucket }
export type { BucketOptions, BucketPosition, BucketChild }