UNPKG

iter-over

Version:

Sugary iteration utilities and interfaces.

21 lines (20 loc) 663 B
import { AbstractIterator } from "../core/abstract-iterator"; declare type StringIndexedObject = { [property: string]: any; }; export declare type KeyValuePair<K, V> = { readonly key: K; readonly value: V; }; declare type ValueOf<T> = T[keyof T]; export declare class ObjectIterator<T extends StringIndexedObject = any> extends AbstractIterator<KeyValuePair<keyof T, ValueOf<T>>> { private readonly content; private readonly keys; private index; constructor(content: T); hasNext(): boolean; next(): KeyValuePair<keyof T, ValueOf<T>>; remove(): KeyValuePair<keyof T, ValueOf<T>> | undefined; reset(): void; } export {};