import type { HookResult } from "@nuxt/schema"; import type { BundledTheme, CodeToHastOptions, HighlighterCore } from "shiki"; import type { HighlighterCoreOptions } from "shiki/core"; import type { MaybeRefOrGetter } from "vue"; export interface ShikiOptions { core: HighlighterCoreOptions; highlight: HighlightOptions; } export type HighlightOptions = CodeToHastOptions & { theme?: BundledTheme; themes?: Record; /** unwrap pre > code to code */ unwrap?: boolean; }; export type UseHighlightOptions = Omit, "lang" | "theme"> & { highlighted?: string; lang?: MaybeRefOrGetter; theme?: MaybeRefOrGetter; themes?: MaybeRefOrGetter; }; export type ShikiHighlighter = HighlighterCore & { highlight: (code: string, options: Partial) => string; }; declare module "nuxt/app" { interface RuntimeNuxtHooks { "shiki:options": (ctx: { options: HighlightOptions; extend: (options: Partial) => void; }) => HookResult; } }