angry-pixel 2.1.0 → 2.1.2

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/lib/index.d.ts CHANGED
@@ -1579,6 +1579,13 @@ declare class AssetManager {
1579
1579
  * @returns The HTML Video element created
1580
1580
  */
1581
1581
  loadVideo(url: string, name?: string): HTMLVideoElement;
1582
+ /**
1583
+ * Loads a JSON asset
1584
+ * @param url The asset URL
1585
+ * @param name The asset name [optional]
1586
+ * @returns Promise<Record<string, any>>
1587
+ */
1588
+ loadJson<T = Record<string, any>>(url: string, name?: string): Promise<T>;
1582
1589
  /**
1583
1590
  * Retrieves an image asset
1584
1591
  * @param url The asset URL
@@ -1621,7 +1628,20 @@ declare class AssetManager {
1621
1628
  * @returns The HTML Video element
1622
1629
  */
1623
1630
  getVideo(name: string): HTMLVideoElement;
1631
+ /**
1632
+ * Retrieves a json asset
1633
+ * @param url The asset URL
1634
+ * @returns The JSON object
1635
+ */
1636
+ getJson<T = Record<string, any>>(url: string): T;
1637
+ /**
1638
+ * Retrieves a json asset
1639
+ * @param name The asset name
1640
+ * @returns The JSON object
1641
+ */
1642
+ getJson<T = Record<string, any>>(name: string): T;
1624
1643
  private createAsset;
1644
+ private deleteAssetIfExists;
1625
1645
  }
1626
1646
 
1627
1647
  /**
@@ -2003,6 +2023,7 @@ declare class AudioPlayer {
2003
2023
  /** @internal */
2004
2024
  _currentAudioSource: HTMLAudioElement;
2005
2025
  _playPromisePendind: boolean;
2026
+ _playAfterUserInput: boolean;
2006
2027
  constructor(options?: Partial<AudioPlayerOptions>);
2007
2028
  /**
2008
2029
  * Play the audio source.