script: Limit public exports. (#34915)

* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-10 03:19:19 -05:00 committed by GitHub
parent f220d6d3a5
commit c94d909a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
585 changed files with 5411 additions and 5013 deletions

View file

@ -18,7 +18,7 @@ use crate::dom::xrsession::{cast_transform, ApiPose, XRSession};
use crate::script_runtime::CanGc;
#[dom_struct]
pub struct XRSpace {
pub(crate) struct XRSpace {
eventtarget: EventTarget,
session: Dom<XRSession>,
input_source: MutNullableDom<XRInputSource>,
@ -27,7 +27,7 @@ pub struct XRSpace {
}
impl XRSpace {
pub fn new_inherited(session: &XRSession) -> XRSpace {
pub(crate) fn new_inherited(session: &XRSession) -> XRSpace {
XRSpace {
eventtarget: EventTarget::new_inherited(),
session: Dom::from_ref(session),
@ -49,7 +49,7 @@ impl XRSpace {
}
}
pub fn new_inputspace(
pub(crate) fn new_inputspace(
global: &GlobalScope,
session: &XRSession,
input: &XRInputSource,
@ -62,7 +62,7 @@ impl XRSpace {
)
}
pub fn space(&self) -> Space {
pub(crate) fn space(&self) -> Space {
if let Some(rs) = self.downcast::<XRReferenceSpace>() {
rs.space()
} else if let Some(j) = self.downcast::<XRJointSpace>() {
@ -89,7 +89,7 @@ impl XRSpace {
/// The reference origin used is common between all
/// get_pose calls for spaces from the same device, so this can be used to compare
/// with other spaces
pub fn get_pose(&self, base_pose: &Frame) -> Option<ApiPose> {
pub(crate) fn get_pose(&self, base_pose: &Frame) -> Option<ApiPose> {
if let Some(reference) = self.downcast::<XRReferenceSpace>() {
reference.get_pose(base_pose)
} else if let Some(joint) = self.downcast::<XRJointSpace>() {
@ -116,7 +116,7 @@ impl XRSpace {
}
}
pub fn session(&self) -> &XRSession {
pub(crate) fn session(&self) -> &XRSession {
&self.session
}
}