UNPKG

@magnit-ce/code-example

Version:

A custom HTML element that renders code in a syntax-highlight text block, and the results of that code in a display frame.

25 lines (22 loc) 688 B
import { Prism, LoaderOptions } from 'prism-esm'; type CodeExampleProperties = {}; declare enum CodeExampleSlotKeys { slot = "slot", html = "html", script = "script", javascript = "javascript", js = "js", code = "code", style = "style", css = "css" } declare class CodeExampleElement extends HTMLElement { #private; findElement<T extends HTMLElement = HTMLElement>(id: string): T; prism: Prism; constructor(); loadLanguage(loader: (prism: Prism, options?: LoaderOptions) => void): void; connectedCallback(): void; disconnectedCallback(): void; } export { CodeExampleElement, type CodeExampleProperties, CodeExampleSlotKeys };