Skip to content

Commit

Permalink
Apply suggestions from code review for types
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Potsides <[email protected]>
  • Loading branch information
jtsmedley and achingbrain authored Jul 26, 2024
1 parent 57e789f commit 8ffefe2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/car/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface CarComponents {
dagWalkers: Record<number, DAGWalker>
}

interface ExportCarOptions {
interface ExportCarOptions extends AbortOptions, ProgressOptions<GetBlockProgressEvents> {
blockFilter: Filter
}

Expand Down Expand Up @@ -134,7 +134,7 @@ export interface Car {
* await eventPromise
* ```
*/
export(root: CID | CID[], writer: Pick<CarWriter, 'put' | 'close'>, options?: ExportCarOptions & AbortOptions & ProgressOptions<GetBlockProgressEvents>): Promise<void>
export(root: CID | CID[], writer: Pick<CarWriter, 'put' | 'close'>, options?: ExportCarOptions): Promise<void>

/**
* Returns an AsyncGenerator that yields CAR file bytes.
Expand Down Expand Up @@ -175,7 +175,7 @@ class DefaultCar implements Car {
))
}

async export (root: CID | CID[], writer: Pick<CarWriter, 'put' | 'close'>, options?: ExportCarOptions & AbortOptions & ProgressOptions<GetBlockProgressEvents>): Promise<void> {
async export (root: CID | CID[], writer: Pick<CarWriter, 'put' | 'close'>, options?: ExportCarOptions): Promise<void> {
const deferred = defer<Error | undefined>()
const roots = Array.isArray(root) ? root : [root]

Expand Down Expand Up @@ -216,7 +216,7 @@ class DefaultCar implements Car {
}
}

async * stream (root: CID | CID[], options?: ExportCarOptions & AbortOptions & ProgressOptions<GetBlockProgressEvents>): AsyncGenerator<Uint8Array, void, undefined> {
async * stream (root: CID | CID[], options?: ExportCarOptions): AsyncGenerator<Uint8Array, void, undefined> {
const { writer, out } = CarWriter.create(root)

// has to be done async so we write to `writer` and read from `out` at the
Expand Down

0 comments on commit 8ffefe2

Please sign in to comment.