@dxtmisha/functional-basic 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.d.ts CHANGED
@@ -7178,6 +7178,87 @@ export declare function resizeImageByMax(image: HTMLImageElement | string, maxSi
7178
7178
  */
7179
7179
  declare type ResizeImageByMaxType = 'auto' | 'width' | 'height';
7180
7180
 
7181
+ /**
7182
+ * Class for creating a timer that can be paused and resumed.
7183
+ *
7184
+ * Класс для создания таймера, который можно приостанавливать и возобновлять.
7185
+ */
7186
+ export declare class ResumableTimer {
7187
+ protected callback: FunctionVoid;
7188
+ protected delay: number;
7189
+ protected timerId?: ReturnType<typeof setTimeout>;
7190
+ protected startTime?: number;
7191
+ protected remaining?: number;
7192
+ protected completed: boolean;
7193
+ /**
7194
+ * Constructor
7195
+ * @param callback function to be called after the delay / функция, которая будет вызвана после задержки
7196
+ * @param delay delay in milliseconds / задержка в миллисекундах
7197
+ * @param blockStart if true, the timer will not start immediately / если true, таймер не запустится сразу
7198
+ */
7199
+ constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
7200
+ /**
7201
+ * Resumes the timer if it was paused or starts it for the first time.
7202
+ *
7203
+ * Возобновляет таймер, если он был приостановлен, или запускает его впервые.
7204
+ */
7205
+ resume(): this;
7206
+ /**
7207
+ * Pauses the timer and calculates the remaining time.
7208
+ *
7209
+ * Приостанавливает таймер и вычисляет оставшееся время.
7210
+ */
7211
+ pause(): this;
7212
+ /**
7213
+ * Resets and restarts the timer with the original delay.
7214
+ *
7215
+ * Сбрасывает и перезапускает таймер с исходной задержкой.
7216
+ */
7217
+ reset(): this;
7218
+ /**
7219
+ * Completely clears the timer and resets its state.
7220
+ *
7221
+ * Полностью очищает таймер и сбрасывает его состояние.
7222
+ */
7223
+ clear(): this;
7224
+ /**
7225
+ * Returns the remaining time or the initial delay.
7226
+ *
7227
+ * Возвращает оставшееся время или начальную задержку.
7228
+ */
7229
+ protected getRemaining(): number;
7230
+ /**
7231
+ * Returns the time when the timer was started or the current time.
7232
+ *
7233
+ * Возвращает время запуска таймера или текущее время.
7234
+ */
7235
+ protected getStartTime(): number;
7236
+ /**
7237
+ * Executes the callback and marks the timer as completed.
7238
+ *
7239
+ * Выполняет колбэк и отмечает таймер как завершенный.
7240
+ */
7241
+ protected go(): this;
7242
+ /**
7243
+ * Updates the remaining time based on the elapsed time.
7244
+ *
7245
+ * Обновляет оставшееся время на основе прошедшего времени.
7246
+ */
7247
+ protected updateRemaining(): this;
7248
+ /**
7249
+ * Sets the current time as the start time.
7250
+ *
7251
+ * Устанавливает текущее время как время начала.
7252
+ */
7253
+ protected updateStartTime(): this;
7254
+ /**
7255
+ * Stops the timer and clears the timeout ID.
7256
+ *
7257
+ * Останавливает таймер и очищает идентификатор таймаута.
7258
+ */
7259
+ protected stop(): this;
7260
+ }
7261
+
7181
7262
  /**
7182
7263
  * Class for getting the scroll width.
7183
7264
  *