import { EditorView } from '@codemirror/view';
import { EventEmitter } from '../../stencil-public-runtime';
import { CodeChunk } from '@stencila/schema';
import { CodeComponent, CodeVisibilityEvent, DiscoverExecutableLanguagesEvent } from '../code/codeTypes';
import { EditorUpdateHandlerCb } from '../editor/customizations/onUpdateHandlerExtension';
import { Keymap } from '../editor/editor';
import { FileFormatMap } from '../editor/languageUtils';
/**
 * @slot text - The source code of the `CodeChunk`. Corresponds to the `text` field in the Stencila `CodeChunk` Schema.
 * @slot outputs - The resulting output when evaluating the CodeChunk. Corresponds to the `outputs` field in the Stencila `CodeChunk` Schema.
 * @slot errors - List of any errors encountered when compiling (e.g. syntax errors) or executing the CodeChunk.
 * @slot label - `label` element label of the `CodeChunk`. Corresponds to the `label` field in the Stencila `CodeChunk` Schema.
 * @slot caption - `figcaption` content of the `CodeChunk`. Corresponds to the `caption` field in the Stencila `CodeChunk` Schema.
 */
export declare class CodeChunkComponent implements CodeComponent<CodeChunk> {
  private static readonly slots;
  private el;
  editorRef: HTMLStencilaEditorElement | undefined; /**

   * Source code contents of the CodeChunk.
   * Corresponds to the `text` property of the CodeChunk schema.
   */
  text?: string;
  /**
   * Autofocus the editor on page load
   */
  autofocus: boolean;
  /**
   * Stencila CodeChunk node to render
   */
  codeChunk?: CodeChunk;
  /**
   * Programming language of the CodeChunk
   */
  programmingLanguage: string | undefined;
  /**
   * List of all supported programming languages
   */
  languageCapabilities: FileFormatMap;
  /**
   * List of programming languages that can be executed in the current context
   */
  executableLanguages?: FileFormatMap;
  onDiscoverExecutableLanguages({ detail, }: DiscoverExecutableLanguagesEvent): void;
  /**
   * Whether the code section is visible or not
   */
  isCodeVisible: boolean;
  /**
   * A callback function to be called with the value of the `CodeChunk` node when executing the `CodeChunk`.
   */
  executeHandler?: (codeChunk: CodeChunk) => Promise<CodeChunk>;
  /**
   * Callback function to invoke whenever the editor contents are updated.
   */
  contentChangeHandler?: EditorUpdateHandlerCb;
  /**
   * Custom keyboard shortcuts to pass along to CodeMirror
   * @see https://codemirror.net/6/docs/ref/#keymap
   */
  keymap: Keymap[];
  executeCodeState: 'INITIAL' | 'PENDING' | 'RESOLVED';
  isStacked: boolean;
  private isCodeVisibleState;
  /**
   * Trigger a global DOM event to hide or show all `CodeChunk` and `CodeExpress` component source code,
   * leaving only the results visible.
   */
  allCodeVisibilityChange: EventEmitter;
  onAllCodeVisibilityChange(event: CodeVisibilityEvent): void;
  private toggleCodeVisibility;
  private toggleAllCodeVisibility;
  /**
   * Determine if the CodeChunk can be executed or not.
   * For a CodeChunk to be considered executable it must have a `executeHandler` function attached
   * and the current `programmingLanguage` must be in the list of `executableLanguages`.
   */
  private isExecutable;
  /**
   * Listen for the `stencila-language-change` event emitted by the language dropdown
   * provided by the child Editor component, and update the active language if necessary.
   */
  private handleLanguageChange;
  private onExecuteHandler;
  private editorLayoutChangeHandler;
  /**
   * Trigger a global DOM event to set the layout of all `CodeChunk` component.
   * Can be set to either show the editor and outputs side by side or stacked vertically.
   */
  editorLayoutChange: EventEmitter;
  onSetEditorLayout(event: {
    detail: {
      isStacked: boolean;
    };
  }): void;
  private toggleEditorLayout;
  /**
   * Returns the `CodeChunk` node with the updated `text` content from the editor.
   */
  getContents(): Promise<CodeChunk>;
  /**
   * Returns the text contents from the editor
   */
  getTextContents(): Promise<string>;
  /**
   * Run the `CodeChunk`
   */
  execute(): Promise<CodeChunk>;
  /**
   * Retrieve a reference to the internal CodeMirror editor.
   * Allows for maintaining state from applications making use of this component.
   */
  getRef(): Promise<EditorView | undefined>;
  private executeRef;
  private allCodeVisibilityChangeHandler;
  private setCodeVisibility;
  componentWillLoad(): void;
  render(): HTMLElement;
}
