From 3b1eee6c0c06c7b79856d1522d175b892cc34a26 Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 24 Jan 2019 10:52:34 -0800 Subject: [PATCH 1/2] NodeType type --- types/commonmark/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/commonmark/index.d.ts b/types/commonmark/index.d.ts index 96bb2774c5..9af9f0e23b 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -4,15 +4,18 @@ // Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type NodeType = + 'text' |'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | + 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block' + export class Node { - constructor(nodeType: string, sourcepos?: Position); + constructor(nodeType: NodeType, sourcepos?: Position); /** * (read-only): a String, one of text, softbreak, linebreak, emph, strong, html_inline, link, image, code, document, paragraph, * block_quote, item, list, heading, code_block, html_block, thematic_break. */ - readonly type: 'text' | 'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | - 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; + readonly type: NodeType; /** * (read-only): a Node or null. */ From a625d316c5433fd14ca6cef925b75cf942b7293b Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 24 Jan 2019 16:50:17 -0800 Subject: [PATCH 2/2] Update index.d.ts --- types/commonmark/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/commonmark/index.d.ts b/types/commonmark/index.d.ts index 9af9f0e23b..2f2899b44a 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -4,9 +4,9 @@ // Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export type NodeType = +export type NodeType = 'text' |'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | - 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block' + 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; export class Node { constructor(nodeType: NodeType, sourcepos?: Position);