@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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.421,593ts3.6
2.2.421,593ts3.7
2.2.421,593ts3.8
2.2.421,593ts3.9
2.2.421,593ts4.0
2.2.421,593ts4.1
2.2.421,593ts4.2
2.2.421,593ts4.3
2.2.421,593ts4.4
2.2.713,418ts5.6
2.2.713,418latest
2.2.713,418ts4.5
2.2.713,418ts4.6
2.2.713,418ts4.7
2.2.713,418ts4.8
2.2.713,418ts4.9
2.2.713,418ts5.0
2.2.713,418ts5.1
2.2.713,418ts5.2
2.2.713,418ts5.3
2.2.713,418ts5.4
2.2.713,418ts5.5
2.2.713,418ts5.7
2.2.1140ts3.0
2.2.1140ts3.1
2.2.260ts3.2
2.2.260ts3.3
2.2.260ts3.4
2.2.260ts3.5

Version History

VersionDownloads (Last 7 Days)Published
2.2.713,418
2.2.6109
2.2.51,296
2.2.421,593
2.2.30
2.2.260
2.2.1140
2.2.00

Package Sidebar

Install

npm i @types/markdown-draft-js

Weekly Downloads

30,675

Version

2.2.7

License

MIT

Unpacked Size

5.49 kB

Total Files

5

Last publish

Collaborators

  • types