| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, Shannon Booth <shannon@serenityos.org> | 
					
						
							| 
									
										
										
										
											2025-03-13 10:10:49 +01:00
										 |  |  |  * Copyright (c) 2024-2025, stelar7 <dudedbz@gmail.com> | 
					
						
							| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 10:10:49 +01:00
										 |  |  | #include <LibJS/Runtime/PromiseCapability.h>
 | 
					
						
							| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							| 
									
										
										
										
											2024-11-04 18:19:19 +01:00
										 |  |  | #include <LibWeb/IndexedDB/IDBOpenDBRequest.h>
 | 
					
						
							| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::IndexedDB { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://w3c.github.io/IndexedDB/#idbfactory
 | 
					
						
							|  |  |  | class IDBFactory : public Bindings::PlatformObject { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(IDBFactory, Bindings::PlatformObject); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(IDBFactory); | 
					
						
							| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual ~IDBFactory() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     WebIDL::ExceptionOr<GC::Ref<IDBOpenDBRequest>> open(String const& name, Optional<u64> version); | 
					
						
							| 
									
										
										
										
											2024-12-01 21:12:35 +01:00
										 |  |  |     WebIDL::ExceptionOr<GC::Ref<IDBOpenDBRequest>> delete_database(String const& name); | 
					
						
							| 
									
										
										
										
											2025-03-13 10:10:49 +01:00
										 |  |  |     GC::Ref<WebIDL::Promise> databases(); | 
					
						
							| 
									
										
										
										
											2024-12-01 21:12:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-11 10:49:44 +01:00
										 |  |  |     WebIDL::ExceptionOr<i8> cmp(JS::Value first, JS::Value second); | 
					
						
							| 
									
										
										
										
											2024-11-04 18:19:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-19 17:58:06 +12:00
										 |  |  | protected: | 
					
						
							|  |  |  |     explicit IDBFactory(JS::Realm&); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |