// src/core/api/index.ts1//2// Main entry point for QuartoAPI3// This module exports the global quartoAPI instance and all related types45import { globalRegistry } from "./registry.ts";6import type { QuartoAPI } from "./types.ts";78// Export all types for external use9export type {10ConsoleNamespace,11CryptoNamespace,12FormatNamespace,13JupyterNamespace,14MappedStringNamespace,15MarkdownRegexNamespace,16PathNamespace,17QuartoAPI,18SystemNamespace,19TextNamespace,20} from "./types.ts";2122// Export registry utilities (mainly for testing)23export {24globalRegistry,25QuartoAPIRegistry,26RegistryFinalizedError,27UnregisteredNamespaceError,28} from "./registry.ts";2930/**31* The global QuartoAPI instance (cached after first call)32*/33let _quartoAPI: QuartoAPI | null = null;3435/**36* Get the global QuartoAPI instance37*38* This function returns the QuartoAPI instance, creating it on first call.39* The register.ts module (imported in src/quarto.ts) ensures all40* namespaces are registered before any code accesses the API.41*42* @returns {QuartoAPI} The complete API object with all namespaces43*/44export function getQuartoAPI(): QuartoAPI {45if (_quartoAPI === null) {46_quartoAPI = globalRegistry.createAPI();47}48return _quartoAPI;49}505152