Skip to content

Commit da63f64

Browse files
committed
feat: export defaultTheme api.
1 parent 87cef19 commit da63f64

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export interface IMarkdownEditor extends ReactCodeMirrorProps {
257257
import React from 'react';
258258
import { ReactCodeMirrorRef } from '@uiw/react-codemirror';
259259
import { MarkdownPreviewProps, MarkdownPreviewRef } from '@uiw/react-markdown-preview';
260+
export * from '@uiw/react-markdown-preview';
260261
export interface ToolBarProps {
261262
editor: React.RefObject<ReactCodeMirrorRef>;
262263
preview: React.RefObject<HTMLDivElement>;
@@ -276,6 +277,16 @@ export interface IToolBarProps<T = keyof typeof defaultCommands | ICommand> exte
276277
toolbars?: T[];
277278
onClick?: (type: string) => void;
278279
}
280+
declare const MarkdownEditor: MarkdownEditorComponent;
281+
declare type MarkdownEditorComponent = React.FC<React.PropsWithRef<IMarkdownEditor>> & {
282+
Markdown: typeof MarkdownPreview;
283+
};
284+
export default MarkdownEditor;
285+
```
286+
287+
```ts
288+
import { ReactCodeMirrorRef } from '@uiw/react-codemirror';
289+
import { MarkdownPreviewProps, MarkdownPreviewRef } from '@uiw/react-markdown-preview';
279290
export declare type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: ToolBarProps) => JSX.Element;
280291
export declare type ICommand = {
281292
icon?: React.ReactElement;
@@ -285,27 +296,26 @@ export declare type ICommand = {
285296
execute?: (editor: ReactCodeMirrorRef) => void;
286297
};
287298
export declare const defaultCommands: {
299+
undo: ICommand;
300+
redo: ICommand;
288301
bold: ICommand;
289302
italic: ICommand;
290303
header: ICommand;
291304
strike: ICommand;
292305
underline: ICommand;
306+
quote: ICommand;
293307
olist: ICommand;
294308
ulist: ICommand;
295-
link: ICommand;
296309
todo: ICommand;
310+
link: ICommand;
297311
image: ICommand;
298312
fullscreen: ICommand;
299313
preview: ICommand;
300314
};
301315
export declare const getCommands: () => ICommand[];
302316
export declare const getModeCommands: () => ICommand[];
317+
export declare const defaultTheme: import("@codemirror/state").Extension;
303318

304-
declare const MarkdownEditor: MarkdownEditorComponent;
305-
declare type MarkdownEditorComponent = React.FC<React.PropsWithRef<IMarkdownEditor>> & {
306-
Markdown: typeof MarkdownPreview;
307-
};
308-
export default MarkdownEditor;
309319
```
310320

311321
### Development

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getCommands, getModeCommands } from './commands';
99
import { defaultTheme } from './theme';
1010
import './index.less';
1111

12+
export * from './theme';
1213
export * from './commands';
1314
export * from '@uiw/react-markdown-preview';
1415

0 commit comments

Comments
 (0)