snowflakify
Version:
The most complete Snowflake ID generator in TypeScript
24 lines (23 loc) • 717 B
TypeScript
import FragmentBase from '../FragmentBase.js';
import { DestructuredFragment } from '../@types/index.js';
/**
* SequenceFragment class for sequence (increment/counter) IDs.
* @public
*/
export default class SequenceFragment extends FragmentBase {
getValue(): bigint;
destructure(snowflake: number | bigint | string): DestructuredFragment;
/**
* Returns a boolean indicating whether the sequence will reset on the next call.
*
* @returns `true` if the sequence will reset when the next getValue() is called.
* Otherwise, returns `false`.
* @internal
*/
willReset(): boolean;
/**
* Resets the sequence to 0
* @internal
*/
resetSequence(): void;
}