import type * as monacoNS from "./monaco.d.ts"; import type { LSPConfig } from "./lsp.d.ts"; import type { TextmateGrammarName, TextmateThemeName } from "./textmate.d.ts"; import { FileSystem, NotFoundError, Workspace } from "./workspace"; type Awaitable = T | Promise; type MaybeGetter = Awaitable> | (() => Awaitable>); type MaybeModule = T | { default: T }; type MaybeArray = T | T[]; type LanguageInput = MaybeGetter>; type ThemeInput = MaybeGetter; export type TextmateGrammar = { name: string; scopeName: string; displayName?: string; foldingStartMarker?: string; foldingStopMarker?: string; injectionSelector?: string; injectTo?: string[]; injections?: Record; patterns: any[]; repository?: Record; }; export type TextmateTheme = { type?: "dark" | "light"; name: string; displayName?: string; colors?: Record; tokenColors?: any[]; semanticTokenColors?: Record; semanticHighlighting?: boolean; }; export interface ShikiInitOptions { /** * @deprecated Use `defaultTheme` instead. */ theme?: TextmateThemeName | (string & {}) | URL | ThemeInput; /** * Theme name, or theme registration object to be loaded upfront. */ defaultTheme?: TextmateThemeName | (string & {}) | URL | ThemeInput; /** * Additional theme names, or theme registration objects to be loaded upfront. */ themes?: (TextmateThemeName | (string & {}) | URL | ThemeInput)[]; /** * Language names, or language registration objects to be loaded upfront. */ langs?: (TextmateGrammarName | (string & {}) | URL | LanguageInput)[]; /** * The CDN base URL to download themes and languages from. Default: "https://esm.sh". */ cdn?: string; } export interface InitOptions extends ShikiInitOptions { /** * Virtual file system to be used by the editor. */ workspace?: Workspace; /** * Language server protocol configuration. */ lsp?: LSPConfig; } export function init(options?: InitOptions): Promise; export function lazy(options?: InitOptions): void; export function hydrate(options?: InitOptions): void; export const errors: { NotFound: NotFoundError; }; export { FileSystem, Workspace };