Skip to content

Commit

Permalink
Document internal iterator type
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHenninger committed Jul 24, 2023
1 parent 88aad1b commit fac8182
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/library/src/base/util/iterators/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ type levelSummary = componentSummary[]
*/
export type stackSummary = levelSummary[]

/**
* Custom iterator type implemented by `lab.js` flow control components
*
* Those `lab.js` components that themselves expose nested components
* do so by providing an iterator over those components. Any generic iterator
* will do for this task, as long as the study proceeds linearly, forward
* through components.
*
* If additional functionality is desired (specifically jumping and restarting),
* this needs to be implemented in the iterator also, allowing it to
* fast-forward through the available components, or start over (or both
* in sequence). These additional interfaces are summarized in the
* `CustomIterator`.
*/
export interface CustomIterator<T, TReturn = any, TNext = undefined>
extends Iterator<T, TReturn, TNext> {
peek: () => levelSummary
Expand Down

0 comments on commit fac8182

Please sign in to comment.