diff --git a/goldens/public-api/common/common.d.ts b/goldens/public-api/common/common.d.ts index c36711e0fd..8a6d5c0155 100644 --- a/goldens/public-api/common/common.d.ts +++ b/goldens/public-api/common/common.d.ts @@ -138,18 +138,18 @@ export declare class KeyValuePipe implements PipeTransform { transform(input: null, compareFn?: (a: KeyValue, b: KeyValue) => number): null; transform(input: { [key: string]: V; - } | Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; + } | ReadonlyMap, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform(input: { [key: string]: V; - } | Map | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; + } | ReadonlyMap | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; transform(input: { [key: number]: V; - } | Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; + } | ReadonlyMap, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform(input: { [key: number]: V; - } | Map | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; - transform(input: Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; - transform(input: Map | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; + } | ReadonlyMap | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; + transform(input: ReadonlyMap, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; + transform(input: ReadonlyMap | null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array> | null; } export declare class Location { diff --git a/packages/common/src/pipes/keyvalue_pipe.ts b/packages/common/src/pipes/keyvalue_pipe.ts index 19730731b1..e81fff1326 100644 --- a/packages/common/src/pipes/keyvalue_pipe.ts +++ b/packages/common/src/pipes/keyvalue_pipe.ts @@ -36,8 +36,8 @@ export interface KeyValue { * @usageNotes * ### Examples * - * This examples show how an Object or a Map can be iterated by ngFor with the use of this keyvalue - * pipe. + * This examples show how an Object or a Map can be iterated by ngFor with the use of this + * keyvalue pipe. * * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'} * @@ -52,28 +52,29 @@ export class KeyValuePipe implements PipeTransform { transform(input: null, compareFn?: (a: KeyValue, b: KeyValue) => number): null; transform( - input: {[key: string]: V}|Map, + input: {[key: string]: V}|ReadonlyMap, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform( - input: {[key: string]: V}|Map|null, + input: {[key: string]: V}|ReadonlyMap|null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>|null; transform( - input: {[key: number]: V}|Map, + input: {[key: number]: V}|ReadonlyMap, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform( - input: {[key: number]: V}|Map|null, + input: {[key: number]: V}|ReadonlyMap|null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>|null; - transform(input: Map, compareFn?: (a: KeyValue, b: KeyValue) => number): - Array>; transform( - input: Map|null, + input: ReadonlyMap, + compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; + transform( + input: ReadonlyMap|null, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>|null; transform( - input: null|{[key: string]: V, [key: number]: V}|Map, + input: null|{[key: string]: V, [key: number]: V}|ReadonlyMap, compareFn: (a: KeyValue, b: KeyValue) => number = defaultComparator): Array>|null { if (!input || (!(input instanceof Map) && typeof input !== 'object')) {