Installation
npm install --save @types/markdown-draft-js
Summary
This package contains type definitions for markdown-draft-js (https://github.com/Rosey/markdown-draft-js#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-draft-js.
index.d.ts
import { Entity, RawDraftContentState } from "draft-js";
export interface BlockEntitiesParam {
[key: string]: (item?: { [key: string]: any }) => Entity;
}
export interface BlockTypesParam {
[key: string]: (item?: {
[key: string]: any;
}) => {
[key: string]: any;
};
}
export interface MarkdownToDraftOptions {
blockEntities?: BlockEntitiesParam | undefined;
blockStyles?: {
[key: string]: string;
} | undefined;
blockTypes?: BlockTypesParam | undefined;
remarkableOptions?: {
[key: string]: boolean | {};
} | undefined;
remarkablePlugins?: any[] | undefined;
remarkablePreset?: string | undefined;
preserveNewlines?: boolean | undefined;
}
export interface DraftToMarkdownOptions {
entityItems?: {
[key: string]: {
open: (entity?: Entity) => string;
close: (entity?: Entity) => string;
};
} | undefined;
styleItems?: {
[key: string]: {
open: () => string;
close: () => string;
};
} | undefined;
preserveNewlines?: boolean | undefined;
escapeMarkdownCharacters?: boolean | undefined;
}
export function markdownToDraft(markdown: string, options?: MarkdownToDraftOptions): RawDraftContentState;
export function draftToMarkdown(RawDraft: RawDraftContentState, options?: DraftToMarkdownOptions): string;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/draft-js
Credits
These definitions were written by Yuri Drabik.