Skip to main content

Crate typst_pack

Crate typst_pack 

Source
Expand description

§typst-pack

GitHub Workflow Status OpenSSF Scorecard crates.io docs.rs

Bundle a Typst project and its fonts and packages into one file that can compile on another machine.

A pack (.typk) contains an entrypoint, the project’s source and data files, and the exact package and font requirements found during a representative compile. Packages and fonts can be embedded for offline, portable compilation or recorded as external requirements for the receiving application to supply.

Use the CLI to create, inspect, compile, and extract packs. Use the Rust library to build the same workflows in editors, web services, object-storage systems, and other applications.

This is unrelated to Typst’s bundle output (typst-bundle). A pack is portable input for later compilation, not a collection of rendered output files.

§Features

  • Put a whole Typst project in one .typk file, including images and data.
  • Vendor imported Typst Universe packages so compilation works offline.
  • Embed selected fonts so output does not depend on fonts installed elsewhere.
  • Compile to PDF, PNG, SVG, or experimental HTML without reading ambient project files.
  • Replace a contained project file for one compile without changing the pack.
  • Inspect or extract a pack before using it.
  • Build packs from the filesystem, entirely in memory, or with caller-supplied OpenDAL storage.
  • Keep filesystem access and network download support as separate build choices.

§CLI

Install the command-line tool:

cargo install typst-pack-cli
# Pack a named source file, vendoring all observed packages:
typst-pack create path/to/project/main.typ

# Pack a specific entrypoint, embedding the fonts the document uses:
typst-pack create letter.typ --embed-fonts

# See what a pack contains:
typst-pack inspect project.typk

# Compile a pack without network access:
typst-pack compile project.typk output.pdf

# Replace a contained placeholder for one compilation:
typst-pack compile invoice.typk customer.pdf --override assets/logo.png customer-logo.png

# PNG or SVG output, page selection, reproducible builds:
typst-pack compile project.typk "page-{0p}.png" --ppi 300 --pages 1-3
typst-pack compile project.typk reproducible.pdf --creation-timestamp 1700000000

# Guarantee no network access (fails instead of downloading packages):
typst-pack compile project.typk --offline

# Experimental HTML export:
typst-pack compile project.typk out.html
typst-pack create project/main.typ --target html --features html

# Unpack a pack back into an editable project directory:
typst-pack extract project.typk -o project/

For PNG and SVG output, {p} is the one-based source page number, {0p} and {n} are zero-padded aliases, and {t} is the source-document page count. Multi-page output needs a page placeholder. All output paths are checked for duplicates before anything is written.

See CLI examples for additional create, compile, extraction, and Pack Override commands.

§Project files

create includes every eligible regular file beneath the project root, not only files reached by the representative compile. A root .typkignore uses Gitignore-style ordered rules. It is included in the pack; nested .typkignore files are ordinary files. Symlinks, unsupported entries, and any path containing a .typk component are rejected.

The representative compile selects package and font requirements. Its target, inputs, date, features, and control flow do not change which project files are included. Pack a valid placeholder when a document needs per-recipient data, then replace it with --override PACK_PATH FILE at compile time.

§Packages and fonts

Observed packages are embedded by default. --no-vendor-packages records each exact package and complete tree identity instead; compilation then requires the application’s configured package sources to provide a matching tree. --offline prevents downloads during both creation and compilation.

Fonts are external by default. --embed-fonts stores selected font containers except those shipped by Typst; --include-typst-embedded-fonts stores those as well. Mind font licenses when redistributing embedded files.

§Output formats

PDF and HTML produce one artifact. PNG and SVG produce one artifact for each selected source page. HTML is experimental in Typst. The complete intentional differences from typst compile are listed in the CLI parity inventory.

§Library

The core in-memory packing, creation, and compilation APIs need no crate features. Add filesystem support when the library should read local projects, package directories, and system fonts:

[dependencies]
typst-pack = { version = "0.6", features = ["embedded-fonts", "fs"] }

The fs feature links no network client. Add egress only when filesystem assembly should download missing Typst Universe packages.

The library contract describes identity, dependency fulfillment, environment independence, write policies, retry material, and partial effects. The OpenDAL guide documents asynchronous storage integration.

§Common workflows

Each entry links to a compile-checked example on docs.rs, so the code shown there is verified against the release you are reading about.

