@m2c2kit/core 0.3.19 → 0.3.21

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/index.d.ts CHANGED
@@ -1556,6 +1556,7 @@ declare class Game implements Activity {
1556
1556
  */
1557
1557
  resolveGameBaseUrls(game: Game): Promise<GameBaseUrls>;
1558
1558
  private configureI18n;
1559
+ private waitForErudaInitialization;
1559
1560
  initialize(): Promise<void>;
1560
1561
  /**
1561
1562
  * Returns the manifest, if manifest.json was created during the build.
@@ -3665,6 +3666,8 @@ declare class Constants {
3665
3666
  /** Placeholder that will be populated during the build process. */
3666
3667
  static readonly MODULE_METADATA_PLACEHOLDER: ModuleMetadata;
3667
3668
  static readonly DEFAULT_ROOT_ELEMENT_ID = "m2c2kit";
3669
+ static readonly ERUDA_URL = "https://cdn.jsdelivr.net/npm/eruda@3.2.3/eruda.js";
3670
+ static readonly ERUDA_SRI = "sha384-KlRzgy/c+nZSV+eiFqoTkkbZ5pUqToho7HsNuebTbOsYTh4m0m/PAqkGsTMLXK14";
3668
3671
  }
3669
3672
 
3670
3673
  /**
@@ -3840,6 +3843,48 @@ declare class M2c2KitHelpers {
3840
3843
  * "https://", "file://", etc.)
3841
3844
  */
3842
3845
  static urlHasScheme(url: string): boolean;
3846
+ /**
3847
+ * Converts a value to a JSON schema type or one of types.
3848
+ *
3849
+ * @remarks The value can be of the target type, or a string that can be
3850
+ * parsed into the target type. For example, a string `"3"` can be converted
3851
+ * to a number, and a string `'{ "color" : "red" }'` can be converted to an
3852
+ * object. If the target type if an object or array, the value can be a
3853
+ * string parsable into the target type: this string can be the string
3854
+ * representation of the object or array, or the URI encoded string.
3855
+ * Throws an error if the value cannot be converted to the type or one of the
3856
+ * types. Converting an object, null, or array to a string is often not the
3857
+ * desired behavior, so a warning is logged if this occurs.
3858
+ *
3859
+ * @param value - the value to convert
3860
+ * @param type - A JSON Schema type or types to convert the value to, e.g.,
3861
+ * "string" or ["string", "null"]
3862
+ * @returns the converted value
3863
+ */
3864
+ static convertValueToType(value: string | number | boolean | Array<unknown> | object | null, type: JsonSchemaDataType | JsonSchemaDataType[] | undefined): unknown;
3865
+ /**
3866
+ * Load scripts from URLs.
3867
+ *
3868
+ * @remarks This is for debugging purposes only. If this is unwanted, it
3869
+ * can be disabled on the server side with an appropriate Content
3870
+ * Security Policy (CSP) header.
3871
+ *
3872
+ * @param urls - URLs with scripts to load
3873
+ */
3874
+ static loadScriptUrls(urls: string[]): void;
3875
+ /**
3876
+ * Loads eruda from a CDN and initializes it.
3877
+ *
3878
+ * @remarks This is for debugging purposes only. If this is unwanted, it
3879
+ * can be disabled on the server side with an appropriate Content
3880
+ * Security Policy (CSP) header.
3881
+ * eruda is a dev console overlay for mobile web browsers and web views.
3882
+ * see https://github.com/liriliri/eruda
3883
+ *
3884
+ * @param pollingIntervalMs - milliseconds between each attempt
3885
+ * @param maxAttempts - how many attempts to make
3886
+ */
3887
+ static loadEruda(pollingIntervalMs?: number, maxAttempts?: number): void;
3843
3888
  /**
3844
3889
  * Registers a `M2Node` class with the global class registry.
3845
3890
  *
@@ -4048,6 +4093,9 @@ interface GlobalVariables {
4048
4093
  rootScale: number;
4049
4094
  canvasCssWidth: number;
4050
4095
  canvasCssHeight: number;
4096
+ erudaRequested?: boolean;
4097
+ erudaInitialized?: boolean;
4098
+ addedScriptUrls: string[];
4051
4099
  /**
4052
4100
  * A dictionary of all `M2Node` classes that have been registered.
4053
4101
  * This is used to instantiate `M2Node` objects from their class name.