pub mod config;
pub mod error;
pub mod query;
pub mod task;
#[cfg(feature = "hast")]
pub use reflexo_typst2hast::hast;
pub use concepts::*;
pub use error::{CompileReport, CompileReportMsg};
pub use reflexo::time;
pub use time::Time;
pub use tinymist_world as world;
pub use tinymist_world::vfs;
pub use world::font;
pub use world::package;
pub use world::parser;
pub use world::*;
pub use exporter::DynComputation;
pub use reflexo::typst_shim as compat;
pub use reflexo::*;
pub use reflexo_typst2vec as vector;
pub use reflexo_typst2vec::{debug_loc, hash};
#[cfg(feature = "ast")]
pub use exporter::ast::{dump_ast, AstExport, ExportAstTask};
#[cfg(feature = "svg")]
#[cfg(feature = "dynamic-layout")]
pub use exporter::dyn_svg::*;
#[cfg(feature = "html")]
pub use exporter::html::*;
#[cfg(feature = "svg")]
pub use exporter::svg::*;
pub use exporter::text::TextExport;
#[cfg(feature = "svg")]
pub use reflexo_vec2svg as svg;
pub use tinymist_task::compute::*;
#[cfg(feature = "system-watch")]
pub use compile::*;
pub use diag::DiagnosticFormat;
#[cfg(feature = "system-compile")]
pub use driver::*;
#[cfg(feature = "system-watch")]
pub use watch::*;
pub use ::typst::{Feature, Features};
#[cfg(feature = "system-compile")]
pub type DynSystemComputation = DynComputation<SystemCompilerFeat>;
#[cfg(feature = "system-watch")]
mod compile;
mod concepts;
#[cfg(feature = "system-compile")]
mod driver;
mod exporter;
mod utils;
#[cfg(feature = "system-watch")]
mod watch;
use ::typst::foundations::Content;
use ::typst::{
diag::{At, SourceResult},
syntax::Span,
};
use query::retrieve;
pub mod build_info {
pub static VERSION: &str = env!("CARGO_PKG_VERSION");
}
pub mod program_meta {
pub const REPORT_BUG_MESSAGE: &str =
"This is a bug, please report to https://github.com/Myriad-Dreamin/typst.ts/issues/new";
}
pub mod diag {
#[cfg(feature = "system-compile")]
pub use tinymist_world::system::print_diagnostics;
pub use tinymist_world::DiagnosticFormat;
}
pub trait CompilerExt<F: CompilerFeat> {
fn world(&self) -> &CompilerWorld<F>;
fn must_main_id(&self) -> TypstFileId {
self.world().main()
}
fn query(&self, selector: String, document: &TypstDocument) -> SourceResult<Vec<Content>> {
retrieve(&self.world(), &selector, document).at(Span::detached())
}
}
impl<F: CompilerFeat> CompilerExt<F> for WorldComputeGraph<F> {
fn world(&self) -> &CompilerWorld<F> {
&self.snap.world
}
}
#[cfg(test)]
mod tests {
#[test]
pub fn test_hash128() {
assert_eq!(typst::utils::hash128(&0u32), reflexo::hash::hash128(&0u32));
}
}