@types/markdown-draft-js
TypeScript icon, indicating that this package has built-in type declarations

2.2.7 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/markdown-draft-js

Weekly Downloads

28,825

Version

2.2.7

License

MIT

Unpacked Size

5.49 kB

Total Files

5

Last publish

Collaborators

  • types