Skip to content

Commit

Permalink
chore: add missing type import (#1650)
Browse files Browse the repository at this point in the history
* chore: add missing type

* chore: add missing type(table plugin)

* chore: fix broken type
  • Loading branch information
js87zz authored Jul 7, 2021
1 parent 1df1fb8 commit e38a81e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
9 changes: 8 additions & 1 deletion apps/editor/types/editor.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { Schema, NodeSpec, MarkSpec, Fragment } from 'prosemirror-model';
import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
import { EditorState, Plugin, Selection, TextSelection } from 'prosemirror-state';
import { HTMLConvertor, MdPos, Sourcepos, Context as MdContext } from './toastmark';
import {
HTMLConvertor,
MdPos,
Sourcepos,
Context as MdContext,
HTMLToken,
HTMLConvertorMap,
} from './toastmark';
import { Emitter, Handler } from './event';
import { Context, EditorAllCommandMap, EditorCommandFn, SpecManager } from './spec';
import { ToMdConvertorMap } from './convertor';
Expand Down
6 changes: 3 additions & 3 deletions apps/editor/types/plugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EditorView, NodeView } from 'prosemirror-view';
import { Node } from 'prosemirror-model';

import { CustomParserMap } from './toastmark';
import { CustomHTMLRendererOpt } from './editor';
import { CustomHTMLRenderer } from './editor';
import { Emitter } from './event';
import { ToMdConvertorMap } from './convertor';
import { Dispatch, Payload, DefaultPayload } from './spec';
Expand Down Expand Up @@ -35,7 +35,7 @@ interface PluginToolbarItem {
}

export interface PluginInfo {
toHTMLRenderers?: CustomHTMLRendererOpt;
toHTMLRenderers?: CustomHTMLRenderer;
toMarkdownRenderers?: ToMdConvertorMap;
markdownPlugins?: PluginProp[];
wysiwygPlugins?: PluginProp[];
Expand All @@ -47,7 +47,7 @@ export interface PluginInfo {
}

export interface PluginInfoResult {
toHTMLRenderers: CustomHTMLRendererOpt;
toHTMLRenderers: CustomHTMLRenderer;
toMarkdownRenderers: ToMdConvertorMap;
mdPlugins: PluginProp[];
wwPlugins: PluginProp[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('languageSelectBox', () => {
removeEventHandler: jest.fn(),
addEventType: jest.fn(),
getEvents: jest.fn(),
holdEventInvoke: jest.fn(),
};

wwContainer = document.createElement('div');
Expand Down
4 changes: 2 additions & 2 deletions plugins/table-merged-cell/src/markdown/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ToHTMLConvertorMap } from '@toast-ui/editor';
import type { CustomHTMLRenderer } from '@toast-ui/editor';
import type { OpenTagToken } from '@toast-ui/toastmark';
import { MergedTableCellMdNode, MergedTableRowMdNode } from '@t/index';

export const toHTMLRenderers: ToHTMLConvertorMap = {
export const toHTMLRenderers: CustomHTMLRenderer = {
// @ts-ignore
tableRow(node: MergedTableRowMdNode, { entering, origin }) {
if (entering) {
Expand Down
17 changes: 8 additions & 9 deletions plugins/table-merged-cell/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { PluginCommandMap } from '@toast-ui/editor';
import type { TableCellMdNode, TableMdNode } from '@toast-ui/toastmark';
import type { PluginCommandMap, TableMdNode, TableCellMdNode, MdNode } from '@toast-ui/editor';
import type { Selection } from 'prosemirror-state';
import type { Node, ResolvedPos } from 'prosemirror-model';

Expand All @@ -17,18 +16,18 @@ interface TableHeadMdNode extends MdNode {
type SpanType = '@cols' | '@rows';

export interface MergedTableRowMdNode extends MdNode {
firstChild: MergedTableCell | null;
lastChild: MergedTableCell | null;
firstChild: MergedTableCellMdNode | null;
lastChild: MergedTableCellMdNode | null;
parent: TableBodyMdNode | TableHeadMdNode;
prev: MergedTableRow | null;
next: MergedTableRow | null;
prev: MergedTableRowMdNode | null;
next: MergedTableRowMdNode | null;
rowspanMap: { [key: string]: number };
}

export interface MergedTableCellMdNode extends TableCellMdNode {
prev: MergedTableCell | null;
next: MergedTableCell | null;
parent: MergedTableRow;
prev: MergedTableCellMdNode | null;
next: MergedTableCellMdNode | null;
parent: MergedTableRowMdNode;
}

export interface CellSelection extends Selection {
Expand Down

0 comments on commit e38a81e

Please sign in to comment.