/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { KeyValueDiffers, PipeTransform } from '@angular/core'; /** * A key value pair. * Usually used to represent the key value pairs from a Map or Object. */ export interface KeyValue { key: K; value: V; } /** * @ngModule CommonModule * @description * * Transforms Object or Map into an array of key value pairs. * * The output array will be ordered by keys. * By default the comparator will be by Unicode point value. * You can optionally pass a compareFn if your keys are complex types. * * ## Examples * * This examples show how an Object or a Map and be iterated by ngFor with the use of this keyvalue * pipe. * * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'} */ export declare class KeyValuePipe implements PipeTransform { private readonly differs; constructor(differs: KeyValueDiffers); private differ; private keyValues; transform(input: null, compareFn?: (a: KeyValue, b: KeyValue) => number): null; transform(input: { [key: string]: V; } | Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform(input: { [key: number]: V; } | Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; transform(input: Map, compareFn?: (a: KeyValue, b: KeyValue) => number): Array>; } export declare function defaultComparator(keyValueA: KeyValue, keyValueB: KeyValue): number;