Skip to content

Commit a3b65db

Browse files
committed
type: fix type issue.
1 parent 4b98e5f commit a3b65db

File tree

10 files changed

+24
-22
lines changed

10 files changed

+24
-22
lines changed

core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ export default function App() {
779779

780780
```tsx mdx:preview
781781
import React, { useState } from "react";
782-
import MDEditor, { commands, ICommand, TextState, TextAreaTextApi } from "@uiw/react-md-editor";
782+
import MDEditor, { commands, type ICommand, TextState, TextAreaTextApi } from "@uiw/react-md-editor";
783783
import domToImage from "dom-to-image";
784784

785785
const textToImage: ICommand = {

core/src/Editor.nohighlight.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import MarkdownPreview from '@uiw/react-markdown-preview/nohighlight';
33
import TextArea from './components/TextArea/index.nohighlight';
44
import { ToolbarVisibility } from './components/Toolbar/';
55
import DragBar from './components/DragBar/';
6-
import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands/';
7-
import { reducer, EditorContext, ContextStore } from './Context';
6+
import { getCommands, getExtraCommands, type ICommand, type TextState, TextAreaCommandOrchestrator } from './commands/';
7+
import { reducer, EditorContext, type ContextStore } from './Context';
88
import type { MDEditorProps } from './Types';
99

1010
function setGroupPopFalse(data: Record<string, boolean> = {}) {

core/src/Editor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle, Fragment } from 'react';
1+
import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle } from 'react';
22
import MarkdownPreview from '@uiw/react-markdown-preview';
33
import { ToolbarVisibility } from './components/Toolbar/';
44
import TextArea from './components/TextArea/';
55
import DragBar from './components/DragBar/';
6-
import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands/';
7-
import { reducer, EditorContext, ContextStore } from './Context';
6+
import { getCommands, getExtraCommands, type ICommand, type TextState, TextAreaCommandOrchestrator } from './commands/';
7+
import { reducer, EditorContext, type ContextStore } from './Context';
88
import type { MDEditorProps } from './Types';
99

1010
function setGroupPopFalse(data: Record<string, boolean> = {}) {

core/src/components/DragBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useMemo, useRef } from 'react';
2-
import { IProps } from '../../Types';
2+
import { type IProps } from '../../Types';
33
import './index.less';
44

55
export interface IDragBarProps extends IProps {

core/src/components/TextArea/Markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useContext, useEffect } from 'react';
22
import { rehype } from 'rehype';
33
import rehypePrism from 'rehype-prism-plus';
4-
import { IProps } from '../../Types';
4+
import { type IProps } from '../../Types';
55
import { EditorContext } from '../../Context';
66

77
function html2Escape(sHtml: string) {

core/src/components/TextArea/Textarea.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext, useEffect } from 'react';
2-
import { IProps } from '../../Types';
3-
import { EditorContext, ExecuteCommandState } from '../../Context';
2+
import { type IProps } from '../../Types';
3+
import { EditorContext, type ExecuteCommandState } from '../../Context';
44
import { TextAreaCommandOrchestrator } from '../../commands/';
55
import handleKeyDown from './handleKeyDown';
66
import shortcuts from './shortcuts';

core/src/components/TextArea/index.nohighlight.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { useEffect, Fragment, useContext, JSX } from 'react';
2-
import { EditorContext, ContextStore, ExecuteCommandState } from '../../Context';
2+
import type * as CSS from 'csstype';
3+
import { EditorContext, type ContextStore, ExecuteCommandState } from '../../Context';
34
import shortcuts from './shortcuts';
45
import Textarea, { TextAreaProps } from './Textarea';
5-
import { IProps } from '../../Types';
6-
import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
6+
import { type IProps } from '../../Types';
7+
import { TextAreaCommandOrchestrator, type ICommand } from '../../commands/';
78
import './index.less';
89

910
type RenderTextareaHandle = {
@@ -66,7 +67,7 @@ export default function TextArea(props: ITextAreaProps) {
6667
// eslint-disable-next-line react-hooks/exhaustive-deps
6768
}, []);
6869

69-
const textStyle: React.CSSProperties = { WebkitTextFillColor: 'initial', overflow: 'auto' };
70+
const textStyle: CSS.Properties = { WebkitTextFillColor: 'initial', overflow: 'auto' };
7071

7172
return (
7273
<div ref={warp} className={`${prefixCls}-area ${className || ''}`} onScroll={onScroll}>

core/src/components/TextArea/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React, { useEffect, Fragment, useContext, JSX } from 'react';
2-
import { EditorContext, ContextStore, ExecuteCommandState } from '../../Context';
2+
import type * as CSS from 'csstype';
3+
import { EditorContext, type ContextStore, type ExecuteCommandState } from '../../Context';
34
import shortcuts from './shortcuts';
45
import Markdown from './Markdown';
5-
import Textarea, { TextAreaProps } from './Textarea';
6-
import { IProps } from '../../Types';
7-
import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
6+
import Textarea, { type TextAreaProps } from './Textarea';
7+
import { type IProps } from '../../Types';
8+
import { TextAreaCommandOrchestrator, type ICommand } from '../../commands/';
89
import './index.less';
910

1011
type RenderTextareaHandle = {
@@ -68,7 +69,7 @@ export default function TextArea(props: ITextAreaProps) {
6869
// eslint-disable-next-line react-hooks/exhaustive-deps
6970
}, []);
7071

71-
const textStyle: React.CSSProperties = highlightEnable ? {} : { WebkitTextFillColor: 'initial', overflow: 'auto' };
72+
const textStyle: CSS.Properties = highlightEnable ? {} : { WebkitTextFillColor: 'initial', overflow: 'auto' };
7273

7374
return (
7475
<div ref={warp} className={`${prefixCls}-area ${className || ''}`} onScroll={onScroll}>

core/src/components/Toolbar/Child.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, useMemo, JSX } from 'react';
1+
import React, { useContext, useMemo, type JSX } from 'react';
22
import './Child.less';
33
import Toolbar, { type IToolbarProps } from './';
44
import { EditorContext } from '../../Context';

core/src/components/Toolbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Fragment, useContext, useEffect, useRef } from 'react';
2-
import { IProps } from '../../Types';
3-
import { EditorContext, PreviewType, ContextStore } from '../../Context';
2+
import { type IProps } from '../../Types';
3+
import { EditorContext, type PreviewType, type ContextStore } from '../../Context';
44
import { ICommand } from '../../commands/';
55
import Child from './Child';
66
import './index.less';

0 commit comments

Comments
 (0)