Skip to content

Commit

Permalink
chore(types): reuse built-in Iterator type (#11435)
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-leong authored Jul 29, 2024
1 parent 208f5c0 commit 87923f6
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/reactivity/src/collectionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,6 @@ function createForEach(isReadonly: boolean, isShallow: boolean) {
}
}

interface Iterable {
[Symbol.iterator](): Iterator
}

interface Iterator {
next(value?: any): IterationResult
}

interface IterationResult {
value: any
done: boolean
}

function createIterableMethod(
method: string | symbol,
isReadonly: boolean,
Expand All @@ -194,7 +181,7 @@ function createIterableMethod(
return function (
this: IterableCollections,
...args: unknown[]
): Iterable & Iterator {
): Iterable<unknown> & Iterator<unknown> {
const target = (this as any)[ReactiveFlags.RAW]
const rawTarget = toRaw(target)
const targetIsMap = isMap(rawTarget)
Expand Down

0 comments on commit 87923f6

Please sign in to comment.