Skip to content

Commit

Permalink
flow...
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx committed Jul 9, 2024
1 parent 1c3c15f commit b01ce03
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions packages/lexical-react/flow/LexicalContentEditable.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,41 @@
* @flow strict
*/

// $FlowFixMe - Not able to type this with a flow extension
import type {TRefFor} from 'CoreTypes.flow';

import * as React from 'react';

// Due to Flow limitations, we prefer fixed types over the built-in inexact HTMLElement
type HTMLDivElementDOMProps = $ReadOnly<{
autoCapitalize?: boolean,
autoComplete?: boolean,
autoCorrect?: boolean,
className?: string,
'data-testid'?: string,
role?: string,
spellCheck?: boolean,
suppressContentEditableWarning?: boolean,
tabIndex?: number,
style?: CSSStyleDeclaration,
'data-testid'?: string | null,
}>

type PlaceholderProps =
| $ReadOnly<{
'aria-placeholder'?: void,
placeholder?: null,
placeholderComponent?: null,
}>
| $ReadOnly<{
'aria-placeholder': string,
placeholder:
placeholderComponent:
| ((isEditable: boolean) => null | React$Node)
| null
| React$Node,
}>;

export type Props = $ReadOnly<{
...Partial<HTMLDivElement>,
...HTMLDivElementDOMProps,
ariaActiveDescendant?: string,
ariaAutoComplete?: string,
ariaControls?: string,
Expand All @@ -33,10 +51,10 @@ export type Props = $ReadOnly<{
ariaLabelledBy?: string,
ariaMultiline?: boolean,
ariaOwns?: string,
ariaRequired?: boolean,
ariaRequired?: string,
autoCapitalize?: boolean,
'data-testid'?: string | null,
...
}> & PlaceholderProps;
ref?: TRefFor<HTMLDivElement>,
...PlaceholderProps
}>

declare export function ContentEditable(props: Props): React$Node;

0 comments on commit b01ce03

Please sign in to comment.