import type { BundledLanguage } from 'shiki' export interface ProcessorContext { code: string language: L options: { [key: string]: any } } export type ProcessorHandler = ( ctx: ProcessorContext, tokens?: string[][] ) => ProcessorResult | ProcessorResult[] | void export interface ProcessorResult { code?: string language?: string tokens?: string[][] options?: Record } export type ProcessorTransformer = ( source: string, language: L, options: Record ) => { code: string language: L lineOptions: any[] } export interface Processor { name: string handler: ProcessorHandler transformer?: ProcessorTransformer postProcess?: (options: { code: string; lang: string }) => string | undefined } export type ProcessFunction = ( processors: Processor[], code: string, language: L, options?: Record ) => { code: string lineOptions: any[] }