@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
14 lines • 754 B
text/typescript
/**
* Per-scope grammar loaders. Each entry dynamically imports a single
* `@wooorm/starry-night` grammar module, so the bundler emits one chunk per
* grammar instead of the all-in-one `./grammars` barrel. `ensureGrammars`
* (in `./parseSource`) resolves only the scopes a block needs, keeping the
* unused grammar payloads (~146 KB gzip for all 10) out of the download.
*
* Keys are starry-night scope names — the same values `./grammarMaps` resolves
* file extensions and language props to, so every detectable language has a
* loader (asserted in the tests).
*/
import type { Grammar } from '@wooorm/starry-night';
export type GrammarLoader = () => Promise<Grammar>;
export declare const grammarLoaders: Record<string, GrammarLoader>;