@quarto/types
TypeScript type definitions for developing Quarto execution engines.
Installation
The goal in a couple of releases is for you to be able to do
But this package is not published yet, because the interfaces are still in flux.
Instead, build the package and copy dist/index.d.ts to types/quarto-types.d.ts in your engine repo.
Usage
This package provides TypeScript type definitions for implementing custom execution engines for Quarto.
Core Interfaces
ExecutionEngineDiscovery
Interface for implementing a Quarto execution engine discovery, responsible for determining which engine should handle a file and launching engine instances.
ExecutionEngineInstance
Interface for a launched execution engine that can execute documents within a project context.
EngineProjectContext
Restricted version of Quarto's ProjectContext that only exposes functionality needed by execution engines.
Type Simplifications
This package is designed to be a standalone, lightweight type library for external engine development. To maintain this independence, some internal Quarto types are intentionally simplified:
Simplified types with omitted fields
RenderOptions: The internal Quarto version includes aservices: RenderServicesfield, which provides access to temp file context, extension context, and notebook context. This field has been omitted as it requires pulling in large portions of Quarto's internal type system. All other fields are included. See src/command/render/types.ts for the full type.
Simplified to Record<string, unknown> or index signatures
Format.render: The full internal type isFormatRenderwith 100+ lines of specific rendering options including brand configuration and CSS handling. See src/config/types.ts.Format.execute: The full internal type isFormatExecutewith specific execution options. See src/config/types.ts.Format.pandoc: The full internal type isFormatPandocwith 80+ lines of pandoc-specific options. Simplified to{ to?: string; [key: string]: unknown }preserving only the most commonly accessedtoproperty. See src/config/types.ts.
When accessing properties from these records, use type assertions as needed:
Omitted optional functions
The full internal Format interface includes several optional functions that are used internally by Quarto but are not needed by external engines:
mergeAdditionalFormats: Internal format merging logicresolveFormat: Format resolution and normalizationformatExtras: Compute format-specific extras (requiresRenderServicesandProjectContext)formatPreviewFile: Preview file name transformationextensions: Format-specific extension configuration
These functions require deep integration with Quarto's internal systems and are not exposed to external engines. See src/config/types.ts for the full Format interface.
License
MIT