script_bindings/
import.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5pub(crate) mod base {
6    pub(crate) use std::ptr;
7    pub(crate) use std::rc::Rc;
8
9    pub(crate) use js::conversions::{
10        ConversionBehavior, ConversionResult, FromJSValConvertible, ToJSValConvertible,
11    };
12    pub(crate) use js::error::throw_type_error;
13    pub(crate) use js::jsapi::{
14        HandleValue as RawHandleValue, HandleValueArray, Heap, IsCallable, JS_NewObject, JSContext,
15        JSObject,
16    };
17    pub(crate) use js::jsval::{JSVal, NullValue, ObjectOrNullValue, ObjectValue, UndefinedValue};
18    pub(crate) use js::panic::maybe_resume_unwind;
19    pub(crate) use js::rust::wrappers::Call;
20    pub(crate) use js::rust::{HandleObject, HandleValue, MutableHandleObject, MutableHandleValue};
21    pub(crate) use js::typedarray::{
22        ArrayBuffer, ArrayBufferView, Float32Array, Float64Array, Uint8Array, Uint8ClampedArray,
23    };
24
25    pub(crate) use crate::callback::{
26        CallSetup, CallbackContainer, CallbackFunction, CallbackInterface, CallbackObject,
27        ExceptionHandling, ThisReflector, wrap_call_this_value,
28    };
29    pub(crate) use crate::codegen::DomTypes::DomTypes;
30    pub(crate) use crate::codegen::GenericUnionTypes;
31    pub(crate) use crate::conversions::{StringificationBehavior, root_from_handlevalue};
32    pub(crate) use crate::error::Error::JSFailed;
33    pub(crate) use crate::error::Fallible;
34    pub(crate) use crate::interfaces::*;
35    pub(crate) use crate::lock::ThreadUnsafeOnceLock;
36    pub(crate) use crate::num::Finite;
37    pub(crate) use crate::proxyhandler::CrossOriginProperties;
38    pub(crate) use crate::reflector::{DomGlobalGeneric, DomObject};
39    pub(crate) use crate::root::DomRoot;
40    pub(crate) use crate::script_runtime::{CanGc, JSContext as SafeJSContext};
41    pub(crate) use crate::str::{ByteString, DOMString, USVString};
42    pub(crate) use crate::trace::RootedTraceableBox;
43    pub(crate) use crate::utils::{get_dictionary_property, set_dictionary_property};
44}
45
46pub(crate) mod module {
47    pub(crate) use std::cmp;
48    pub(crate) use std::ffi::CString;
49    pub(crate) use std::ptr::NonNull;
50
51    pub(crate) use js::conversions::ToJSValConvertible;
52    pub(crate) use js::glue::{
53        CreateProxyHandler, GetProxyReservedSlot, JS_GetReservedSlot, ProxyTraps,
54        SetProxyReservedSlot,
55    };
56    pub(crate) use js::jsapi::{
57        __BindgenBitfieldUnit, CallArgs, GCContext, GetRealmErrorPrototype,
58        GetRealmFunctionPrototype, GetRealmIteratorPrototype, GetRealmObjectPrototype,
59        GetWellKnownSymbol, Handle as RawHandle, HandleId as RawHandleId,
60        HandleObject as RawHandleObject, JS_AtomizeAndPinString, JS_ForwardGetPropertyTo,
61        JS_GetPropertyDescriptorById, JS_HasPropertyById, JS_NewPlainObject, JS_SetReservedSlot,
62        JSAutoRealm, JSCLASS_FOREGROUND_FINALIZE, JSCLASS_RESERVED_SLOTS_SHIFT, JSClass,
63        JSClassOps, JSFunctionSpec, JSITER_HIDDEN, JSITER_OWNONLY, JSITER_SYMBOLS,
64        JSJitGetterCallArgs, JSJitInfo, JSJitInfo__bindgen_ty_1, JSJitInfo__bindgen_ty_2,
65        JSJitInfo__bindgen_ty_3, JSJitInfo_AliasSet, JSJitInfo_ArgType, JSJitInfo_OpType,
66        JSJitMethodCallArgs, JSJitSetterCallArgs, JSNativeWrapper, JSPROP_ENUMERATE,
67        JSPROP_PERMANENT, JSPROP_READONLY, JSPropertySpec, JSPropertySpec_Accessor,
68        JSPropertySpec_AccessorsOrValue, JSPropertySpec_AccessorsOrValue_Accessors,
69        JSPropertySpec_Kind, JSPropertySpec_Name, JSPropertySpec_ValueWrapper,
70        JSPropertySpec_ValueWrapper__bindgen_ty_1, JSPropertySpec_ValueWrapper_Type, JSTracer,
71        JSTypedMethodJitInfo, JSValueType, MutableHandle as RawMutableHandle,
72        MutableHandleIdVector as RawMutableHandleIdVector,
73        MutableHandleObject as RawMutableHandleObject, MutableHandleValue as RawMutableHandleValue,
74        ObjectOpResult, PropertyDescriptor, SymbolCode, UndefinedHandleValue, jsid,
75    };
76    pub(crate) use js::jsval::PrivateValue;
77    pub(crate) use js::panic::wrap_panic;
78    pub(crate) use js::rust::wrappers::{
79        AppendToIdVector, Call, GetPropertyKeys, JS_CopyOwnPropertiesAndPrivateFields,
80        JS_DefineProperty, JS_DefinePropertyById2, JS_GetProperty,
81        JS_InitializePropertiesFromCompatibleNativeObject, JS_NewObjectWithGivenProto,
82        JS_NewObjectWithoutMetadata, JS_SetImmutablePrototype, JS_SetProperty, JS_SetPrototype,
83        JS_WrapObject, NewProxyObject, RUST_INTERNED_STRING_TO_JSID, RUST_SYMBOL_TO_JSID,
84        int_to_jsid,
85    };
86    pub(crate) use js::rust::{
87        CustomAutoRooterGuard, GCMethods, Handle, MutableHandle, get_context_realm,
88        get_object_class, get_object_realm,
89    };
90    pub(crate) use js::{
91        JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL,
92        JSCLASS_RESERVED_SLOTS_MASK, typedarray,
93    };
94    pub(crate) use servo_config::pref;
95
96    pub(crate) use super::base::*;
97    pub(crate) use crate::codegen::Globals::Globals;
98    pub(crate) use crate::codegen::{PrototypeList, RegisterBindings};
99    pub(crate) use crate::constant::{ConstantSpec, ConstantVal};
100    pub(crate) use crate::constructor::call_default_constructor;
101    pub(crate) use crate::conversions::{
102        DOM_OBJECT_SLOT, StringificationBehavior, is_array_like, jsid_to_string,
103        native_from_handlevalue, native_from_object_static,
104    };
105    pub(crate) use crate::error::{Error, ErrorResult};
106    pub(crate) use crate::finalize::{
107        finalize_common, finalize_global, finalize_weak_referenceable,
108    };
109    pub(crate) use crate::guard::{Condition, Guard};
110    pub(crate) use crate::inheritance::Castable;
111    pub(crate) use crate::interface::{
112        ConstructorClassHook, InterfaceConstructorBehavior, NonCallbackInterfaceObjectClass,
113        ProtoOrIfaceIndex, create_callback_interface_object, create_global_object,
114        create_interface_prototype_object, create_named_constructors,
115        create_noncallback_interface_object, define_dom_interface, define_guarded_methods,
116        define_guarded_properties, get_per_interface_object_handle, is_exposed_in,
117    };
118    pub(crate) use crate::iterable::{Iterable, IterableIterator, IteratorType};
119    pub(crate) use crate::like::{Maplike, Setlike};
120    pub(crate) use crate::mem::malloc_size_of_including_raw_self;
121    pub(crate) use crate::namespace::{NamespaceObjectClass, create_namespace_object};
122    pub(crate) use crate::proxyhandler::{
123        ensure_expando_object, get_expando_object, set_property_descriptor,
124    };
125    pub(crate) use crate::realms::{AlreadyInRealm, InRealm};
126    pub(crate) use crate::root::{Dom, DomSlice, MaybeUnreflectedDom, Root};
127    pub(crate) use crate::script_runtime::CanGc;
128    pub(crate) use crate::utils::{
129        AsVoidPtr, DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, DOMClass, DOMJSClass, JSCLASS_DOM_GLOBAL,
130        ProtoOrIfaceArray, enumerate_global, enumerate_window, exception_to_promise,
131        generic_getter, generic_lenient_getter, generic_lenient_setter, generic_method,
132        generic_setter, generic_static_promise_method, get_array_index_from_id,
133        get_property_on_prototype, has_property_on_prototype, may_resolve_global,
134        may_resolve_window, resolve_global, resolve_window, trace_global,
135    };
136    pub(crate) use crate::weakref::DOM_WEAK_SLOT;
137    pub(crate) use crate::{JSTraceable, proxyhandler};
138}