]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(types): reuse built-in Iterator type (#11435)
authorTycho <jh.leong@outlook.com>
Mon, 29 Jul 2024 13:26:48 +0000 (21:26 +0800)
committerGitHub <noreply@github.com>
Mon, 29 Jul 2024 13:26:48 +0000 (21:26 +0800)
packages/reactivity/src/collectionHandlers.ts

index c39e3ed48cdfb832a40e669222a0dee98808c47e..9098ad4a2e5cb9c7b63e3420f0b727cbbc2d9d48 100644 (file)
@@ -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,
@@ -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)