// Ported from @shikijs/twoslash docs: the four custom-tag notations.
import { (alias) function createHighlighterCore(options: HighlighterCoreOptions<false>): Promise<HighlighterCore>
import createHighlighterCoreCreate a Shiki core highlighter instance, with no languages or themes bundled.
Wasm and each language and theme must be loaded manually.
createHighlighterCore } from 'shiki/core'
import { (alias) function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine
import createJavaScriptRegexEngineUse the modern JavaScript RegExp engine to implement the OnigScanner.
As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
patterns are not supported. Errors will be thrown when parsing TextMate grammars with
unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
Set forgiving to true to ignore these errors and skip any unsupported or invalid patterns.
createJavaScriptRegexEngine } from 'shiki/engine/javascript'
const const highlighter: HighlighterCorehighlighter = await (alias) createHighlighterCore(options: HighlighterCoreOptions<false>): Promise<HighlighterCore>
import createHighlighterCoreCreate a Shiki core highlighter instance, with no languages or themes bundled.
Wasm and each language and theme must be loaded manually.
createHighlighterCore({
(property) HighlighterCoreOptions<false>.engine: Awaitable<RegexEngine>Custom RegExp engine.
engine: (alias) createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine
import createJavaScriptRegexEngineUse the modern JavaScript RegExp engine to implement the OnigScanner.
As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
patterns are not supported. Errors will be thrown when parsing TextMate grammars with
unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
Set forgiving to true to ignore these errors and skip any unsupported or invalid patterns.
createJavaScriptRegexEngine()
})
const const a: 1a = 1
Custom log messageconst const b: 1b = 1
Custom error messageconst const c: 1c = 1
Custom warning messageCustom annotation message