declare const undoneSymbol: unique symbol; /** * A mergeable interface used to extend the `LazyIterator` instances. * * @example * ```typescript * // Declaring the instance method by merging this interface: * declare module "@kermanx/lazy-iterator" { * interface LazyIterator { * instanceMethod(): void; * } * } * * // Injecting the instance method to `LazyIterator` prototype: * injectLazyIterator("instanceMethod", function () { * // do something * }); * * // Using the instance method: * lazyIteratorFactory.from([1, 2, 3]).instanceMethod(); * ``` */ interface LazyIterator { } declare abstract class LazyIterator implements IterableIterator { protected done: typeof undoneSymbol | TReturn; abstract next(...args: [] | [TNext]): IteratorResult; [Symbol.iterator](): IterableIterator; } /** * A mergeable interface used to extend the `LazyIteratorFactory`. * * @example * ```typescript * // Declaring the method by merging this interface: * declare module "@kermanx/lazy-iterator" { * interface LazyIteratorFactory { * aNewWayToCreateLazyIterator(): LazyIterator; * } * } * * // Injecting the method to `LazyIteratorFactory` prototype: * injectLazyIteratorFactory("aNewWayToCreateLazyIterator", function () { * return ... * }); * * // Using the method: * const iter = lazyIteratorFactory.aNewWayToCreateLazyIterator(); * ``` */ interface LazyIteratorFactory { } declare class LazyIteratorFactory { } /** * Injects a property to the LazyIteratorFactory. * @param key The key of the static property to inject * @param value The value of the static property to inject * @param descriptorOptions The descriptor options of the static property to inject */ declare function injectLazyIteratorFactory(key: string | symbol, value: any, descriptorOptions?: Omit): void; /** * The default LazyIteratorFactory. */ declare const lazyIteratorFactory: LazyIteratorFactory; /** * Injects a property to the `LazyIterator` prototype. * @param key The key of the instance property to inject * @param descriptorOptions The descriptor options of the static property to inject */ declare function injectLazyIteratorInstance(key: string | symbol, value: any): void; export { LazyIterator, LazyIteratorFactory, injectLazyIteratorFactory, injectLazyIteratorInstance, lazyIteratorFactory, undoneSymbol };