TaskStart here
Pack a project directory from diskFilesystemPackAssembler
Pack in-memory bytes with no filesystemPack::builder
Supply packages yourself and resume creationcreate
Swap a contained file for one compilePackOverrideSet
Read and write packs through object storageOpenDAL guide

The shortest complete example — build a pack in memory and encode it:

use typst_pack::Pack;
use typst_pack::pack_archive::encode;

let pack = Pack::builder("main.typ")
    .file("main.typ", b"= Report\n".to_vec())
    .expect("main.typ is a valid project path")
    .build()
    .expect("the entrypoint is contained");

let archive = encode(&pack).expect("the pack fits the reference encode limits");
assert!(!archive.as_slice().is_empty());

Pack::builder does not discover dependencies: the pack contains exactly the files added to it. Use create when the library should run dependency discovery over values the caller already holds, and a Pack Assembler when it should also read those values from a source.

Pack creation is stateless and resumable. If the representative compile reaches a package that is not in the supplied catalog, creation reports that exact specification instead of failing; add its tree and call create again. The package-reading feature provides official registry URL construction and bounded .tar.gz expansion without choosing an HTTP client, and OpenDAL provides read_package and insert_read_package for the same lifecycle over configured operators.

A Pack Override can replace only a project path already contained in the pack. It cannot add a path or change package or font requirements.

§Feature flags

  • fs: Read projects, local packages, caches, and system fonts from the filesystem; unavailable on wasm targets.
  • egress: Download missing packages during filesystem assembly; implies fs and package-reading and links HTTP/TLS dependencies.
  • package-reading: Construct registry URLs, read bounded package archives, and expand them without choosing a transport.
  • opendal: Use caller-polled OpenDAL reads and writes with caller-supplied operators and runtime support.
  • embedded-fonts: Make Typst’s bundled fonts available to assembly and external fulfillment.
  • diagnostics: Retain source context for first-party diagnostic presentation adapters.
  • parallel: Export independent page artifacts in parallel.

All features are opt-in. Featureless creation and compilation remain available on wasm32-unknown-unknown.

§Migrating

§Migrating to 0.6

Version 0.6 standardizes storage vocabulary on read and write. The rename was generated from git diff fb610cb..HEAD; there are no compatibility aliases.

Before 0.60.6
Feature package-acquisitionpackage-reading
Module typst_pack::opendal::publicationtypst_pack::opendal::write
gather_filesystem_projectread_filesystem_project
gather_filesystem_font_catalogread_filesystem_fonts
gather_filesystem_packageread_filesystem_package
FilesystemPackageAuthority::acquireFilesystemPackageAuthority::read
acquire_package_archiveread_package_archive
opendal::pack_assembly::acquire_projectread_project
opendal::pack_assembly::acquire_fontsread_fonts
opendal::pack_assembly::acquire_packageread_package
opendal::pack_archive::acquire_pack_archiveread_pack_archive
opendal::publication::publish_pack_archiveopendal::write::write_pack_archive
publish_package_cache_archivewrite_package_cache_archive
publish_pack_extraction_planwrite_pack_extraction_plan
publish_compilation_artifactswrite_compilation_artifacts
publish_pack_extraction_plan_to_filesystemwrite_pack_extraction_plan_to_filesystem
publish_pack_extraction_plan_to_filesystem_with_fault_probewrite_pack_extraction_plan_to_filesystem_with_fault_probe
publish_compilation_artifacts_to_filesystem_pathswrite_compilation_artifacts_to_filesystem_paths
resolve_filesystem_publication_pathsresolve_filesystem_write_paths
CompilationArtifactPathPublicationError::publication_errorCompilationArtifactPathWriteError::write_error
insert_acquired_packageinsert_read_package
pack_archive::acquire / acquire_filepack_archive::read / read_file
pack_archive::publish / publish_filepack_archive::write / write_file

Type families follow the same mechanical rules:

