function withHighEntropyData(userAgentData, highEntropyData) {
  return /** @type {!NavigatorUAData} */ (Object.freeze({
    ...userAgentData,
    getHighEntropyValues: (hints) => {
      const result = {};
      for (const hint of hints) {
        if (/** @type {*} */ (highEntropyData)[hint] === undefined) {
          return Promise.reject(
              new Error(`High-entropy value not available: ${hint}`));
        } else {
          result[hint] = /** @type {*} */ (highEntropyData)[hint];
        }
      }
      return Promise.resolve(result);
    }
  }));
}
Returns a copy of the specified userAgentData object with functional
getHighEntropyValues that return the specified high-entropy values.
@param {!NavigatorUAData} userAgentData The userAgentData whose synchronously
    available values should be present on the return value.
@param {!PartialUADataValues} highEntropyData The values that should be
    returned when high-entropy values are requested. If a value is missing,
    getHighEntropyValues will return a rejected Promise if that value is
    requested.
@return {!NavigatorUAData}