@loken/hierarchies
Version:
Library for working with hierarchies of identifiers and identifiable objects.
66 lines (52 loc) • 1.19 kB
text/typescript
import { type TryResult, tryResult } from '@loken/utilities';
import type { ISequenceSignal } from './sequence.types.ts';
/**
* @internal Has some members which must be public for internal use
* which should not be used by a consumer.
*/
export class SequenceSignal<TEl> implements ISequenceSignal<TEl> {
//#region fields
//#endregion
//#region ISequenceSignal
public get index() {
return this.
}
public get count() {
return this.
}
public next(element?: TEl) {
this.
}
public skip() {
this.
}
//endregion
//#region internal
constructor(options: { first: TEl | undefined }) {
this.
}
public shouldYield(): boolean {
return !this.
}
public cleanup(): void {
if (!this.
this.
}
public tryGetNext(): TryResult<TEl> {
if (this.
const element = this.
this.
this.
this.
return tryResult.succeed(element);
}
else {
return tryResult.fail();
}
}
//#endregion
}