Skip to content

Commit

Permalink
Fix imports/exports
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed May 7, 2024
1 parent 5055250 commit 124f574
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/blob-index/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from './types.js'
export * from './api.js'
export * from './sharded-dag-index.js'
export * from './digest-map.js'
11 changes: 10 additions & 1 deletion packages/blob-index/src/sharded-dag-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,17 @@ class DecodeFailure extends Failure {
}
}

/**
*
* @param {API.UnknownLink} content
* @returns {API.ShardedDAGIndex}
*/
export function makeShardedDAGINdex(content) {
return new ShardedDAGIndex(content)
}

/** @implements {API.ShardedDAGIndex} */
export class ShardedDAGIndex {
class ShardedDAGIndex {
/** @param {API.UnknownLink} content */
constructor(content) {
this.content = content
Expand Down
1 change: 0 additions & 1 deletion packages/blob-index/src/types.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/blob-index/src/types/index.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/upload-api/test/external-service/ipni-service.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as API from '../../src/types.js'
import { base58btc } from 'multiformats/bases/base58'
import { ok, error } from '@ucanto/core'
import { DigestMap, ShardedDAGIndex } from '@web3-storage/blob-index'
import * as BlobIndex from '@web3-storage/blob-index'
import { RecordNotFound } from '../../src/errors.js'

/** @implements {API.IPNIService} */
export class IPNIService {
#data

constructor() {
this.#data = new DigestMap()
this.#data = new BlobIndex.DigestMap()
}

/** @param {ShardedDAGIndex} index */
/** @param {BlobIndex.ShardedDAGIndex} index */
async publish(index) {
for (const [, slices] of index.shards) {
for (const [digest] of slices) {
Expand Down

0 comments on commit 124f574

Please sign in to comment.