import { InjectionToken, Provider } from '@angular/core'; import type { HLJSApi, LanguageFn } from 'highlight.js'; import { KbqCodeBlockFile } from './types'; import * as i0 from "@angular/core"; /** `highlight.js` configuration */ export type KbqCodeBlockHighlightJsConfig = Partial<{ /** Lazy loader for highlight.js core (no bundled languages). When omitted, the full bundle is loaded. */ core: () => Promise<{ default: HLJSApi; }>; /** Map of language name to lazy loader for that language's LanguageFn. */ languages: Record Promise<{ default: LanguageFn; }>>; }>; /** * Injection token for configuring `KbqCodeBlockHighlightJsConfig`. */ export declare const KBQ_CODE_BLOCK_HIGHLIGHT_JS_CONFIG: InjectionToken Promise<{ default: HLJSApi; }>; /** Map of language name to lazy loader for that language's LanguageFn. */ languages: Record Promise<{ default: LanguageFn; }>>; }>>; /** * Utility provider for `KBQ_CODE_BLOCK_HIGHLIGHT_JS_CONFIG`. * * @example * ```ts * providers: [ * kbqCodeBlockHighlightJsConfigProvider({ * core: () => import('highlight.js/lib/core'), * languages: { * typescript: () => import('highlight.js/lib/languages/typescript'), * css: () => import('highlight.js/lib/languages/css'), * html: () => import('highlight.js/lib/languages/xml') * } * }) * ] * ``` */ export declare const kbqCodeBlockHighlightJsConfigProvider: (options: KbqCodeBlockHighlightJsConfig) => Provider; /** * Fallback language for code block if language is not supported/specified. * * List of supported languages: * @link https://highlightjs.readthedocs.io/en/stable/supported-languages.html */ export declare const KBQ_CODE_BLOCK_FALLBACK_FILE_LANGUAGE: InjectionToken; /** Utility provider for `KBQ_CODE_BLOCK_FALLBACK_FILE_LANGUAGE`. */ export declare const kbqCodeBlockFallbackFileLanguageProvider: (language: string) => Provider; /** * Directive which applies syntax highlighting to the code block content. * * @docs-private */ export declare class KbqCodeBlockHighlight { private readonly nativeElement; private readonly document; private readonly renderer; private readonly domSanitizer; private readonly fallbackFileLanguage; private readonly window; private readonly config; private hljs; private readonly _pending; /** * Whether syntax highlighting is pending. * * @docs-private */ readonly pending: import("@angular/core").Signal; /** The code file. */ set file(file: KbqCodeBlockFile); /** The starting line number. */ startFrom: number; /** Whether to display line numbers for single line code block. */ singleLine: boolean; private load; private highlight; private warn; /** Initialize the HighlightJS line numbers plugin after the hljs instance is available. */ private initLineNumbersPlugin; /** * This method is not intended for editing. * Changes may lead to unpredictable behavior. * Source code: https://github.com/wcoder/highlightjs-line-numbers.js/blob/v2.9.0/src/highlightjs-line-numbers.js */ private highlightJSLineNumbersPlugin; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; static ngAcceptInputType_startFrom: unknown; static ngAcceptInputType_singleLine: unknown; }