Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated IDL and related info as per DOCS-658

...

Code Block
languagejs
titleassetrealizer IDL
collapsetrue
[
    GarbageCollected
] interface AssetRealizer {
    AssetPoolFetcherconstructor(AssetPool pool, DOMStringString pathdestinationPath);
    Promise<unsigned long Promise<long>long> estimateRealizedSize(AssetList assets);
    Promise<FailureReason>Promise<void> realize(AssetList assets);
    Promise<DOMStringList>Promise<Array<ValidationResult>> validateFiles(AssetList assets, DOMStringListStringList options);
};

interface FailureReasonValidationResult {
    attribute DOMStringString name;
    attribute bool ok;
    attribute DOMString String reason;
};

Object Creation

...

estimateRealizedSize()
Code Block
languagejs
Promise<long>Promise<unsigned long long> estimateRealizedSize(AssetList assets)

...

realize()
Code Block
languagejs
Promise<FailureReason>Promise<void> realize(AssetList assets)

...

validateFiles()
Code Block
languagejs
Promise<DOMStringList>Promise<Array<ValidationResult>> validateFiles(AssetList assets, DOMStringListStringList options)

Checks the hash of every file in the spec against the corresponding file in the destination path and returns a string list containing each mismatched file name mapped to the reason. The options parameter is a string list, which can currently support a single option:

  • "deleteCorrupt": Automatically deletes any files that do not match the expected hash. By default, these files are not deleted.

...

ValidationResult

This interface is returned by the realize() method to indicate the results of the realize operation.

  • [DOMStringString] name: The name of the mismatched file (if the realize operation fails)
  • [bool] ok: A flag indicating whether the realize operation succeeded or failed[DOMStringString] reason: An explanation for a failed realize operation. See the roAssetRealizerEvent page for a list of possible reason strings.

...