<commit_before>// Type definitions for Draft.js v0.10.3
// Project: https://facebook.github.io/draft-js/
// Definitions by: <NAME> <https://github.com/dmitryrogozhny>
//                 <NAME> <https://github.com/eelco>
//                 <NAME> <https://github.com/ghotiphud>
//                 <NAME> <https://github.com/schwers>
//                 <NAME> <https://github.com/michael-yx-wu>
//                 <NAME> <https://github.com/willisplummer>
//                 <NAME> <https://github.com/smvilar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import * as React from 'react';
import * as Immutable from 'immutable';

type SyntheticKeyboardEvent = React.KeyboardEvent<{}>;
type SyntheticEvent = React.SyntheticEvent<{}>;
export as namespace Draft;
declare namespace Draft {
    namespace Component {
        namespace Base {
            import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand;
            import DraftBlockType = Draft.Model.Constants.DraftBlockType;
            import DraftDragType = Draft.Model.Constants.DraftDragType;
            import DraftHandleValue = Draft.Model.Constants.DraftHandleValue;

            import EditorState = Draft.Model.ImmutableData.EditorState;
            import ContentBlock = Draft.Model.ImmutableData.ContentBlock;
            import SelectionState = Draft.Model.ImmutableData.SelectionState;
            import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle;

            import DraftBlockRenderConfig = Draft.Model.ImmutableData.DraftBlockRenderConfig;

            type DraftBlockRenderMap = Immutable.Map<DraftBlockType, DraftBlockRenderConfig>;

            type EditorCommand = DraftEditorCommand | string;

            /**
             * `DraftEditor` is the root editor component. It composes a `contentEditable`
             * div, and provides a wide variety of useful function props for managing the
             * state of the editor. See `DraftEditorProps` for details.
             */
            class DraftEditor extends React.Component<DraftEditorProps, {}> {
                // Force focus back onto the editor node.
                focus(): void;
                // Remove focus from the editor node.
                blur(): void;
            }

            /**
             * The two most critical props are `editorState` and `onChange`.
             *
             * The `editorState` prop defines the entire state of the editor, while the
             * `onChange` prop is the method in which all state changes are propagated
             * upward to higher-level components.
             *
             * These props are analagous to `value` and `onChange` in controlled React
             * text inputs.
             */
            export interface DraftEditorProps {
                editorState: EditorState;
                onChange(editorState: EditorState): void;

                placeholder?: string;

                // Specify whether text alignment should be forced in a direction
                // regardless of input characters.
                textAlignment?: DraftTextAlignment;

                // For a given `ContentBlock` object, return an object that specifies
                // a custom block component and/or props. If no object is returned,
                // the default `TextEditorBlock` is used.
                blockRendererFn?(block: ContentBlock): any;

                // Function that allows to define class names to apply to the given block when it is rendered.
                blockStyleFn?(block: ContentBlock): string;

                // Provide a map of inline style names corresponding to CSS style objects
                // that will be rendered for matching ranges.
                customStyleMap?: any;

                // Provide a function that will construct CSS style objects given inline
                // style names.
                customStyleFn?: (style: DraftInlineStyle) => Object;

                // A function that accepts a synthetic key event and returns
                // the matching DraftEditorCommand constant, or null if no command should
                // be invoked.
                keyBindingFn?(e: SyntheticKeyboardEvent): EditorCommand | null;

                // Set whether the `DraftEditor` component should be editable. Useful for
                // temporarily disabling edit behavior or allowing `DraftEditor` rendering
                // to be used for consumption purposes.
                readOnly?: boolean;

                // Note: spellcheck is always disabled for IE. If enabled in Safari, OSX
                // autocorrect is enabled as well.
                spellCheck?: boolean;

                // Set whether to remove all style information from pasted content. If your
                // use case should not have any block or inline styles, it is recommended
                // that you set this to `true`.
                stripPastedStyles?: boolean;

                tabIndex?: number;

                // exposed especially to help improve mobile web behaviors
                autoCapitalize?: string;
                autoComplete?: string;
                autoCorrect?: string;

                ariaActiveDescendantID?: string;
                ariaAutoComplete?: string;
                ariaControls?: string;
                ariaDescribedBy?: string;
                ariaExpanded?: boolean;
                ariaLabel?: string;
                ariaMultiline?: boolean;

                webDriverTestID?: string;

                /**
                 * Cancelable event handlers, handled from the top level down. A handler
                 * that returns `handled` will be the last handler to execute for that event.
                 */

