chromium/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.idl

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

typedef (USVString or FencedFrameConfig) SharedStorageResponse;

[
  RuntimeEnabled=SharedStorageAPI,
  Exposed=(Window)
] interface SharedStorageWorklet {
  [
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_AddModule_Method
  ] Promise<undefined> addModule(USVString moduleURL, optional WorkletOptions options = {});

  [
    RuntimeEnabled=SharedStorageAPIM125,
    Exposed=Window,
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_SelectURL_Method
  ] Promise<SharedStorageResponse> selectURL(DOMString name,
                                 sequence<SharedStorageUrlWithMetadata> urls,
                                 optional SharedStorageRunOperationMethodOptions options);

  [
    RuntimeEnabled=SharedStorageAPIM125,
    Exposed=Window,
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_Run_Method
  ] Promise<any> run(DOMString name, optional SharedStorageRunOperationMethodOptions options);
};