Before 0.60.6
*Acquisition**Read*
*Publication**Write*
*GatherError*ReadError
Acquired*Read*
PublicationPolicyWritePolicy
PublicationKeyOutcomeWriteKeyOutcome
PackArchiveAcquisitionErrorPackArchiveReadError
ProjectAcquisitionRequestProjectReadRequest
PackageAcquisitionLimitsPackageReadLimits
AcquiredPackageInsertionErrorReadPackageInsertionError
FilesystemPackageAcquisitionErrorFilesystemPackageAuthorityReadError
PackExtractionPublicationProgressPackExtractionWriteProgress
CompilationArtifactPublicationReceiptCompilationArtifactWriteReceipt
FilePublicationPolicyFileWritePolicy

OpenDAL operation errors are no longer generic over an OperatorResolver error type. Resolver failures are retained as boxed sources. Match the operation’s typed cause, then downcast the source to the concrete error supplied by your resolver:

use typst_pack::opendal::pack_assembly::ProjectReadErrorCause;

if let ProjectReadErrorCause::ResolveOperator(source) = error.cause() {
    if let Some(resolver_error) = source.downcast_ref::<MyResolverError>() {
        handle_resolver_error(resolver_error);
    }
}

Compilation and encoding now have convenient reference limits. Use compile(request) and pack_archive::encode(pack) for the built-in profiles; use compile_with_limits, encode_with_limits, write_pack_with_limits, or save_pack_with_limits to narrow them. Limits remain required at trust boundaries, including archive decoding, package expansion, stream/file reads, and filesystem or OpenDAL read requests. Invalid custom limit configurations are programmer errors and panic during construction.

Pack Extraction and Compilation Output Artifact writes now share the crate-root *WriteEntry, *WriteProgress, and *WriteReceipt types across filesystem and OpenDAL adapters. Write errors retain progress where relevant and expose CommitCertainty; successful receipts do not make an atomicity claim.

The request-origin and inventory wrappers were removed: CompilationRequestInventory, TypstInputsInventory, PackOverridesInventory, PackOverrideInventoryEntry, EffectiveRequestValue, RequestValueOrigin, and CompilationOutputOrigins. Configure values directly on PackCompilationRequest. Fulfillment provenance remains available through PackageTreeFulfillment, FontContainerFulfillment, and the fulfillment report; CompilationAccessTrace also remains available on a result.

CanonicalIdentity and CanonicalIdentityRole now implement Display, rendering as role:digest. Equality is unchanged and still covers role, schema, and algorithm, so compare whole identity values rather than the rendered string.

Dependency-fulfillment failures report what is missing. Every CompilationFulfillmentIssue message names the package or font container involved instead of dumping a Debug projection, and InvalidCompilationFulfillmentSet no longer summarizes a single issue as a count. Present these failures through issues(): the aggregate Display is a summary, not the detail.

typst-pack inspect gained a required fonts section listing the external Font Requirements a recipient must supply, and its embedded fonts lines now use the shorter role:digest identity form. typst-pack compile reports each unfulfilled dependency as a hint with the recovery to try.

The egress feature no longer links rustls-pemfile. Custom --cert PEM parsing moved to rustls-pki-types, which absorbed it; behavior is unchanged, including that a file with no PEM section adds no trust anchor.

§Migrating to 0.5

Version 0.5 added the optional OpenDAL adapter. Existing builds that do not enable opendal are unaffected. Applications that enable it must select their own backend, transport, runtime, credentials, and retry behavior. See Migrating to 0.5 for dependency, composition, target, identity, and cache guidance.

§Migrating to 0.4

Version 0.4 made clean breaks without compatibility aliases:

  • Remove Resource Slot and Resource Provider APIs; pack placeholders and replace them with Pack Overrides.
  • Rename Dagger arguments: source -> project, entrypoint -> input, inputs -> sysInputs, noPackages -> noVendorPackages, sourceDateEpoch -> creationTimestamp, and CreationTarget -> TypstTarget.
  • Change creation from a directory plus --entrypoint/--output to create <INPUT> [OUTPUT].
  • Replace compile_pack(request) with compile(request); the arbitrary-World overload and public PackWorld builder are removed.
  • Read accepted compilation results from CompilationReport::outcome() or result(); compile_report, PackCompileError, CompilationAttempt, and CompilationExecutionControls are removed.
  • Replace CreationTarget and CompilationTarget with TypstTarget, and configure time with one DocumentTime.
  • Replace Packer with FilesystemPackAssemblerConfig, FilesystemPackAssembler, and FilesystemPackAssemblyRequest.
  • Read representative-compile warnings from PackAssemblyReport::warnings; PackReport is removed.
  • Inspect domain values through Pack accessors rather than Pack Manifest records.
  • Handle shared Pack consistency failures through PackInvariantError::issues().
  • Replace OutputFormat plus CompileOptions request construction with a CompilationOutputSpecification variant.
  • Replace extract with plan_pack_extraction followed by write_pack_extraction_plan_to_filesystem and an explicit FilesystemMergePolicy.

