Skip to content

Commit

Permalink
[lexical-react] Refactor: Replace React$MixedElement and `React$Nod…
Browse files Browse the repository at this point in the history
…e` with `React.MixedElement` and `React.Node` (#6984)
  • Loading branch information
SamChou19815 authored Dec 23, 2024
1 parent c844a4d commit c415f7a
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion packages/lexical-react/flow/LexicalAutoLinkPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ declare export function createLinkMatcherWithRegExp(
declare export function AutoLinkPlugin(props: {
matchers: Array<LinkMatcher>,
onChange?: ChangeHandler,
}): React$Node;
}): React.Node;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
} from 'lexical';

type Props = $ReadOnly<{
children: React$Node,
children: React.Node,
format: ?ElementFormatType,
nodeKey: NodeKey,
className: $ReadOnly<{
Expand All @@ -25,4 +25,4 @@ type Props = $ReadOnly<{
}>,
}>;

declare export function BlockWithAlignableContents(Props): React$Node;
declare export function BlockWithAlignableContents(Props): React.Node;
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

declare export function CharacterLimitPlugin(props: {
charset: 'UTF-8' | 'UTF-16',
}): React$Node;
}): React.Node;
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ type Props = $ReadOnly<{
onClear?: () => void,
}>;

declare export function ClearEditorPlugin(Props): React$Node;
declare export function ClearEditorPlugin(Props): React.Node;
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ declare export function CollaborationPlugin(arg0: {
cursorsContainerRef?: CursorsContainerRef,
initialEditorState?: InitialEditorStateType,
excludedProperties?: ExcludedProperties,
}): React$Node;
}): React.Node;
4 changes: 2 additions & 2 deletions packages/lexical-react/flow/LexicalComposer.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type InitialConfigType = $ReadOnly<{

type Props = {
initialConfig: InitialConfigType,
children: React$Node,
children: React.Node,
};

declare export function LexicalComposer(Props): React$MixedElement;
declare export function LexicalComposer(Props): React.MixedElement;
4 changes: 2 additions & 2 deletions packages/lexical-react/flow/LexicalContentEditable.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export type PlaceholderProps =
| $ReadOnly<{
'aria-placeholder': string,
placeholder:
| ((isEditable: boolean) => null | React$Node)
| ((isEditable: boolean) => null | React.Node)
| null
| React$Node,
| React.Node,
}>;

export type Props = $ReadOnly<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ type Props = $ReadOnly<{

declare export function DraggableBlockPlugin_EXPERIMENTAL(
props: Props,
): React$MixedElement;
): React.MixedElement;
4 changes: 2 additions & 2 deletions packages/lexical-react/flow/LexicalErrorBoundary.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
*/

export type LexicalErrorBoundaryProps = $ReadOnly<{
children: React$Node,
children: React.Node,
onError: (error: Error) => void,
}>;

declare export function LexicalErrorBoundary(
props: LexicalErrorBoundaryProps,
): React$Node;
): React.Node;

/** @deprecated use the named export {@link LexicalErrorBoundary} */
export default typeof LexicalErrorBoundary;
2 changes: 1 addition & 1 deletion packages/lexical-react/flow/LexicalHashtagPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow strict
*/

declare export function HashtagPlugin(): React$Node;
declare export function HashtagPlugin(): React.Node;
2 changes: 1 addition & 1 deletion packages/lexical-react/flow/LexicalHistoryPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export type HistoryState = {

declare export function HistoryPlugin({
externalHistoryState?: HistoryState,
}): React$Node;
}): React.Node;

declare export function createEmptyHistoryState(): HistoryState;
4 changes: 2 additions & 2 deletions packages/lexical-react/flow/LexicalHorizontalRuleNode.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import type {LexicalNode, LexicalCommand} from 'lexical';

import {DecoratorNode} from 'lexical';

declare export class HorizontalRuleNode extends DecoratorNode<React$Node> {
declare export class HorizontalRuleNode extends DecoratorNode<React.Node> {
static getType(): string;
static clone(node: HorizontalRuleNode): HorizontalRuleNode;
createDOM(): HTMLElement;
getTextContent(): '\n';
updateDOM(): false;
decorate(): React$Node;
decorate(): React.Node;
}

declare export function $createHorizontalRuleNode(): HorizontalRuleNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ declare export var DEFAULT_TRANSFORMERS: Array<Transformer>;

declare export function MarkdownShortcutPlugin({
transformers?: Array<Transformer>,
}): React$Node;
}): React.Node;
4 changes: 2 additions & 2 deletions packages/lexical-react/flow/LexicalNestedComposer.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import type {
} from 'lexical';

declare export function LexicalNestedComposer({
children: React$Node,
children: React.Node,
initialEditor: LexicalEditor,
initialTheme?: EditorThemeClasses,
initialNodes?: $ReadOnlyArray<Class<LexicalNode> | LexicalNodeReplacement>,
}): React$Node;
}): React.Node;
8 changes: 4 additions & 4 deletions packages/lexical-react/flow/LexicalPlainTextPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type InitialEditorStateType =
| ((editor: LexicalEditor) => void);

declare export function PlainTextPlugin({
contentEditable: React$Node,
contentEditable: React.Node,
placeholder?:
| ((isEditable: boolean) => null | React$Node)
| ((isEditable: boolean) => null | React.Node)
| null
| React$Node;
| React.Node;
ErrorBoundary: LexicalErrorBoundary,
}): React$Node;
}): React.Node;
8 changes: 4 additions & 4 deletions packages/lexical-react/flow/LexicalRichTextPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type InitialEditorStateType =
| ((editor: LexicalEditor) => void);

declare export function RichTextPlugin({
contentEditable: React$Node,
contentEditable: React.Node,
placeholder?:
| ((isEditable: boolean) => null | React$Node)
| ((isEditable: boolean) => null | React.Node)
| null
| React$Node;
| React.Node;
ErrorBoundary: LexicalErrorBoundary,
}): React$Node;
}): React.Node;
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ declare export function TableOfContentsPlugin({
children: (
tableOfContents: Array<[NodeKey, string, HeadingTagType]>,
editor: LexicalEditor,
) => React$Node,
}): React$Node;
) => React.Node,
}): React.Node;
2 changes: 1 addition & 1 deletion packages/lexical-react/flow/LexicalTreeView.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ declare export function TreeView(props: {
viewClassName: string,
editor: LexicalEditor,
customPrintNode?: CustomPrintNodeFn,
}): React$Node;
}): React.Node;

0 comments on commit c415f7a

Please sign in to comment.