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

// The Shared Storage API.
// https://github.com/pythagoraskitty/shared-storage/blob/main/README.md

[
  RuntimeEnabled=SharedStorageAPI,
  Exposed=(Window, SharedStorageWorklet)
] interface SharedStorage {
  [Exposed=SharedStorageWorklet] async iterable<DOMString, DOMString>;

  [
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_Set_Method
  ] Promise<any> set(DOMString key, DOMString value, optional SharedStorageSetMethodOptions options);

  [
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_Append_Method
  ] Promise<any> append(DOMString key, DOMString value);

  [
    CallWith=ScriptState,
    ImplementedAs=Delete,
    RaisesException,
    MeasureAs=SharedStorageAPI_Delete_Method
  ] Promise<any> delete(DOMString key);

  [
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_Clear_Method
  ] Promise<any> clear();

  [
    CallWith=ScriptState,
    RaisesException
  ] Promise<DOMString> get(DOMString key);

  [
    Exposed=SharedStorageWorklet,
    CallWith=ScriptState,
    RaisesException
  ] Promise<unsigned long> length();

  [
    Exposed=SharedStorageWorklet,
    CallWith=ScriptState,
    RaisesException
  ] Promise<double> remainingBudget();

  [
    Exposed=SharedStorageWorklet,
    CallWith=ScriptState,
    RaisesException
  ] readonly attribute any context;

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

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

  [
    RuntimeEnabled=SharedStorageAPIM125,
    Exposed=Window,
    CallWith=ScriptState,
    RaisesException,
    MeasureAs=SharedStorageAPI_CreateWorklet_Method
  ] Promise<SharedStorageWorklet> createWorklet(USVString moduleURL,
                                                optional SharedStorageWorkletOptions options = {});

  [
    Exposed=Window,
    CallWith=ScriptState,
    RaisesException
  ] readonly attribute SharedStorageWorklet worklet;
};