The unstable Pack format remains version 1, but discovery and Resource Slot fields were removed in place. Old fields and aliases are not accepted.

§Pack format

A pack is a Zip archive, conventionally named *.typk, with this layout:

typst-pack.toml                         manifest
project/<path>                          project files, root-relative
packages/<ns>/<name>/<version>/<path>   embedded package files
fonts/<file>                            embedded font files

Example manifest:

format-version = 1

[project]
entrypoint = "main.typ"

[[packages.vendored]]
spec = "@preview/cetz:0.3.4"
tree-digest = "0123456789abcdef0123456789abcdef"
tree-identity-kind = "complete-package-tree"
tree-identity-schema = "typst-pack-complete-package-tree-v1"
tree-identity-algorithm = "typst-hash128-0.15"
file-count = 12
byte-length = 34567

[[fonts]]
path = "fonts/ibm-plex-sans.ttf"
families = ["IBM Plex Sans"]

[metadata]
name = "Quarterly report"
authors = ["Jane Doe"]

The encoder writes Deflate-compressed version-1 archives. Readers accept safe interoperable ZIP encodings and member orderings, ignore safe unknown entries, and reject unknown format versions, unsafe paths, unsupported entry kinds, and inconsistent manifests. Decoding and re-encoding preserves Pack semantics, not exact ZIP bytes, compression settings, timestamps, unknown entries, or member order. Format version 1 is explicitly unstable.

§Development

Minimum verification:

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-features
  • dagger check

Maintainers changing the embedded compiler must follow the embedded Typst upgrade procedure.

§License

Licensed under either of

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Modules§

opendal
OpenDAL integration
pack_archive
Versioned Pack Archive encoding, decoding, read, and write.

Structs§

