UNPKG

ts-type

Version:

TypeScript 類型工具庫:提供豐富的類型操作工具和重新導出的內建類型 / TypeScript type utility library: provides rich type manipulation utilities and re-exported built-in types

26 lines (25 loc) 659 B
/** * 迭代器類型定義 * Iterator Type Definitions * * 提供 Iterator 和 IteratorResult 的類型定義 * Provides Iterator and IteratorResult type definitions */ /** * Iterator 類型 * Iterator type * * @example * const iterator: ITSIterator<string> = { * next() { return { done: false, value: 'test' }; } * }; */ export type ITSIterator<T, TReturn = void, TNext = undefined> = Iterator<T, TReturn, TNext>; /** * IteratorResult 類型 * IteratorResult type * * @example * const result: ITSIteratorResult<string> = { done: false, value: 'test' }; */ export type ITSIteratorResult<T, TReturn = void> = IteratorResult<T, TReturn>;