/** * @file Builds the lazy-init Socket `Spinner` class that extends the live * `yocto-spinner` constructor. The class graph is constructed inside * `createSpinnerClass()` so the `super()` call binds against the runtime * `YoctoSpinner` constructor passed in by the factory; keeping it here * instead of at module scope preserves the spinner's lazy-init guarantee * while splitting the bulk of the class body out of the factory module. */ import type { ColorRgb, ColorValue } from '../term/colors/types.js'; import { incLogCallCountSymbol, lastWasBlankSymbol } from '../logger/symbols.js'; import type { SpinnerInstance, SpinnerOptions } from './types.js'; export type SpinnerCtorType = { new (options?: SpinnerOptions | undefined): SpinnerInstance; }; export type YoctoSpinnerConstructor = new (...args: unknown[]) => { get color(): ColorRgb | ColorValue; set color(value: ColorRgb | ColorValue); isSpinning: boolean; [key: string]: unknown; }; export type SpinnerLogger = { error: (...args: unknown[]) => unknown; log: (...args: unknown[]) => unknown; [lastWasBlankSymbol]: (value: boolean) => unknown; [incLogCallCountSymbol]: () => unknown; }; /** * Build the Socket `Spinner` class as a subclass of the live `yocto-spinner` * constructor. Passing the parent class in keeps the `super()` binding against * the runtime constructor while letting the bulk of the class body live outside * the factory module. * * @param YoctoSpinnerClass - Runtime `yocto-spinner` constructor to extend. * @param logger - Default logger used for status output. * * @returns The constructed Socket spinner constructor. */ export declare function createSpinnerClass(YoctoSpinnerClass: YoctoSpinnerConstructor, logger: SpinnerLogger): SpinnerCtorType;