                // Useful for managing special behavior for pressing the `Return` key. E.g.
                // removing the style from an empty list item.
                handleReturn?(e: SyntheticKeyboardEvent, editorState: EditorState): DraftHandleValue,

                // Map a key command string provided by your key binding function to a
                // specified behavior.
                handleKeyCommand?(command: EditorCommand, editorState: EditorState): DraftHandleValue,

                // Handle intended text insertion before the insertion occurs. This may be
                // useful in cases where the user has entered characters that you would like
                // to trigger some special behavior. E.g. immediately converting `:)` to an
                // emoji Unicode character, or replacing ASCII quote characters with smart
                // quotes.
                handleBeforeInput?(chars: string, editorState: EditorState): DraftHandleValue,

                handlePastedText?(text: string, html: string|undefined, editorState: EditorState): DraftHandleValue,

                handlePastedFiles?(files: Array<Blob>): DraftHandleValue,

                // Handle dropped files
                handleDroppedFiles?(selection: SelectionState, files: Array<Blob>): DraftHandleValue,

                // Handle other drops to prevent default text movement/insertion behaviour
                handleDrop?(selection: SelectionState, dataTransfer: Object, isInternal: DraftDragType): DraftHandleValue,

                /**
                 * Non-cancelable event triggers.
                 */
                onEscape?(e: SyntheticKeyboardEvent): void,
                onTab?(e: SyntheticKeyboardEvent): void,
                onUpArrow?(e: SyntheticKeyboardEvent): void,
                onDownArrow?(e: SyntheticKeyboardEvent): void,

                onBlur?(e: SyntheticEvent): void,
                onFocus?(e: SyntheticEvent): void,

                // Provide a map of block rendering configurations. Each block type maps to
                // an element tag and an optional react element wrapper. This configuration
                // is used for both rendering and paste processing.
                blockRenderMap?: DraftBlockRenderMap
            }

            type DraftTextAlignment = "left" | "center" | "right";
        }<commit_msg>Update for the new onLeftArrow, onRightArrow in draft-js 0.10.4<commit_after>// Type definitions for Draft.js v0.10.4
// Project: https://facebook.github.io/draft-js/
// Definitions by: <NAME> <https://github.com/dmitryrogozhny>
//                 <NAME> <https://github.com/eelco>
//                 <NAME> <https://github.com/ghotiphud>
//                 <NAME> <https://github.com/schwers>
//                 <NAME> <https://github.com/michael-yx-wu>
//                 <NAME> <https://github.com/willisplummer>
//                 <NAME> <https://github.com/smvilar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import * as React from 'react';
import * as Immutable from 'immutable';

type SyntheticKeyboardEvent = React.KeyboardEvent<{}>;
type SyntheticEvent = React.SyntheticEvent<{}>;
export as namespace Draft;
declare namespace Draft {
    namespace Component {
        namespace Base {
            import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand;
            import DraftBlockType = Draft.Model.Constants.DraftBlockType;
            import DraftDragType = Draft.Model.Constants.DraftDragType;
            import DraftHandleValue = Draft.Model.Constants.DraftHandleValue;

            import EditorState = Draft.Model.ImmutableData.EditorState;
            import ContentBlock = Draft.Model.ImmutableData.ContentBlock;
            import SelectionState = Draft.Model.ImmutableData.SelectionState;
            import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle;

            import DraftBlockRenderConfig = Draft.Model.ImmutableData.DraftBlockRenderConfig;

            type DraftBlockRenderMap = Immutable.Map<DraftBlockType, DraftBlockRenderConfig>;

            type EditorCommand = DraftEditorCommand | string;

            /**
             * `DraftEditor` is the root editor component. It composes a `contentEditable`
             * div, and provides a wide variety of useful function props for managing the
             * state of the editor. See `DraftEditorProps` for details.
             */
            class DraftEditor extends React.Component<DraftEditorProps, {}> {
                // Force focus back onto the editor node.
                focus(): void;
                // Remove focus from the editor node.
                blur(): void;
            }

            /**
             * The two most critical props are `editorState` and `onChange`.
             *
             * The `editorState` prop defines the entire state of the editor, while the
             * `onChange` prop is the method in which all state changes are propagated
             * upward to higher-level components.
             *
             * These props are analagous to `value` and `onChange` in controlled React
             * text inputs.
             */
            export interface DraftEditorProps {
                editorState: EditorState;
                onChange(editorState: EditorState): void;

                placeholder?: string;

