Skip to main content

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    #[allow(unused_imports)]
10    pub(crate) use js::context::{JSContext, NoGC, RawJSContext};
11    pub(crate) use js::conversions::{
12        ConversionBehavior, ConversionResult, FromJSValConvertible, ToJSValConvertible,
13    };
14    pub(crate) use js::error::throw_type_error;
15    pub(crate) use js::gc::RootedVec;
16    pub(crate) use js::jsapi::{
17        CheckedUnwrapStatic, GetNonCCWObjectGlobal, HandleValue as RawHandleValue,
18        HandleValueArray, Heap, IsCallable, JSObject, Value,
19    };
20    pub(crate) use js::jsval::{JSVal, NullValue, ObjectOrNullValue, ObjectValue, UndefinedValue};
21    pub(crate) use js::panic::maybe_resume_unwind;
22    #[allow(unused_imports)]
23    pub(crate) use js::realm::{AutoRealm, CurrentRealm};
24    pub(crate) use js::rust::wrappers2::{Call, GetArrayLength, JS_GetElement, JS_SetElement};
25    pub(crate) use js::rust::{
26        HandleObject, HandleValue, MutableHandle, MutableHandleObject, MutableHandleValue,
27    };
28    pub(crate) use js::typedarray;
29    pub(crate) use js::typedarray::{
30        HeapArrayBuffer, HeapArrayBufferView, HeapFloat32Array, HeapFloat64Array, HeapUint8Array,
31        HeapUint8ClampedArray,
32    };
33
34    pub(crate) use crate::callback::{
35        CallbackContainer, CallbackFunction, CallbackInterface, CallbackObject, ExceptionHandling,
36        HasCallbackHolder, OwnerWindow, RootedCallback, ThisReflector, TracedCallback, call_setup,
37        create_callback_rooted, wrap_call_this_value,
38    };
39    pub(crate) use crate::codegen::DomTypes::DomTypes;
40    pub(crate) use crate::codegen::GenericUnionTypes;
41    pub(crate) use crate::conversions::{StringificationBehavior, root_from_handlevalue};
42    pub(crate) use crate::error::Error::JSFailed;
43    pub(crate) use crate::error::Fallible;
44    pub(crate) use crate::interfaces::*;
45    pub(crate) use crate::js::JS_NewObject;
46    pub(crate) use crate::lock::ThreadUnsafeOnceLock;
47    pub(crate) use crate::num::Finite;
48    pub(crate) use crate::proxyhandler::{CrossOriginProperties, is_platform_object_same_origin};
49    pub(crate) use crate::reflector::DomObject;
50    pub(crate) use crate::root::DomRoot;
51    pub(crate) use crate::str::{ByteString, DOMString, USVString};
52    pub(crate) use crate::trace::RootedTraceableBox;
53    pub(crate) use crate::utils::{get_dictionary_property, set_dictionary_property};
54}
55
56pub(crate) mod module {
57    pub(crate) use std::cmp;
58    pub(crate) use std::ptr::NonNull;
59
60    pub(crate) use js::conversions::ToJSValConvertible;
61    pub(crate) use js::glue::{
62        CreateProxyHandler, GetProxyReservedSlot, JS_GetReservedSlot, ProxyTraps,
63    };
64    pub(crate) use js::jsapi::{
65        __BindgenBitfieldUnit, CallArgs, GCContext, Handle as RawHandle, HandleId as RawHandleId,
66        HandleObject as RawHandleObject, HandleValueArray, JS_SetReservedSlot,
67        JSCLASS_FOREGROUND_FINALIZE, JSCLASS_RESERVED_SLOTS_SHIFT, JSClass, JSClassOps,
68        JSFunctionSpec, JSJitGetterCallArgs, JSJitInfo, JSJitInfo__bindgen_ty_1,
69        JSJitInfo__bindgen_ty_2, JSJitInfo__bindgen_ty_3, JSJitInfo_AliasSet, JSJitInfo_ArgType,
70        JSJitInfo_OpType, JSJitMethodCallArgs, JSJitSetterCallArgs, JSNativeWrapper,
71        JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY, JSPropertySpec,
72        JSPropertySpec_Accessor, JSPropertySpec_AccessorsOrValue,
73        JSPropertySpec_AccessorsOrValue_Accessors, JSPropertySpec_Kind, JSPropertySpec_Name,
74        JSPropertySpec_ValueWrapper, JSPropertySpec_ValueWrapper__bindgen_ty_1,
75        JSPropertySpec_ValueWrapper_Type, JSTracer, JSTypedMethodJitInfo, JSValueType,
76        MutableHandle as RawMutableHandle, MutableHandleIdVector as RawMutableHandleIdVector,
77        MutableHandleObject as RawMutableHandleObject, MutableHandleValue as RawMutableHandleValue,
78        ObjectOpResult, PropertyDescriptor, SymbolCode, jsid,
79    };
80    pub(crate) use js::panic::wrap_panic;
81    pub(crate) use js::rust::wrappers2::{
82        Call, GetRealmFunctionPrototype, GetWellKnownSymbol, JS_DefinePropertyById2,
83        JS_ForwardGetPropertyTo, JS_GetPropertyDescriptorById, JS_HasPropertyById,
84        JS_NewObjectWithoutMetadata, JS_NewPlainObject, JS_SetImmutablePrototype, JS_SetProperty,
85        JS_SetPrototype, RUST_SYMBOL_TO_JSID,
86    };
87    pub(crate) use js::rust::{CustomAutoRooterGuard, GCMethods, Handle, MutableHandle};
88    pub(crate) use js::{
89        JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_GLOBAL, JSCLASS_RESERVED_SLOTS_MASK,
90        typedarray,
91    };
92    pub(crate) use servo_config::pref;
93
94    pub(crate) use super::base::*;
95    pub(crate) use crate::codegen::Globals::Globals;
96    pub(crate) use crate::codegen::{PrototypeList, RegisterBindings};
97    pub(crate) use crate::constant::{ConstantSpec, ConstantVal};
98    pub(crate) use crate::constructor::{
99        CallbackInit, InitType, InterfaceInit, NamespaceInit, call_default_constructor,
100        create_callback_interface_objects, create_interface, create_namespace_interface_objects,
101    };
102    #[cfg(feature = "testbinding")]
103    pub(crate) use crate::conversions::native_from_handlevalue;
104    pub(crate) use crate::conversions::{
105        StringificationBehavior, is_array_like, jsid_to_string, native_from_object_static,
106    };
107    pub(crate) use crate::error::{Error, ErrorResult};
108    pub(crate) use crate::finalize::{
109        finalize_common, finalize_global, finalize_weak_referenceable,
110    };
111    pub(crate) use crate::guard::{Condition, Guard};
112    pub(crate) use crate::inheritance::Castable;
113    pub(crate) use crate::interface::{
114        ConstructorClassHook, InterfaceConstructorBehavior, NonCallbackInterfaceObjectClass,
115        ProtoOrIfaceIndex, create_global_object, create_named_constructors,
116        create_noncallback_interface_object, define_dom_interface, define_guarded_methods,
117        define_guarded_properties, get_per_interface_object_handle, is_exposed_in,
118    };
119    pub(crate) use crate::iterable::{Iterable, IterableIterator, IteratorType};
120    pub(crate) use crate::js::{JS_DefineProperty, JS_GetProperty, PropertyFlags};
121    pub(crate) use crate::like::{Maplike, Setlike};
122    pub(crate) use crate::mem::malloc_size_of_including_raw_self;
123    pub(crate) use crate::namespace::NamespaceObjectClass;
124    pub(crate) use crate::proxyhandler::{get_expando_object, set_property_descriptor};
125    #[cfg(feature = "testbinding")]
126    pub(crate) use crate::root::{Dom, DomSlice};
127    pub(crate) use crate::root::{MaybeUnreflectedDom, Root};
128    pub(crate) use crate::utils::{
129        DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, DOMClass, DOMJSClass, JSCLASS_DOM_GLOBAL,
130        ProtoOrIfaceArray, call_policies, enumerate_global, enumerate_window, exception_to_promise,
131        generic_getter, generic_method, generic_setter, generic_static_promise_method,
132        get_array_index_from_id, get_property_on_prototype, has_property_on_prototype,
133        may_resolve_global, may_resolve_window, resolve_global, resolve_window, trace_global,
134    };
135    pub(crate) use crate::{JSTraceable, proxyhandler};
136}