/* * Copyright (c) 2024, stelar7 * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace Web::IndexedDB { using KeyPath = Variant>; WebIDL::ExceptionOr> open_a_database_connection(JS::Realm&, StorageAPI::StorageKey, String, Optional, GC::Ref); bool fire_a_version_change_event(JS::Realm&, FlyString const&, GC::Ref, u64, Optional); WebIDL::ExceptionOr> convert_a_value_to_a_key(JS::Realm&, JS::Value, Vector = {}); void close_a_database_connection(GC::Ref, bool forced = false); GC::Ref upgrade_a_database(JS::Realm&, GC::Ref, u64, GC::Ref); WebIDL::ExceptionOr delete_a_database(JS::Realm&, StorageAPI::StorageKey, String, GC::Ref); void abort_a_transaction(GC::Ref, GC::Ptr); JS::Value convert_a_key_to_a_value(JS::Realm&, GC::Ref); bool is_valid_key_path(KeyPath const&); GC::Ref create_a_sorted_name_list(JS::Realm&, Vector); void commit_a_transaction(JS::Realm&, GC::Ref); WebIDL::ExceptionOr clone_in_realm(JS::Realm&, JS::Value, GC::Ref); WebIDL::ExceptionOr> convert_a_value_to_a_multi_entry_key(JS::Realm&, JS::Value); WebIDL::ExceptionOr> evaluate_key_path_on_a_value(JS::Realm&, JS::Value, KeyPath const&); WebIDL::ExceptionOr>> extract_a_key_from_a_value_using_a_key_path(JS::Realm&, JS::Value, KeyPath const&, bool = false); bool check_that_a_key_could_be_injected_into_a_value(JS::Realm&, JS::Value, KeyPath const&); void fire_an_error_event(JS::Realm&, GC::Ref); void fire_a_success_event(JS::Realm&, GC::Ref); GC::Ref asynchronously_execute_a_request(JS::Realm&, IDBRequestSource, GC::Ref()>>, GC::Ptr = nullptr); ErrorOr generate_a_key(GC::Ref); void possibly_update_the_key_generator(GC::Ref, GC::Ref); void inject_a_key_into_a_value_using_a_key_path(JS::Realm&, JS::Value, GC::Ref, KeyPath const&); void delete_records_from_an_object_store(GC::Ref, GC::Ref); WebIDL::ExceptionOr> store_a_record_into_an_object_store(JS::Realm&, GC::Ref, JS::Value, GC::Ptr, bool); WebIDL::ExceptionOr> convert_a_value_to_a_key_range(JS::Realm&, Optional, bool = false); JS::Value count_the_records_in_a_range(GC::Ref, GC::Ref); WebIDL::ExceptionOr retrieve_a_value_from_an_object_store(JS::Realm&, GC::Ref, GC::Ref); }