CanonicalIdentity
A role-separated canonical semantic identity.
CompilationAccessObservation
One canonical dependency observation made by the embedded engine.
CompilationAccessTrace
Canonical accesses retained by a semantic compilation result.
CompilationArtifact
One file produced by compiling a pack.
CompilationArtifactPathWriteError
A failure while writing Compilation Output Artifacts to caller-selected paths.
CompilationArtifactWriteEntry
One completed Compilation Output Artifact write entry.
CompilationArtifactWriteError
CompilationArtifactWriteProgress
Completed Compilation Output Artifact entries in canonical artifact order.
CompilationArtifactWriteReceipt
Evidence from successful write of one Compilation Result’s artifacts.
CompilationDiagnostic
A structured compiler or exporter diagnostic.
CompilationDocumentSummary
The stable document facts reached before complete export.
CompilationFulfillmentReport
Operational dependency evidence surrounding one official semantic result.
CompilationFulfillmentSet
CompilationFulfillmentSetError
CompilationReport
The immutable account of an accepted compilation through complete export.
CompilationRequestRejection
A rejected semantic request.
CompilationResult
The semantic result of an accepted Pack compilation request.
DependencyDiscoveryRejection
Complete compiler evidence from a rejected Dependency Discovery run.
DiagnosticHint
A structured hint attached to an official diagnostic.
DiagnosticProducer
The exact embedded implementation that emitted a diagnostic.
DiagnosticTracepoint
One structured tracepoint attached to an official diagnostic.
DiscoverySpecification
The semantic controls for one Dependency Discovery run.
FilesystemFontContainerIssue
One selected filesystem entry whose bytes are not a valid Font Container.
FilesystemFontSource
One explicitly configured source of Font Containers.
FilesystemFontSurveyError
All safely detectable issues found by one filesystem font survey.
FilesystemFontValidationError
Every invalid Font Container found while validating selected entries.
FilesystemPackAssembler
Reusable filesystem Pack Assembly over configured concrete authorities.
FilesystemPackAssemblerConfig
Reusable host policy for the reference filesystem Pack Assembler.
FilesystemPackAssemblyCreationError
A Pack Creation failure retained by the filesystem Pack Assembler.
FilesystemPackAssemblyDiscoveryError
An invalid Discovery Specification retained by filesystem Pack Assembly.
FilesystemPackAssemblyProfile
Named finite resource policy for one filesystem Pack Assembly run.
FilesystemPackAssemblyRequest
Per-run roots, Discovery Specification controls, embedding choices, and Pack metadata.
FilesystemPackageAuthority
The concrete Package Authority used by the reference filesystem workflows.
FilesystemPackageSurveyError
All safely detectable issues found by one filesystem package survey.
FilesystemProjectSurveyError
All safely detectable issues found by one filesystem structural survey.
FontCatalog
Exactly the Font Containers Pack Creation may select faces from, in the order the caller chose.
FontCatalogEntry
One position in a Font Catalog.
FontCatalogFace
One face a catalog offers to Pack Creation at one explicit position.
FontContainer
The exact validated bytes of one standalone font file or multi-face collection.
FontContainerFace
One readable face of a validated Font Container.
FontContainerFulfillment
FontFaceIdentity
The exact identity of one face within a Font Container.
FontFulfillmentReport
Operational evidence retained for one exact font fulfillment.
FontRequirement
One exact Font Container and the faces required from it.
HtmlOutputSpecification
Semantic controls for HTML output.
ImplementationIdentity
The exact embedded implementation that participated in a result.
InvalidCompilationFulfillmentSet
Complete canonical evidence that a fulfillment set is not exact.
Limits
Validated finite ceilings for the resources used by one operation.
LogicalSpan
A source location expressed in the Pack’s logical namespace.
Pack
A portable pack of a Typst project.
PackArchiveBytes
Exact uniquely owned bytes of one Pack Archive.
PackAssemblyDiagnosticContext
Opaque source context retained for first-party creation diagnostics.
PackAssemblyReport
The terminal report of a successful filesystem Pack Assembly run.
PackBuilder
Builds a Pack from in-memory data.
PackCompilationRequest
An explicit semantic compilation request bound to one validated Pack.
PackCompilationWarning
A Pack-owned semantic request warning.
PackCreationInput
Every value borrowed by one stateless Pack Creation invocation.
PackExtractionEntry
One canonical destination-relative entry in a Pack Extraction Plan.
PackExtractionPlan
An owned, immutable, destination-independent Pack Extraction Plan.
PackExtractionPlanError
A failure while constructing a Pack Extraction Plan.
PackExtractionSelection
The embedded dependency content selected for one Pack Extraction Plan.
PackExtractionWriteEntry
One completed entry in Pack Extraction write-plan order.
PackExtractionWriteError
PackExtractionWriteProgress
Completed Pack Extraction write entries in write-plan order.
PackExtractionWriteReceipt
Evidence from successful write of one Pack Extraction Plan.
PackFont
A font embedded in a pack.
PackFontCatalogFace
One ordered face in the exact Pack Font Catalog.
PackInvariantError
A violation of the invariants shared by every Pack construction path.
PackMetadata
The optional [metadata] section.
PackOverrideSet
An immutable set of contained project-file replacements bound to one Pack.
PackageCatalog
The validated Package Trees Pack Creation may select, keyed canonically by exact package specification.
PackageCatalogEntry
One Package Catalog entry under its claimed exact specification.
PackageCatalogError
A failure while constructing a PackageCatalog.
PackageFulfillmentReport
Operational evidence retained for one exact package fulfillment.
PackageReadFailure
An external attempt to read one exact package specification failed.
PackageReadFailures
Package Read Failures keyed by exact package specification.
PackageRequirement
One exact package specification and Package Tree identity.
PackageTree
Every addressable regular file beneath one read package root.
PackageTreeError
A failure while constructing a PackageTree.
PackageTreeFulfillment
PageSelection
A selection of one-indexed source page ranges.
PdfOutputSpecification
Semantic controls for PDF output.
PdfStandardsValidationError
A lossless projection of an official PDF standards validation error.
PngOutputSpecification
Semantic controls for PNG output.
ProjectSnapshot
One stabilized set of project files: canonical root-relative paths, exact bytes, and the entrypoint they were assembled around.
ProjectSnapshotAssembly
Assembles a ProjectSnapshot from already selected path-and-bytes entries.
ProjectSnapshotError
A failure while assembling a ProjectSnapshot.
ReadPackage
One successful read from the concrete filesystem Package Authority.
ResourceKind
A resource identifier from one operation-specific profile.
SvgOutputSpecification
Semantic controls for SVG output.

