LibWeb/IDB: Implement IDBIndex::count

This commit is contained in:
stelar7 2025-05-13 22:54:08 +02:00 committed by Jelle Raaijmakers
commit 852323009f
Notes: github-actions[bot] 2025-05-14 15:19:13 +00:00
7 changed files with 54 additions and 4 deletions

View file

@ -18,6 +18,7 @@
namespace Web::IndexedDB {
using KeyPath = Variant<String, Vector<String>>;
using RecordSource = Variant<GC::Ref<ObjectStore>, GC::Ref<Index>>;
WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&, StorageAPI::StorageKey, String, Optional<u64>, GC::Ref<IDBRequest>);
bool fire_a_version_change_event(JS::Realm&, FlyString const&, GC::Ref<DOM::EventTarget>, u64, Optional<u64>);
@ -44,7 +45,7 @@ void inject_a_key_into_a_value_using_a_key_path(JS::Realm&, JS::Value, GC::Ref<K
JS::Value delete_records_from_an_object_store(GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>);
WebIDL::ExceptionOr<GC::Ptr<Key>> store_a_record_into_an_object_store(JS::Realm&, GC::Ref<ObjectStore>, JS::Value, GC::Ptr<Key>, bool);
WebIDL::ExceptionOr<GC::Ref<IDBKeyRange>> convert_a_value_to_a_key_range(JS::Realm&, Optional<JS::Value>, bool = false);
JS::Value count_the_records_in_a_range(GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>);
JS::Value count_the_records_in_a_range(RecordSource, GC::Ref<IDBKeyRange>);
WebIDL::ExceptionOr<JS::Value> retrieve_a_value_from_an_object_store(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>);
GC::Ptr<IDBCursor> iterate_a_cursor(JS::Realm&, GC::Ref<IDBCursor>, GC::Ptr<Key> = nullptr, GC::Ptr<Key> = nullptr, u64 = 1);
JS::Value clear_an_object_store(GC::Ref<ObjectStore>);