UNPKG

@pierre/diffs

Version:

1 lines 1.82 kB
{"version":3,"file":"types.d.ts","names":["CodeToTokensOptions","HighlighterCore","HighlighterGeneric","ThemedToken","RecallToken","CodeToTokenTransformStreamOptions","ShikiStreamTokenizerOptions","ShikiStreamTokenizerEnqueueResult"],"sources":["../../src/shiki-stream/types.d.ts"],"sourcesContent":["import type { CodeToTokensOptions, HighlighterCore, HighlighterGeneric, ThemedToken } from 'shiki/core';\n/**\n * A special token that indicates the number of tokens to be removed from the previous streamed tokens.\n *\n * Pass `allowRecalls: true` to the `CodeToTokenTransformStream` to enable recall tokens.\n */\nexport interface RecallToken {\n /**\n * Number of tokens to be removed from the previous streamed tokens.\n */\n recall: number;\n}\nexport type CodeToTokenTransformStreamOptions = ShikiStreamTokenizerOptions & {\n /**\n * Whether to allow recall tokens to be emitted.\n *\n * A recall token is a special token that indicates the number of tokens to be removed from the previous streamed tokens.\n *\n * @default false\n */\n allowRecalls?: boolean;\n};\nexport type ShikiStreamTokenizerOptions = CodeToTokensOptions<string, string> & {\n highlighter: HighlighterCore | HighlighterGeneric<any, any>;\n};\nexport interface ShikiStreamTokenizerEnqueueResult {\n /**\n * Number of last tokens to be recalled\n */\n recall: number;\n /**\n * Stable tokens\n */\n stable: ThemedToken[];\n /**\n * Unstable tokens, they might or might not be recalled\n */\n unstable: ThemedToken[];\n}\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;AAMA;AAMA;AAUA;AAA0CA,UAhBzBI,WAAAA,CAgByBJ;EACzBC;;;EAEAM,MAAAA,EAAAA,MAAAA;;KAbLF,iCAAAA,GAAoCC;;;;;;;;;;KAUpCA,2BAAAA,GAA8BN;eACzBC,kBAAkBC;;UAElBK,iCAAAA;;;;;;;;UAQLJ;;;;YAIEA"}