Previously we were inconsistent by generating code for enum definitions but not generating code for dictionaries. With future changes to the IDL generator to expose helpers to convert to and from IDL values this produced circular depdendencies. To solve this problem, also generate the dictionary definitions in bindings headers.
39 lines
1 KiB
C++
39 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGC/Ptr.h>
|
|
#include <LibWeb/Bindings/IDBVersionChangeEvent.h>
|
|
#include <LibWeb/DOM/Event.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::IndexedDB {
|
|
|
|
// https://w3c.github.io/IndexedDB/#events
|
|
class IDBVersionChangeEvent : public DOM::Event {
|
|
WEB_PLATFORM_OBJECT(IDBVersionChangeEvent, DOM::Event);
|
|
GC_DECLARE_ALLOCATOR(IDBVersionChangeEvent);
|
|
|
|
public:
|
|
virtual ~IDBVersionChangeEvent() override;
|
|
|
|
static GC::Ref<IDBVersionChangeEvent> create(JS::Realm&, FlyString const&, Bindings::IDBVersionChangeEventInit const&);
|
|
|
|
u64 old_version() const { return m_old_version; }
|
|
Optional<u64> new_version() const { return m_new_version; }
|
|
|
|
protected:
|
|
explicit IDBVersionChangeEvent(JS::Realm&, FlyString const& event_name, Bindings::IDBVersionChangeEventInit const& event_init);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
private:
|
|
u64 m_old_version { 0 };
|
|
Optional<u64> m_new_version;
|
|
};
|
|
|
|
}
|