Skip to content

Commit 87923f6

Browse files
authored
chore(types): reuse built-in Iterator type (#11435)
1 parent 208f5c0 commit 87923f6

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

packages/reactivity/src/collectionHandlers.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,6 @@ function createForEach(isReadonly: boolean, isShallow: boolean) {
173173
}
174174
}
175175

176-
interface Iterable {
177-
[Symbol.iterator](): Iterator
178-
}
179-
180-
interface Iterator {
181-
next(value?: any): IterationResult
182-
}
183-
184-
interface IterationResult {
185-
value: any
186-
done: boolean
187-
}
188-
189176
function createIterableMethod(
190177
method: string | symbol,
191178
isReadonly: boolean,
@@ -194,7 +181,7 @@ function createIterableMethod(
194181
return function (
195182
this: IterableCollections,
196183
...args: unknown[]
197-
): Iterable & Iterator {
184+
): Iterable<unknown> & Iterator<unknown> {
198185
const target = (this as any)[ReactiveFlags.RAW]
199186
const rawTarget = toRaw(target)
200187
const targetIsMap = isMap(rawTarget)

0 commit comments

Comments
 (0)