Skip to content

Commit

Permalink
refactor(@angular-devkit/core): fix up internal typings
Browse files Browse the repository at this point in the history
Resolves some type errors that showed up internally.
  • Loading branch information
crisbeto authored and jkrems committed Sep 18, 2024
1 parent f6b7cd9 commit a3bbe0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 31 deletions.
6 changes: 3 additions & 3 deletions goldens/public-api/angular_devkit/core/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,15 @@ export class PartiallyOrderedSet<T> implements Set<T> {
clear(): void;
// (undocumented)
delete(item: T): boolean;
entries(): IterableIterator<[T, T]>;
entries(): SetIterator<[T, T]>;
// (undocumented)
forEach(callbackfn: (value: T, value2: T, set: PartiallyOrderedSet<T>) => void, thisArg?: any): void;
// (undocumented)
has(item: T): boolean;
keys(): IterableIterator<T>;
keys(): SetIterator<T>;
// (undocumented)
get size(): number;
values(): IterableIterator<T>;
values(): SetIterator<T>;
}

// @public
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
}
},
"resolutions": {
"@bazel/concatjs@npm:5.8.1": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch"
"@bazel/concatjs@npm:5.8.1": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch",
"@microsoft/api-extractor/typescript": "5.6.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class PartiallyOrderedSet<T> implements Set<T> {
/**
* Returns an iterable of [v,v] pairs for every value `v` in the set.
*/
*entries(): IterableIterator<[T, T]> {
*entries(): SetIterator<[T, T]> {
for (const item of this) {
yield [item, item];
}
Expand All @@ -60,14 +60,14 @@ export class PartiallyOrderedSet<T> implements Set<T> {
/**
* Despite its name, returns an iterable of the values in the set,
*/
keys(): IterableIterator<T> {
keys(): SetIterator<T> {
return this.values();
}

/**
* Returns an iterable of values in the set.
*/
values(): IterableIterator<T> {
values(): SetIterator<T> {
return this[Symbol.iterator]();
}

Expand Down
8 changes: 4 additions & 4 deletions packages/angular_devkit/core/src/workspace/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ class DefinitionCollection<V extends object> implements ReadonlyMap<string, V> {
return this._map.size;
}

[Symbol.iterator](): IterableIterator<[string, V]> {
[Symbol.iterator](): MapIterator<[string, V]> {
return this._map[Symbol.iterator]();
}

entries(): IterableIterator<[string, V]> {
entries(): MapIterator<[string, V]> {
return this._map.entries();
}

keys(): IterableIterator<string> {
keys(): MapIterator<string> {
return this._map.keys();
}

values(): IterableIterator<V> {
values(): MapIterator<V> {
return this._map.values();
}
}
Expand Down
20 changes: 0 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16919,16 +16919,6 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.4.2":
version: 5.4.2
resolution: "typescript@npm:5.4.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/583ff68cafb0c076695f72d61df6feee71689568179fb0d3a4834dac343df6b6ed7cf7b6f6c801fa52d43cd1d324e2f2d8ae4497b09f9e6cfe3d80a6d6c9ca52
languageName: node
linkType: hard

"typescript@npm:5.6.2":
version: 5.6.2
resolution: "typescript@npm:5.6.2"
Expand All @@ -16949,16 +16939,6 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.4.2#optional!builtin<compat/typescript>":
version: 5.4.2
resolution: "typescript@patch:typescript@npm%3A5.4.2#optional!builtin<compat/typescript>::version=5.4.2&hash=5adc0c"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/fcf6658073d07283910d9a0e04b1d5d0ebc822c04dbb7abdd74c3151c7aa92fcddbac7d799404e358197222006ccdc4c0db219d223d2ee4ccd9e2b01333b49be
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.6.2#optional!builtin<compat/typescript>":
version: 5.6.2
resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin<compat/typescript>::version=5.6.2&hash=74658d"
Expand Down

0 comments on commit a3bbe0e

Please sign in to comment.