UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

51 lines (50 loc) 1.92 kB
import { Ace } from 'ace-builds'; import { BaseComponentProps } from '../internal/base-component'; import { NonCancelableEventHandler } from '../internal/events'; import { AceModes } from './ace-modes'; import { DarkThemes, LightThemes } from './ace-themes'; export interface CodeEditorProps extends BaseComponentProps { ace: any; value: string; language: CodeEditorProps.Language; onChange?: NonCancelableEventHandler<CodeEditorProps.ChangeDetail>; onValidate?: NonCancelableEventHandler<CodeEditorProps.ValidateDetail>; preferences?: Partial<CodeEditorProps.Preferences>; onPreferencesChange: NonCancelableEventHandler<CodeEditorProps.Preferences>; loading?: boolean; onRecoveryClick?: NonCancelableEventHandler<void>; i18nStrings: CodeEditorProps.I18nStrings; } export declare namespace CodeEditorProps { type Language = typeof AceModes[number]['value']; type Theme = typeof LightThemes[number]['value'] | typeof DarkThemes[number]['value']; interface Preferences { wrapLines: boolean; theme: Theme; } interface I18nStrings { loadingState: string; errorState: string; errorStateRecovery: string; editorGroupAriaLabel: string; statusBarGroupAriaLabel: string; cursorPosition: (row: number, column: number) => string; errorsTab: string; warningsTab: string; preferencesButtonAriaLabel: string; paneCloseButtonAriaLabel: string; preferencesModalHeader: string; preferencesModalCancel: string; preferencesModalConfirm: string; preferencesModalWrapLines: string; preferencesModalTheme: string; preferencesModalLightThemes: string; preferencesModalDarkThemes: string; } interface ChangeDetail { value: string; } interface ValidateDetail { annotations: Ace.Annotation[]; } }