Skip to content

Commit

Permalink
fix: broken type of plugin option when using table-merged-cell plugin (
Browse files Browse the repository at this point in the history
…fix #1160) (#1164)
  • Loading branch information
seonim-ryu authored Aug 26, 2020
1 parent 855abe6 commit 60e747a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/editor/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ declare namespace toastui {
origin?: () => ReturnType<CustomHTMLRenderer>;
}

export type CustomHTMLRenderer = (node: MdNode, context: Context) => HTMLToken | HTMLToken[] | null;
export type CustomHTMLRenderer = (
node: MdNode,
context: Context
) => HTMLToken | HTMLToken[] | null;

type CustomHTMLRendererMap = Partial<Record<NodeType, CustomHTMLRenderer>>;
// Toastmark custom renderer type end
Expand Down Expand Up @@ -208,6 +211,15 @@ declare namespace toastui {
renderer?: any;
}

type CustomParser = (node: MdNode, context: { entering: boolean }) => void;
type CustomParserMap = Partial<Record<NodeType, CustomParser>>;

interface PluginInfo {
pluginFn: Plugin;
renderer: CustomHTMLRendererMap;
parser: CustomParserMap;
}

export interface Convertor {
initHtmlSanitizer(sanitizer: Sanitizer): void;
toHTML(makrdown: string): string;
Expand Down Expand Up @@ -241,7 +253,7 @@ declare namespace toastui {
usageStatistics?: boolean;
toolbarItems?: (string | ToolbarButton)[];
hideModeSwitch?: boolean;
plugins?: Plugin[];
plugins?: (Plugin | PluginInfo)[];
extendedAutolinks?: ExtendedAutolinks;
customConvertor?: ConvertorClass;
placeholder?: string;
Expand Down

0 comments on commit 60e747a

Please sign in to comment.