UNPKG

prism-react-editor

Version:

Lightweight, extensible code editor component for React apps

21 lines (20 loc) 1.25 kB
import { EditorProps, Language, PrismEditor } from './types'; /** * The core editor component of the library. * @param props Props to customize some of the appearance and behavior of the editor. */ declare const Editor: import('react').NamedExoticComponent<EditorProps & import('react').RefAttributes<PrismEditor>>; /** Equivalent to `document` in a browser setting, `null` otherwise. */ declare const doc: Document | null; /** Object storing all language specific behavior. */ declare const languageMap: Record<string, Language>; declare const preventDefault: (e: Event) => void; declare const addListener: <T extends keyof HTMLElementEventMap>(target: HTMLElement, type: T, listener: (this: HTMLElement, ev: HTMLElementEventMap[T]) => any, options?: boolean | AddEventListenerOptions) => void; declare const useStableRef: <T extends unknown>(value: T) => T; /** * Counts number of lines in the string between `start` and `end`. * If start and end are omitted, the whole string is searched. */ declare const numLines: (str: string, start?: number, end?: number) => number; declare let selectionChange: null | ((force?: true) => void); export { Editor, addListener, preventDefault, languageMap, selectionChange, numLines, useStableRef, doc, };