@nysds/nys-icon 1.18.3-alpha-1 → 1.19.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.
@@ -27,7 +27,14 @@ declare global {
27
27
  interface Window extends NysIconGlobals {
28
28
  }
29
29
  }
30
- /** Register or replace a named icon library. All watching icons using this library will redraw. */
30
+ /** Register or replace a named icon library. All watching icons using this library will redraw.
31
+ * @example Register a Font Awesome library with a custom resolver:
32
+ * ```ts
33
+ * registerIconLibrary("fa", {
34
+ * resolver: (name) => `https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/svg/${name}.svg`
35
+ * });
36
+ * ```
37
+ */
31
38
  export declare function registerIconLibrary(name: string, library: IconLibrary): void;
32
39
  /** Remove a registered icon library. All watching icons using this library will redraw. */
33
40
  export declare function unregisterIconLibrary(name: string): void;
@@ -50,6 +50,10 @@ export declare class NysIcon extends LitElement implements NysIconWatcher {
50
50
  private _svg;
51
51
  /** Monotonically increasing token so stale async fetches are discarded. */
52
52
  private _loadSeq;
53
+ /** Promise for the in-flight icon load. */
54
+ private _loadPromise;
55
+ /** Resolves when the current icon load (if any) is complete. */
56
+ get updateComplete(): Promise<boolean>;
53
57
  connectedCallback(): void;
54
58
  disconnectedCallback(): void;
55
59
  /** Called by the icon library registry when the current library changes. */
@@ -62,6 +66,7 @@ export declare class NysIcon extends LitElement implements NysIconWatcher {
62
66
  * fire for properties that equal their defaults.
63
67
  */
64
68
  firstUpdated(): void;
69
+ private static _validName;
65
70
  updated(changedProps: Map<string, unknown>): void;
66
71
  private _loadIcon;
67
72
  private _applyAttributes;