Enums§

CanonicalIdentityRole
The semantic role of a CanonicalIdentity.
CommitCertainty
Knowledge about whether one attempted destination effect completed.
CompilationAccessKind
The kind of dependency request made by the embedded engine.
CompilationAccessOutcome
The stable outcome of one dependency request.
CompilationArtifactWriteIssue
One independently detectable issue before Compilation Output Artifact write.
CompilationFulfillmentIssue
One exact-set deviation detected before private World materialization.
CompilationFulfillmentSetIssue
CompilationOperationOutcome
A Pack-owned operational outcome after request acceptance and before a semantic result.
CompilationOutputSpecification
The required tagged semantic output request.
CompilationReportOutcome
CompilationRequestIssue
One independently detectable issue in a rejected semantic request.
CompilationStatus
Whether the official compiler and exporter accepted the compilation.
CreationTimestamp
The source of the document creation datetime recorded in PDF metadata.
DiagnosticPhase
The official phase that emitted a diagnostic.
DiagnosticSeverity
Official Typst diagnostic severity.
DiscoverySpecificationError
A failure while constructing a DiscoverySpecification.
DocumentTime
The exact or explicitly absent time used by Typst document-time requests.
FilesystemDestinationEntryKind
A destination entry kind relevant to merge preflight.
FilesystemFontEntryKind
The kind of an eligible filesystem entry that cannot become a Font Container.
FilesystemFontIssue
One independently detectable filesystem font survey issue.
FilesystemFontOperation
The filesystem operation that failed while reading a Font Catalog.
FilesystemFontReadError
A failure while reading a Font Catalog from configured filesystem sources.
FilesystemMergePolicy
An explicit policy for writing planned files to the filesystem.
FilesystemPackAssemblyClock
Clock policy used when a run does not supply an exact Document Time.
FilesystemPackAssemblyError
A failure while packing a project directory.
FilesystemPackageAuthorityReadError
A typed failure from the concrete filesystem Package Authority.
FilesystemPackageEntryKind
The kind of a filesystem entry that cannot become a package file.
FilesystemPackageIssue
One independently detectable filesystem Package Tree survey issue.
FilesystemPackageOperation
The filesystem operation that failed while reading a Package Tree.
FilesystemPackageReadError
A failure while reading a Package Tree from the filesystem.
FilesystemProjectEntryKind
The kind of an eligible filesystem entry that cannot become a project file.
FilesystemProjectIssue
One independently detectable filesystem project survey issue.
FilesystemProjectOperation
The filesystem operation that produced an I/O error while reading.
FilesystemProjectPolicyError
A failure while parsing the root filesystem Project Ignore Policy.
FilesystemProjectReadError
A failure while reading a Project Snapshot from the filesystem.
FilesystemWriteErrorCause
The concrete cause retained by a failed filesystem plan write.
FilesystemWritePathError
A failure to derive one filesystem write root from output paths.
FilesystemWritePhase
The filesystem phase reached by a plan write attempt.
FilesystemWritePreflightIssue
One safely detectable issue found before filesystem writes begin.
FontContainerError
A failure to construct a validated Font Container.
FontDisposition
Whether a Font Container’s bytes travel inside the Pack or must be fulfilled externally when the Pack is compiled.
ImplementationRole
The role of an embedded implementation in compilation.
LimitError
A mandatory resource ceiling was exceeded or could not be accounted.
OutputFormat
The Document Formats and Page Formats a pack can be compiled to.
PackBuildError
A failure while building a pack in memory.
PackCreationError
A failure that creates no Pack.
PackCreationOutcome
What one Pack Creation invocation produced.
PackExtractionEntryRole
The semantic role of one Pack Extraction entry.
PackExtractionPlanIssue
One independently detectable issue in a Pack Extraction projection.
PackInvariantIssue
One independently detectable violation of a whole-Pack invariant.
PackOverrideSetError
A Pack-owned Pack Override preflight rejection.
PackPathRole
The role a path plays in a Pack invariant.
PackageArchiveReadError
A failure while reading exact Package Archive bytes from a stream.
PackageCatalogIssue
One independently detectable issue in a supplied Package Catalog.
PackageDisposition
Whether a Package Tree’s bytes travel inside the Pack or must be fulfilled externally when the Pack is compiled.
PackageReadError
A failure while reading one Package Tree.
PackageReadFailureReason
The stable operational reason for a Package Read Failure.
PackageTreeIssue
One independently detectable issue in a supplied Package Tree.
ProjectSnapshotIssue
One independently detectable issue while assembling a ProjectSnapshot.
TracepointKind
The kind of one official diagnostic tracepoint.
TypstTarget
The Typst document model selected for creation or compilation.
WriteKeyOutcome
The outcome observed for one successfully completed write entry.

