@atlaskit/editor-plugin-code-block
Version:
Code block plugin for @atlaskit/editor-core
17 lines (16 loc) • 676 B
TypeScript
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
export type AutoDetectResult = 'detected' | 'noneDetected';
export type AutoDetectEntry = {
autoDetectedLanguage?: string;
detectionResult?: AutoDetectResult;
isPending?: boolean;
lastObservedFirstLine: string;
lastObservedText: string;
pos: number;
};
export type AutoDetectState = {
languageDetectionMap: Record<string, AutoDetectEntry>;
};
export declare const autoDetectPluginKey: PluginKey<AutoDetectState>;
export declare const getAutoDetectPluginState: (state: EditorState) => AutoDetectState | undefined;