/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { CloneableStorage, StorageDriver } from "./StorageDriver.js";
class StorageDriverHandle extends StorageDriver {
  #driver;
  #release;
  clone;
  constructor(driver, release) {
    super();
    this.#driver = driver;
    this.#release = release;
    if (CloneableStorage.is(driver)) {
      this.clone = () => driver.clone();
    }
  }
  get id() {
    return this.#driver.id;
  }
  get initialized() {
    return this.#driver.initialized;
  }
  initialize() {
  }
  close() {
    return this.#release();
  }
  get(contexts, key) {
    return this.#driver.get(contexts, key);
  }
  set(contexts, keyOrValues, value) {
    if (typeof keyOrValues === "string") {
      return this.#driver.set(contexts, keyOrValues, value);
    }
    return this.#driver.set(contexts, keyOrValues);
  }
  delete(contexts, key) {
    return this.#driver.delete(contexts, key);
  }
  keys(contexts) {
    return this.#driver.keys(contexts);
  }
  values(contexts) {
    return this.#driver.values(contexts);
  }
  contexts(contexts) {
    return this.#driver.contexts(contexts);
  }
  clearAll(contexts) {
    return this.#driver.clearAll(contexts);
  }
  has(contexts, key) {
    return this.#driver.has(contexts, key);
  }
  begin() {
    return this.#driver.begin();
  }
}
export {
  StorageDriverHandle
};
//# sourceMappingURL=StorageDriverHandle.js.map
