@dxtmisha/functional-basic 0.8.4 → 0.8.5

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
@@ -691,13 +691,22 @@ export declare function blobToBase64(blob: Blob): Promise<string | ArrayBuffer |
691
691
  */
692
692
  export declare class BroadcastMessage<Message = any> {
693
693
  protected callback?: ((event: MessageEvent<Message>) => void) | undefined;
694
+ protected callbackError?: ((event: MessageEvent<Message>) => void) | undefined;
694
695
  protected channel?: BroadcastChannel;
695
696
  /**
696
697
  * Constructor
697
698
  * @param name channel name/ название канала
698
699
  * @param callback callback on message received/ колбэк на получение сообщения
700
+ * @param callbackError callback on message error/ колбэк на ошибку сообщения
699
701
  */
700
- constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined);
702
+ constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined);
703
+ /**
704
+ * Get the channel.
705
+ *
706
+ * Получить канал.
707
+ * @returns channel/ канал
708
+ */
709
+ getChannel(): BroadcastChannel | undefined;
701
710
  /**
702
711
  * Send a message to the channel.
703
712
  *
@@ -712,6 +721,13 @@ export declare class BroadcastMessage<Message = any> {
712
721
  * @param callback callback function/ функция колбэка
713
722
  */
714
723
  setCallback(callback: (event: MessageEvent<Message>) => void): this;
724
+ /**
725
+ * Set the callback function to be called when a message error occurs.
726
+ *
727
+ * Установить функцию колбэка, которая будет вызвана при возникновении ошибки сообщения.
728
+ * @param callbackError callback function/ функция колбэка
729
+ */
730
+ setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
715
731
  /**
716
732
  * Update state on message received.
717
733
  *
@@ -719,6 +735,13 @@ export declare class BroadcastMessage<Message = any> {
719
735
  * @param event message event/ событие сообщения
720
736
  */
721
737
  protected readonly update: (event: MessageEvent<Message>) => this;
738
+ /**
739
+ * Update error state on message error.
740
+ *
741
+ * Обновление состояния ошибки при получении ошибки сообщения.
742
+ * @param event message error event/ событие ошибки сообщения
743
+ */
744
+ protected readonly updateError: (event: MessageEvent<Message>) => this;
722
745
  }
723
746
 
724
747
  /**
@@ -1544,48 +1567,6 @@ export declare type ElementOrString<E extends ElementOrWindow> = E | string;
1544
1567
  */
1545
1568
  export declare type ElementOrWindow = HTMLElement | Window;
1546
1569
 
1547
- /**
1548
- * Class for taking screenshots of an element.
1549
- *
1550
- * Класс для создания скриншотов элемента.
1551
- *
1552
- * This class uses native browser APIs to capture an element by embedding its HTML into an SVG.
1553
- * It has limitations and may not render everything with perfect accuracy, especially:
1554
- * - Images, iframes, or other resources from different origins (due to CORS security policies).
1555
- * - CSS pseudo-elements like ::before and ::after are not rendered.
1556
- * - The element's context is lost, so CSS rules depending on parent elements might not apply correctly.
1557
- *
1558
- * For more robust and accurate capturing, a library like html2canvas is recommended as it reconstructs
1559
- * the element and its styles on a canvas from scratch.
1560
- */
1561
- export declare class ElementScreenshot {
1562
- protected readonly element: HTMLElement;
1563
- /**
1564
- * Constructor
1565
- * @param element HTML element to capture/ HTML элемент для захвата
1566
- */
1567
- constructor(element: HTMLElement);
1568
- /**
1569
- * Takes a screenshot of the element.
1570
- *
1571
- * Делает скриншот элемента.
1572
- */
1573
- take(): Promise<string>;
1574
- /**
1575
- * Takes a screenshot and downloads it.
1576
- *
1577
- * Делает скриншот и скачивает его.
1578
- * @param filename name of the file to download/ имя файла для скачивания
1579
- */
1580
- download(filename?: string): Promise<void>;
1581
- /**
1582
- * Gathers all CSS styles from the document's stylesheets.
1583
- *
1584
- * Собирает все стили CSS из таблиц стилей документа.
1585
- */
1586
- protected getStyles(): string;
1587
- }
1588
-
1589
1570
  /**
1590
1571
  * Union type for all "empty" values including falsy primitives and string representations/
1591
1572
  * Объединенный тип для всех "пустых" значений включая ложные примитивы и строковые представления