                // Specify whether text alignment should be forced in a direction
                // regardless of input characters.
                textAlignment?: DraftTextAlignment;

                // For a given `ContentBlock` object, return an object that specifies
                // a custom block component and/or props. If no object is returned,
                // the default `TextEditorBlock` is used.
                blockRendererFn?(block: ContentBlock): any;

                // Function that allows to define class names to apply to the given block when it is rendered.
                blockStyleFn?(block: ContentBlock): string;

                // Provide a map of inline style names corresponding to CSS style objects
                // that will be rendered for matching ranges.
                customStyleMap?: any;

                // Provide a function that will construct CSS style objects given inline
                // style names.
                customStyleFn?: (style: DraftInlineStyle) => Object;

                // A function that accepts a synthetic key event and returns
                // the matching DraftEditorCommand constant, or null if no command should
                // be invoked.
                keyBindingFn?(e: SyntheticKeyboardEvent): EditorCommand | null;

                // Set whether the `DraftEditor` component should be editable. Useful for
                // temporarily disabling edit behavior or allowing `DraftEditor` rendering
                // to be used for consumption purposes.
                readOnly?: boolean;

                // Note: spellcheck is always disabled for IE. If enabled in Safari, OSX
                // autocorrect is enabled as well.
                spellCheck?: boolean;

                // Set whether to remove all style information from pasted content. If your
                // use case should not have any block or inline styles, it is recommended
                // that you set this to `true`.
                stripPastedStyles?: boolean;

                tabIndex?: number;

                // exposed especially to help improve mobile web behaviors
                autoCapitalize?: string;
                autoComplete?: string;
                autoCorrect?: string;

                ariaActiveDescendantID?: string;
                ariaAutoComplete?: string;
                ariaControls?: string;
                ariaDescribedBy?: string;
                ariaExpanded?: boolean;
                ariaLabel?: string;
                ariaMultiline?: boolean;

                webDriverTestID?: string;

                /**
                 * Cancelable event handlers, handled from the top level down. A handler
                 * that returns `handled` will be the last handler to execute for that event.
                 */

                // Useful for managing special behavior for pressing the `Return` key. E.g.
                // removing the style from an empty list item.
                handleReturn?(e: SyntheticKeyboardEvent, editorState: EditorState): DraftHandleValue,

                // Map a key command string provided by your key binding function to a
                // specified behavior.
                handleKeyCommand?(command: EditorCommand, editorState: EditorState): DraftHandleValue,

                // Handle intended text insertion before the insertion occurs. This may be
                // useful in cases where the user has entered characters that you would like
                // to trigger some special behavior. E.g. immediately converting `:)` to an
                // emoji Unicode character, or replacing ASCII quote characters with smart
                // quotes.
                handleBeforeInput?(chars: string, editorState: EditorState): DraftHandleValue,

                handlePastedText?(text: string, html: string|undefined, editorState: EditorState): DraftHandleValue,

                handlePastedFiles?(files: Array<Blob>): DraftHandleValue,

                // Handle dropped files
                handleDroppedFiles?(selection: SelectionState, files: Array<Blob>): DraftHandleValue,

                // Handle other drops to prevent default text movement/insertion behaviour
                handleDrop?(selection: SelectionState, dataTransfer: Object, isInternal: DraftDragType): DraftHandleValue,

                /**
                 * Non-cancelable event triggers.
                 */
                onEscape?(e: SyntheticKeyboardEvent): void,
                onTab?(e: SyntheticKeyboardEvent): void,
                onUpArrow?(e: SyntheticKeyboardEvent): void,
                onDownArrow?(e: SyntheticKeyboardEvent): void,
                onRightArrow?(e: SyntheticKeyboardEvent): void,
                onLeftArrow?(e: SyntheticKeyboardEvent): void,

                onBlur?(e: SyntheticEvent): void,
                onFocus?(e: SyntheticEvent): void,

                // Provide a map of block rendering configurations. Each block type maps to
                // an element tag and an optional react element wrapper. This configuration
                // is used for both rendering and paste processing.
                blockRenderMap?: DraftBlockRenderMap
            }

            type DraftTextAlignment = "left" | "center" | "right";
        }
{'fraction_non_alphanumeric': 0.07451384261222511, 'fraction_numerical': 0.0009692857575573999, 'mean_word_length': 1.8442453480358374, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 45, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3680207', 'n_tokens_mistral': 3924, 'n_tokens_neox': 3634, 'n_words': 1320}