Constants§

FILE_EXTENSION
The conventional file extension for packs.
IGNORE_FILE
The root-relative path of the filesystem Project Ignore Policy file.
PACKAGE_REGISTRY_NAMESPACE
The one package namespace the registry serves. A specification in any other namespace is resolved from wherever its namespace lives, which the registry layout says nothing about.
PACKAGE_REGISTRY_URL
The URL of the package registry these helpers describe the layout of, the official Typst Universe registry. There is no standardized registry protocol, so the layout is this registry’s own.
VERSION
The typst-pack release and embedded Typst engine versions.

Traits§

Resource
One kind of resource governed by a finite ceiling.

Functions§

compile
Compiles a validated Pack and retains operational fulfillment evidence.
compile_with_limits
Compiles a validated Pack under explicit resource ceilings.
create
Runs one representative Typst request over the supplied inputs and issues the Pack it selected, or reports the packages it needed and was not given.
expand_package_archive
Expands the archive bytes served for one exact package specification into the Package Tree creation accepts as a resolved tree for it.
package_archive_url
The URL of the archive holding one exact package specification’s Package Tree.
parse_page_selection
Parses a textual page selection like 1,3-5,9-.
plan_pack_extraction
Produces the complete semantic projection of one Pack before destination I/O.
read_filesystem_fonts
Reads one ordered Font Catalog from explicitly configured sources.
read_filesystem_package
Reads every addressable regular file beneath one filesystem package root.
read_filesystem_project
Reads one Project Snapshot from the reference filesystem source.
read_package_archive
Reads exact Package Archive bytes under the expansion profile’s compressed-byte ceiling.
resolve_external_font_requirements
Resolves the Pack’s external Font Requirements from exact source-container bytes.
resolve_filesystem_write_paths
Resolves output paths into one existing filesystem root and relative targets.
typst_embedded_font_containers
Typst’s embedded fonts as validated containers, in Typst’s own order.
write_compilation_artifacts_to_filesystem_paths
Writes a succeeded Compilation Result through caller-selected destination-relative filesystem paths.
write_pack_extraction_plan_to_filesystem
Writes a Pack Extraction Plan under one explicit filesystem policy.

Type Aliases§

CompilationLimitError
A mandatory compilation export ceiling was exceeded or could not be accounted.
CompilationLimits
Mandatory finite resource ceilings for compilation artifact export.
CompilationResource
A resource bounded during compilation artifact export.
FilesystemFontLimitError
A filesystem font source exceeded a mandatory reading ceiling.
FilesystemFontLimits
Mandatory finite resource ceilings for filesystem Font Catalog reading.
FilesystemFontResource
A resource bounded during filesystem Font Catalog reading.
FilesystemPackageLimitError
A filesystem package exceeded a mandatory reading ceiling.
FilesystemPackageLimits
Mandatory finite resource ceilings for filesystem Package Tree reading.
FilesystemPackageResource
A resource bounded during filesystem Package Tree reading.
FilesystemProjectLimitError
A filesystem project exceeded a mandatory reading ceiling.
FilesystemProjectLimits
Mandatory finite resource ceilings for filesystem project reading.
FilesystemProjectResource
A resource bounded during filesystem project reading.
PackageExpansionLimitError
A package archive exceeded a mandatory expansion ceiling.
PackageExpansionLimits
Mandatory finite resource ceilings for Package Archive Expansion.
PackageExpansionResource
A resource bounded during Package Archive Expansion.
PageRange
A one-indexed, inclusive page range with optional open ends.