chrome-devtools-frontend 1.0.1636056 → 1.0.1640418

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/front_end/core/common/Color.ts +0 -4
  2. package/front_end/core/host/AidaClientTypes.ts +8 -6
  3. package/front_end/core/root/Runtime.ts +2 -2
  4. package/front_end/core/sdk/DOMStorageModel.ts +1 -1
  5. package/front_end/core/sdk/SourceMap.ts +8 -3
  6. package/front_end/core/sdk/TargetManager.ts +14 -1
  7. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +147 -0
  8. package/front_end/generated/ARIAProperties.js +17 -4
  9. package/front_end/generated/InspectorBackendCommands.ts +13 -7
  10. package/front_end/generated/SupportedCSSProperties.js +1 -0
  11. package/front_end/generated/protocol-mapping.d.ts +7 -0
  12. package/front_end/generated/protocol-proxy-api.d.ts +14 -0
  13. package/front_end/generated/protocol.ts +120 -2
  14. package/front_end/global_typings/global_defs.d.ts +13 -0
  15. package/front_end/models/ai_assistance/AiAgent2.ts +116 -0
  16. package/front_end/models/ai_assistance/AiConversation.ts +22 -36
  17. package/front_end/models/ai_assistance/AiHistoryStorage.ts +0 -1
  18. package/front_end/models/ai_assistance/AiOrigins.ts +46 -0
  19. package/front_end/models/ai_assistance/AiUtils.ts +9 -0
  20. package/front_end/models/ai_assistance/README.md +16 -0
  21. package/front_end/models/ai_assistance/StorageItem.ts +30 -26
  22. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +12 -5
  23. package/front_end/models/ai_assistance/agents/AiAgent.ts +86 -32
  24. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
  25. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +31 -10
  26. package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +1 -1
  27. package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
  28. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +1 -3
  29. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +19 -0
  30. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +9 -4
  31. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  32. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +41 -12
  33. package/front_end/models/ai_assistance/agents/StorageAgent.ts +442 -122
  34. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
  35. package/front_end/models/ai_assistance/ai_assistance.ts +4 -2
  36. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +2 -2
  37. package/front_end/models/ai_assistance/performance/AIContext.ts +7 -8
  38. package/front_end/models/ai_assistance/skills/README.md +40 -0
  39. package/front_end/models/ai_assistance/skills/Skill.ts +13 -0
  40. package/front_end/models/ai_assistance/skills/SkillRegistry.ts +10 -0
  41. package/front_end/models/ai_assistance/skills/styling.md +6 -0
  42. package/front_end/models/bindings/CompilerScriptMapping.ts +12 -4
  43. package/front_end/models/breakpoints/BreakpointManager.ts +54 -2
  44. package/front_end/models/greendev/Prototypes.ts +0 -7
  45. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +20 -0
  46. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +5 -0
  47. package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +293 -0
  48. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  49. package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
  50. package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
  51. package/front_end/models/issues_manager/descriptions/emailVerificationRequestInvalidEmail.md +1 -0
  52. package/front_end/models/issues_manager/descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
  53. package/front_end/models/issues_manager/descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
  54. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
  55. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
  56. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
  57. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
  58. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
  59. package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
  60. package/front_end/models/issues_manager/descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
  61. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
  62. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
  63. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
  64. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
  65. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
  66. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
  67. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
  68. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
  69. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
  70. package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
  71. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  72. package/front_end/models/javascript_metadata/NativeFunctions.js +1748 -1739
  73. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -1
  74. package/front_end/models/stack_trace/DetailedErrorStackParser.ts +9 -1
  75. package/front_end/models/stack_trace/StackTraceImpl.ts +29 -9
  76. package/front_end/models/stack_trace/StackTraceModel.ts +23 -11
  77. package/front_end/models/stack_trace/Trie.ts +11 -1
  78. package/front_end/models/trace/extras/TraceTree.ts +20 -1
  79. package/front_end/models/trace/insights/Common.ts +9 -0
  80. package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +21 -25
  81. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +19 -75
  82. package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +10 -3
  83. package/front_end/panels/ai_assistance/components/ChatMessage.ts +148 -2
  84. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -3
  85. package/front_end/panels/ai_assistance/components/chatMessage.css +27 -0
  86. package/front_end/panels/application/CookieItemsView.ts +24 -0
  87. package/front_end/panels/application/DOMStorageItemsView.ts +9 -4
  88. package/front_end/panels/application/preloading/components/PreloadingString.ts +6 -0
  89. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
  90. package/front_end/panels/console/ConsoleViewMessage.ts +13 -102
  91. package/front_end/panels/elements/StandaloneStylesContainer.ts +10 -0
  92. package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
  93. package/front_end/panels/elements/StylePropertyTreeElement.ts +30 -1
  94. package/front_end/panels/elements/StylesContainer.ts +3 -0
  95. package/front_end/panels/elements/StylesSidebarPane.ts +54 -4
  96. package/front_end/panels/elements/elements-meta.ts +14 -0
  97. package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
  98. package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
  99. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +4 -4
  100. package/front_end/panels/network/NetworkDataGridNode.ts +14 -0
  101. package/front_end/panels/network/NetworkLogViewColumns.ts +2 -2
  102. package/front_end/panels/network/RequestHeadersView.ts +55 -19
  103. package/front_end/panels/network/networkTimingTable.css +2 -4
  104. package/front_end/panels/recorder/components/ReplaySection.ts +28 -16
  105. package/front_end/panels/recorder/converters/LighthouseConverter.snapshot.txt +47 -0
  106. package/front_end/panels/recorder/converters/PuppeteerConverter.snapshot.txt +49 -0
  107. package/front_end/panels/recorder/converters/PuppeteerReplayConverter.snapshot.txt +33 -0
  108. package/front_end/panels/settings/SettingsScreen.ts +1 -2
  109. package/front_end/panels/sources/BreakpointsView.ts +23 -42
  110. package/front_end/panels/sources/DebuggerPlugin.ts +12 -5
  111. package/front_end/panels/sources/ScopeChainSidebarPane.ts +169 -106
  112. package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -0
  113. package/front_end/third_party/chromium/README.chromium +1 -1
  114. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +2 -2
  115. package/front_end/third_party/marked/README.chromium +3 -6
  116. package/front_end/third_party/marked/package/README.md +5 -5
  117. package/front_end/third_party/marked/package/bin/main.js +27 -22
  118. package/front_end/third_party/marked/package/bin/marked.js +2 -1
  119. package/front_end/third_party/marked/package/lib/marked.esm.d.ts +346 -256
  120. package/front_end/third_party/marked/package/lib/marked.esm.js +67 -2698
  121. package/front_end/third_party/marked/package/lib/marked.esm.js.map +7 -1
  122. package/front_end/third_party/marked/package/lib/marked.umd.js +69 -2722
  123. package/front_end/third_party/marked/package/lib/marked.umd.js.map +7 -1
  124. package/front_end/third_party/marked/package/man/marked.1 +4 -2
  125. package/front_end/third_party/marked/package/man/marked.1.md +2 -1
  126. package/front_end/third_party/marked/package/package.json +49 -57
  127. package/front_end/third_party/puppeteer-replay/README.chromium +2 -2
  128. package/front_end/third_party/puppeteer-replay/package/lib/cli.js +84 -80
  129. package/front_end/third_party/puppeteer-replay/package/lib/cli.js.map +1 -1
  130. package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js +79 -83
  131. package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js.map +1 -1
  132. package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +43 -171
  133. package/front_end/third_party/puppeteer-replay/package/lib/main.js +51 -206
  134. package/front_end/third_party/puppeteer-replay/package/lib/main.js.map +1 -1
  135. package/front_end/third_party/puppeteer-replay/package/package.json +37 -67
  136. package/front_end/tsconfig.json +1 -1
  137. package/front_end/ui/components/markdown_view/CodeBlock.ts +17 -6
  138. package/front_end/ui/components/markdown_view/MarkdownView.ts +39 -3
  139. package/front_end/ui/components/markdown_view/codeBlock.css +11 -0
  140. package/front_end/ui/components/markdown_view/markdownView.css +17 -0
  141. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +0 -79
  142. package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +16 -4
  143. package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
  144. package/inspector_overlay/testing/InspectorOverlayHelpers.ts +2 -0
  145. package/mcp/mcp.ts +1 -6
  146. package/package.json +14 -16
  147. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1015
  148. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgentOverlay.ts +0 -87
  149. package/front_end/third_party/marked/package/bin/marked +0 -215
  150. package/front_end/third_party/marked/package/lib/marked.cjs +0 -2726
  151. package/front_end/third_party/marked/package/lib/marked.cjs.map +0 -1
  152. package/front_end/third_party/marked/package/lib/marked.d.cts +0 -670
  153. package/front_end/third_party/marked/package/lib/marked.js +0 -2780
  154. package/front_end/third_party/marked/package/man/marked.1.txt +0 -86
  155. package/front_end/third_party/marked/package/marked.min.js +0 -6
  156. package/front_end/third_party/marked/package/src/Lexer.js +0 -492
  157. package/front_end/third_party/marked/package/src/Parser.js +0 -286
  158. package/front_end/third_party/marked/package/src/Renderer.js +0 -166
  159. package/front_end/third_party/marked/package/src/Slugger.js +0 -49
  160. package/front_end/third_party/marked/package/src/TextRenderer.js +0 -42
  161. package/front_end/third_party/marked/package/src/Tokenizer.js +0 -755
  162. package/front_end/third_party/marked/package/src/defaults.js +0 -29
  163. package/front_end/third_party/marked/package/src/helpers.js +0 -249
  164. package/front_end/third_party/marked/package/src/marked.js +0 -350
  165. package/front_end/third_party/marked/package/src/rules.js +0 -285
  166. package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs +0 -2099
  167. package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs.map +0 -1
  168. package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.cts +0 -686
  169. package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.ts +0 -35
  170. package/mcp/HostBindings.ts +0 -319
  171. /package/front_end/third_party/marked/package/{LICENSE.md → LICENSE} +0 -0
@@ -1,79 +1,76 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- export type MarkedToken = (Tokens.Space | Tokens.Code | Tokens.Heading | Tokens.Table | Tokens.Hr | Tokens.Blockquote | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.HTML | Tokens.Text | Tokens.Def | Tokens.Escape | Tokens.Tag | Tokens.Image | Tokens.Link | Tokens.Strong | Tokens.Em | Tokens.Codespan | Tokens.Br | Tokens.Del);
3
+ export type MarkedToken = (Tokens.Blockquote | Tokens.Br | Tokens.Checkbox | Tokens.Code | Tokens.Codespan | Tokens.Def | Tokens.Del | Tokens.Em | Tokens.Escape | Tokens.Heading | Tokens.Hr | Tokens.HTML | Tokens.Image | Tokens.Link | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.Space | Tokens.Strong | Tokens.Table | Tokens.Tag | Tokens.Text);
4
4
  export type Token = (MarkedToken | Tokens.Generic);
5
5
  export declare namespace Tokens {
6
- interface Space {
7
- type: "space";
6
+ interface Blockquote {
7
+ type: "blockquote";
8
+ raw: string;
9
+ text: string;
10
+ tokens: Token[];
11
+ }
12
+ interface Br {
13
+ type: "br";
14
+ raw: string;
15
+ }
16
+ interface Checkbox {
17
+ type: "checkbox";
8
18
  raw: string;
19
+ checked: boolean;
9
20
  }
10
21
  interface Code {
11
22
  type: "code";
12
23
  raw: string;
13
- codeBlockStyle?: "indented" | undefined;
14
- lang?: string | undefined;
24
+ codeBlockStyle?: "indented";
25
+ lang?: string;
15
26
  text: string;
16
27
  escaped?: boolean;
17
28
  }
18
- interface Heading {
19
- type: "heading";
29
+ interface Codespan {
30
+ type: "codespan";
20
31
  raw: string;
21
- depth: number;
22
32
  text: string;
23
- tokens: Token[];
24
33
  }
25
- interface Table {
26
- type: "table";
34
+ interface Def {
35
+ type: "def";
27
36
  raw: string;
28
- align: Array<"center" | "left" | "right" | null>;
29
- header: TableCell[];
30
- rows: TableCell[][];
31
- }
32
- interface TableRow {
33
- text: string;
37
+ tag: string;
38
+ href: string;
39
+ title: string;
34
40
  }
35
- interface TableCell {
41
+ interface Del {
42
+ type: "del";
43
+ raw: string;
36
44
  text: string;
37
45
  tokens: Token[];
38
- header: boolean;
39
- align: "center" | "left" | "right" | null;
40
46
  }
41
- interface Hr {
42
- type: "hr";
47
+ interface Em {
48
+ type: "em";
43
49
  raw: string;
50
+ text: string;
51
+ tokens: Token[];
44
52
  }
45
- interface Blockquote {
46
- type: "blockquote";
53
+ interface Escape {
54
+ type: "escape";
47
55
  raw: string;
48
56
  text: string;
49
- tokens: Token[];
50
57
  }
51
- interface List {
52
- type: "list";
58
+ interface Generic {
59
+ [index: string]: any;
60
+ type: string;
53
61
  raw: string;
54
- ordered: boolean;
55
- start: number | "";
56
- loose: boolean;
57
- items: ListItem[];
62
+ tokens?: Token[];
58
63
  }
59
- interface ListItem {
60
- type: "list_item";
64
+ interface Heading {
65
+ type: "heading";
61
66
  raw: string;
62
- task: boolean;
63
- checked?: boolean | undefined;
64
- loose: boolean;
67
+ depth: number;
65
68
  text: string;
66
69
  tokens: Token[];
67
70
  }
68
- interface Checkbox {
69
- checked: boolean;
70
- }
71
- interface Paragraph {
72
- type: "paragraph";
71
+ interface Hr {
72
+ type: "hr";
73
73
  raw: string;
74
- pre?: boolean | undefined;
75
- text: string;
76
- tokens: Token[];
77
74
  }
78
75
  interface HTML {
79
76
  type: "html";
@@ -82,46 +79,49 @@ export declare namespace Tokens {
82
79
  text: string;
83
80
  block: boolean;
84
81
  }
85
- interface Text {
86
- type: "text";
82
+ interface Image {
83
+ type: "image";
87
84
  raw: string;
85
+ href: string;
86
+ title: string | null;
88
87
  text: string;
89
- tokens?: Token[];
88
+ tokens: Token[];
90
89
  }
91
- interface Def {
92
- type: "def";
90
+ interface Link {
91
+ type: "link";
93
92
  raw: string;
94
- tag: string;
95
93
  href: string;
96
- title: string;
94
+ title?: string | null;
95
+ text: string;
96
+ tokens: Token[];
97
97
  }
98
- interface Escape {
99
- type: "escape";
98
+ interface List {
99
+ type: "list";
100
100
  raw: string;
101
- text: string;
101
+ ordered: boolean;
102
+ start: number | "";
103
+ loose: boolean;
104
+ items: ListItem[];
102
105
  }
103
- interface Tag {
104
- type: "text" | "html";
106
+ interface ListItem {
107
+ type: "list_item";
105
108
  raw: string;
106
- inLink: boolean;
107
- inRawBlock: boolean;
109
+ task: boolean;
110
+ checked?: boolean;
111
+ loose: boolean;
108
112
  text: string;
109
- block: boolean;
113
+ tokens: Token[];
110
114
  }
111
- interface Link {
112
- type: "link";
115
+ interface Paragraph {
116
+ type: "paragraph";
113
117
  raw: string;
114
- href: string;
115
- title?: string | null;
118
+ pre?: boolean;
116
119
  text: string;
117
120
  tokens: Token[];
118
121
  }
119
- interface Image {
120
- type: "image";
122
+ interface Space {
123
+ type: "space";
121
124
  raw: string;
122
- href: string;
123
- title: string | null;
124
- text: string;
125
125
  }
126
126
  interface Strong {
127
127
  type: "strong";
@@ -129,32 +129,36 @@ export declare namespace Tokens {
129
129
  text: string;
130
130
  tokens: Token[];
131
131
  }
132
- interface Em {
133
- type: "em";
132
+ interface Table {
133
+ type: "table";
134
134
  raw: string;
135
- text: string;
136
- tokens: Token[];
135
+ align: Array<"center" | "left" | "right" | null>;
136
+ header: TableCell[];
137
+ rows: TableCell[][];
137
138
  }
138
- interface Codespan {
139
- type: "codespan";
140
- raw: string;
139
+ interface TableCell {
141
140
  text: string;
141
+ tokens: Token[];
142
+ header: boolean;
143
+ align: "center" | "left" | "right" | null;
142
144
  }
143
- interface Br {
144
- type: "br";
145
- raw: string;
145
+ interface TableRow<P = string> {
146
+ text: P;
146
147
  }
147
- interface Del {
148
- type: "del";
148
+ interface Tag {
149
+ type: "html";
149
150
  raw: string;
151
+ inLink: boolean;
152
+ inRawBlock: boolean;
150
153
  text: string;
151
- tokens: Token[];
154
+ block: boolean;
152
155
  }
153
- interface Generic {
154
- [index: string]: any;
155
- type: string;
156
+ interface Text {
157
+ type: "text";
156
158
  raw: string;
157
- tokens?: Token[] | undefined;
159
+ text: string;
160
+ tokens?: Token[];
161
+ escaped?: boolean;
158
162
  }
159
163
  }
160
164
  export type Links = Record<string, Pick<Tokens.Link | Tokens.Image, "href" | "title">>;
@@ -164,75 +168,135 @@ export type TokensList = Token[] & {
164
168
  /**
165
169
  * Renderer
166
170
  */
167
- declare class _Renderer {
168
- options: MarkedOptions;
169
- parser: _Parser;
170
- constructor(options?: MarkedOptions);
171
- space(token: Tokens.Space): string;
172
- code({ text, lang, escaped }: Tokens.Code): string;
173
- blockquote({ tokens }: Tokens.Blockquote): string;
174
- html({ text }: Tokens.HTML | Tokens.Tag): string;
175
- heading({ tokens, depth }: Tokens.Heading): string;
176
- hr(token: Tokens.Hr): string;
177
- list(token: Tokens.List): string;
178
- listitem(item: Tokens.ListItem): string;
179
- checkbox({ checked }: Tokens.Checkbox): string;
180
- paragraph({ tokens }: Tokens.Paragraph): string;
181
- table(token: Tokens.Table): string;
182
- tablerow({ text }: Tokens.TableRow): string;
183
- tablecell(token: Tokens.TableCell): string;
171
+ declare class _Renderer<ParserOutput = string, RendererOutput = string> {
172
+ options: MarkedOptions<ParserOutput, RendererOutput>;
173
+ parser: _Parser<ParserOutput, RendererOutput>;
174
+ constructor(options?: MarkedOptions<ParserOutput, RendererOutput>);
175
+ space(token: Tokens.Space): RendererOutput;
176
+ code({ text, lang, escaped }: Tokens.Code): RendererOutput;
177
+ blockquote({ tokens }: Tokens.Blockquote): RendererOutput;
178
+ html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput;
179
+ def(token: Tokens.Def): RendererOutput;
180
+ heading({ tokens, depth }: Tokens.Heading): RendererOutput;
181
+ hr(token: Tokens.Hr): RendererOutput;
182
+ list(token: Tokens.List): RendererOutput;
183
+ listitem(item: Tokens.ListItem): RendererOutput;
184
+ checkbox({ checked }: Tokens.Checkbox): RendererOutput;
185
+ paragraph({ tokens }: Tokens.Paragraph): RendererOutput;
186
+ table(token: Tokens.Table): RendererOutput;
187
+ tablerow({ text }: Tokens.TableRow<ParserOutput>): RendererOutput;
188
+ tablecell(token: Tokens.TableCell): RendererOutput;
184
189
  /**
185
190
  * span level renderer
186
191
  */
187
- strong({ tokens }: Tokens.Strong): string;
188
- em({ tokens }: Tokens.Em): string;
189
- codespan({ text }: Tokens.Codespan): string;
190
- br(token: Tokens.Br): string;
191
- del({ tokens }: Tokens.Del): string;
192
- link({ href, title, tokens }: Tokens.Link): string;
193
- image({ href, title, text }: Tokens.Image): string;
194
- text(token: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
192
+ strong({ tokens }: Tokens.Strong): RendererOutput;
193
+ em({ tokens }: Tokens.Em): RendererOutput;
194
+ codespan({ text }: Tokens.Codespan): RendererOutput;
195
+ br(token: Tokens.Br): RendererOutput;
196
+ del({ tokens }: Tokens.Del): RendererOutput;
197
+ link({ href, title, tokens }: Tokens.Link): RendererOutput;
198
+ image({ href, title, text, tokens }: Tokens.Image): RendererOutput;
199
+ text(token: Tokens.Text | Tokens.Escape): RendererOutput;
195
200
  }
196
201
  /**
197
202
  * TextRenderer
198
203
  * returns only the textual part of the token
199
204
  */
200
- declare class _TextRenderer {
201
- strong({ text }: Tokens.Strong): string;
202
- em({ text }: Tokens.Em): string;
203
- codespan({ text }: Tokens.Codespan): string;
204
- del({ text }: Tokens.Del): string;
205
- html({ text }: Tokens.HTML | Tokens.Tag): string;
206
- text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
207
- link({ text }: Tokens.Link): string;
208
- image({ text }: Tokens.Image): string;
209
- br(): string;
205
+ declare class _TextRenderer<RendererOutput = string> {
206
+ strong({ text }: Tokens.Strong): RendererOutput;
207
+ em({ text }: Tokens.Em): RendererOutput;
208
+ codespan({ text }: Tokens.Codespan): RendererOutput;
209
+ del({ text }: Tokens.Del): RendererOutput;
210
+ html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput;
211
+ text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput;
212
+ link({ text }: Tokens.Link): RendererOutput;
213
+ image({ text }: Tokens.Image): RendererOutput;
214
+ br(): RendererOutput;
215
+ checkbox({ raw }: Tokens.Checkbox): RendererOutput;
210
216
  }
211
217
  /**
212
218
  * Parsing & Compiling
213
219
  */
214
- declare class _Parser {
215
- options: MarkedOptions;
216
- renderer: _Renderer;
217
- textRenderer: _TextRenderer;
218
- constructor(options?: MarkedOptions);
220
+ declare class _Parser<ParserOutput = string, RendererOutput = string> {
221
+ options: MarkedOptions<ParserOutput, RendererOutput>;
222
+ renderer: _Renderer<ParserOutput, RendererOutput>;
223
+ textRenderer: _TextRenderer<RendererOutput>;
224
+ constructor(options?: MarkedOptions<ParserOutput, RendererOutput>);
219
225
  /**
220
226
  * Static Parse Method
221
227
  */
222
- static parse(tokens: Token[], options?: MarkedOptions): string;
228
+ static parse<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>): ParserOutput;
223
229
  /**
224
230
  * Static Parse Inline Method
225
231
  */
226
- static parseInline(tokens: Token[], options?: MarkedOptions): string;
232
+ static parseInline<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>): ParserOutput;
227
233
  /**
228
234
  * Parse Loop
229
235
  */
230
- parse(tokens: Token[], top?: boolean): string;
236
+ parse(tokens: Token[]): ParserOutput;
231
237
  /**
232
238
  * Parse Inline Tokens
233
239
  */
234
- parseInline(tokens: Token[], renderer?: _Renderer | _TextRenderer): string;
240
+ parseInline(tokens: Token[], renderer?: _Renderer<ParserOutput, RendererOutput> | _TextRenderer<RendererOutput>): ParserOutput;
235
241
  }
242
+ declare const other: {
243
+ codeRemoveIndent: RegExp;
244
+ outputLinkReplace: RegExp;
245
+ indentCodeCompensation: RegExp;
246
+ beginningSpace: RegExp;
247
+ endingHash: RegExp;
248
+ startingSpaceChar: RegExp;
249
+ endingSpaceChar: RegExp;
250
+ nonSpaceChar: RegExp;
251
+ newLineCharGlobal: RegExp;
252
+ tabCharGlobal: RegExp;
253
+ multipleSpaceGlobal: RegExp;
254
+ blankLine: RegExp;
255
+ doubleBlankLine: RegExp;
256
+ blockquoteStart: RegExp;
257
+ blockquoteSetextReplace: RegExp;
258
+ blockquoteSetextReplace2: RegExp;
259
+ listReplaceNesting: RegExp;
260
+ listIsTask: RegExp;
261
+ listReplaceTask: RegExp;
262
+ listTaskCheckbox: RegExp;
263
+ anyLine: RegExp;
264
+ hrefBrackets: RegExp;
265
+ tableDelimiter: RegExp;
266
+ tableAlignChars: RegExp;
267
+ tableRowBlankLine: RegExp;
268
+ tableAlignRight: RegExp;
269
+ tableAlignCenter: RegExp;
270
+ tableAlignLeft: RegExp;
271
+ startATag: RegExp;
272
+ endATag: RegExp;
273
+ startPreScriptTag: RegExp;
274
+ endPreScriptTag: RegExp;
275
+ startAngleBracket: RegExp;
276
+ endAngleBracket: RegExp;
277
+ pedanticHrefTitle: RegExp;
278
+ unicodeAlphaNumeric: RegExp;
279
+ escapeTest: RegExp;
280
+ escapeReplace: RegExp;
281
+ escapeTestNoEncode: RegExp;
282
+ escapeReplaceNoEncode: RegExp;
283
+ caret: RegExp;
284
+ percentDecode: RegExp;
285
+ findPipe: RegExp;
286
+ splitPipe: RegExp;
287
+ slashPipe: RegExp;
288
+ carriageReturn: RegExp;
289
+ spaceLine: RegExp;
290
+ notSpaceStart: RegExp;
291
+ endingNewline: RegExp;
292
+ listItemRegex: (bull: string) => RegExp;
293
+ nextBulletRegex: (indent: number) => RegExp;
294
+ hrRegex: (indent: number) => RegExp;
295
+ fencesBeginRegex: (indent: number) => RegExp;
296
+ headingBeginRegex: (indent: number) => RegExp;
297
+ htmlBeginRegex: (indent: number) => RegExp;
298
+ blockquoteBeginRegex: (indent: number) => RegExp;
299
+ };
236
300
  declare const blockNormal: {
237
301
  blockquote: RegExp;
238
302
  code: RegExp;
@@ -257,6 +321,8 @@ declare const inlineNormal: {
257
321
  br: RegExp;
258
322
  code: RegExp;
259
323
  del: RegExp;
324
+ delLDelim: RegExp;
325
+ delRDelim: RegExp;
260
326
  emStrongLDelim: RegExp;
261
327
  emStrongRDelimAst: RegExp;
262
328
  emStrongRDelimUnd: RegExp;
@@ -271,66 +337,19 @@ declare const inlineNormal: {
271
337
  url: RegExp;
272
338
  };
273
339
  export type InlineKeys = keyof typeof inlineNormal;
274
- /**
275
- * exports
276
- */
277
- export declare const block: {
278
- normal: {
279
- blockquote: RegExp;
280
- code: RegExp;
281
- def: RegExp;
282
- fences: RegExp;
283
- heading: RegExp;
284
- hr: RegExp;
285
- html: RegExp;
286
- lheading: RegExp;
287
- list: RegExp;
288
- newline: RegExp;
289
- paragraph: RegExp;
290
- table: RegExp;
291
- text: RegExp;
292
- };
293
- gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
294
- pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
295
- };
296
- export declare const inline: {
297
- normal: {
298
- _backpedal: RegExp;
299
- anyPunctuation: RegExp;
300
- autolink: RegExp;
301
- blockSkip: RegExp;
302
- br: RegExp;
303
- code: RegExp;
304
- del: RegExp;
305
- emStrongLDelim: RegExp;
306
- emStrongRDelimAst: RegExp;
307
- emStrongRDelimUnd: RegExp;
308
- escape: RegExp;
309
- link: RegExp;
310
- nolink: RegExp;
311
- punctuation: RegExp;
312
- reflink: RegExp;
313
- reflinkSearch: RegExp;
314
- tag: RegExp;
315
- text: RegExp;
316
- url: RegExp;
317
- };
318
- gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
319
- breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
320
- pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
321
- };
322
340
  export interface Rules {
341
+ other: typeof other;
323
342
  block: Record<BlockKeys, RegExp>;
324
343
  inline: Record<InlineKeys, RegExp>;
325
344
  }
326
345
  /**
327
346
  * Tokenizer
328
347
  */
329
- declare class _Tokenizer {
330
- options: MarkedOptions;
348
+ declare class _Tokenizer<ParserOutput = string, RendererOutput = string> {
349
+ options: MarkedOptions<ParserOutput, RendererOutput>;
331
350
  rules: Rules;
332
- lexer: _Lexer;
333
- constructor(options?: MarkedOptions);
351
+ lexer: _Lexer<ParserOutput, RendererOutput>;
352
+ constructor(options?: MarkedOptions<ParserOutput, RendererOutput>);
334
353
  space(src: string): Tokens.Space | undefined;
335
354
  code(src: string): Tokens.Code | undefined;
336
355
  fences(src: string): Tokens.Code | undefined;
@@ -351,15 +370,17 @@ declare class _Tokenizer {
351
370
  emStrong(src: string, maskedSrc: string, prevChar?: string): Tokens.Em | Tokens.Strong | undefined;
352
371
  codespan(src: string): Tokens.Codespan | undefined;
353
372
  br(src: string): Tokens.Br | undefined;
354
- del(src: string): Tokens.Del | undefined;
373
+ del(src: string, maskedSrc: string, prevChar?: string): Tokens.Del | undefined;
355
374
  autolink(src: string): Tokens.Link | undefined;
356
375
  url(src: string): Tokens.Link | undefined;
357
376
  inlineText(src: string): Tokens.Text | undefined;
358
377
  }
359
- declare class _Hooks {
360
- options: MarkedOptions;
361
- constructor(options?: MarkedOptions);
378
+ declare class _Hooks<ParserOutput = string, RendererOutput = string> {
379
+ options: MarkedOptions<ParserOutput, RendererOutput>;
380
+ block?: boolean;
381
+ constructor(options?: MarkedOptions<ParserOutput, RendererOutput>);
362
382
  static passThroughHooks: Set<string>;
383
+ static passThroughHooksRespectAsync: Set<string>;
363
384
  /**
364
385
  * Process markdown before marked
365
386
  */
@@ -367,11 +388,23 @@ declare class _Hooks {
367
388
  /**
368
389
  * Process HTML after marked is finished
369
390
  */
370
- postprocess(html: string): string;
391
+ postprocess(html: ParserOutput): ParserOutput;
371
392
  /**
372
393
  * Process all tokens before walk tokens
373
394
  */
374
395
  processAllTokens(tokens: Token[] | TokensList): Token[] | TokensList;
396
+ /**
397
+ * Mask contents that should not be interpreted as em/strong delimiters
398
+ */
399
+ emStrongMask(src: string): string;
400
+ /**
401
+ * Provide function to tokenize markdown
402
+ */
403
+ provideLexer(block?: boolean | undefined): typeof _Lexer.lexInline;
404
+ /**
405
+ * Provide function to parse tokens
406
+ */
407
+ provideParser(block?: boolean | undefined): (tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput> | undefined) => ParserOutput;
375
408
  }
376
409
  export interface TokenizerThis {
377
410
  lexer: _Lexer;
@@ -381,32 +414,32 @@ export type TokenizerStartFunction = (this: TokenizerThis, src: string) => numbe
381
414
  export interface TokenizerExtension {
382
415
  name: string;
383
416
  level: "block" | "inline";
384
- start?: TokenizerStartFunction | undefined;
417
+ start?: TokenizerStartFunction;
385
418
  tokenizer: TokenizerExtensionFunction;
386
- childTokens?: string[] | undefined;
419
+ childTokens?: string[];
387
420
  }
388
- export interface RendererThis {
389
- parser: _Parser;
421
+ export interface RendererThis<ParserOutput = string, RendererOutput = string> {
422
+ parser: _Parser<ParserOutput, RendererOutput>;
390
423
  }
391
- export type RendererExtensionFunction = (this: RendererThis, token: Tokens.Generic) => string | false | undefined;
392
- export interface RendererExtension {
424
+ export type RendererExtensionFunction<ParserOutput = string, RendererOutput = string> = (this: RendererThis<ParserOutput, RendererOutput>, token: Tokens.Generic) => RendererOutput | false | undefined;
425
+ export interface RendererExtension<ParserOutput = string, RendererOutput = string> {
393
426
  name: string;
394
- renderer: RendererExtensionFunction;
427
+ renderer: RendererExtensionFunction<ParserOutput, RendererOutput>;
395
428
  }
396
- export type TokenizerAndRendererExtension = TokenizerExtension | RendererExtension | (TokenizerExtension & RendererExtension);
397
- export type HooksApi = Omit<_Hooks, "constructor" | "options">;
398
- export type HooksObject = {
399
- [K in keyof HooksApi]?: (this: _Hooks, ...args: Parameters<HooksApi[K]>) => ReturnType<HooksApi[K]> | Promise<ReturnType<HooksApi[K]>>;
429
+ export type TokenizerAndRendererExtension<ParserOutput = string, RendererOutput = string> = TokenizerExtension | RendererExtension<ParserOutput, RendererOutput> | (TokenizerExtension & RendererExtension<ParserOutput, RendererOutput>);
430
+ export type HooksApi<ParserOutput = string, RendererOutput = string> = Omit<_Hooks<ParserOutput, RendererOutput>, "constructor" | "options" | "block">;
431
+ export type HooksObject<ParserOutput = string, RendererOutput = string> = {
432
+ [K in keyof HooksApi<ParserOutput, RendererOutput>]?: (this: _Hooks<ParserOutput, RendererOutput>, ...args: Parameters<HooksApi<ParserOutput, RendererOutput>[K]>) => ReturnType<HooksApi<ParserOutput, RendererOutput>[K]> | Promise<ReturnType<HooksApi<ParserOutput, RendererOutput>[K]>>;
400
433
  };
401
- export type RendererApi = Omit<_Renderer, "constructor" | "options" | "parser">;
402
- export type RendererObject = {
403
- [K in keyof RendererApi]?: (this: _Renderer, ...args: Parameters<RendererApi[K]>) => ReturnType<RendererApi[K]> | false;
434
+ export type RendererApi<ParserOutput = string, RendererOutput = string> = Omit<_Renderer<ParserOutput, RendererOutput>, "constructor" | "options" | "parser">;
435
+ export type RendererObject<ParserOutput = string, RendererOutput = string> = {
436
+ [K in keyof RendererApi<ParserOutput, RendererOutput>]?: (this: _Renderer<ParserOutput, RendererOutput>, ...args: Parameters<RendererApi<ParserOutput, RendererOutput>[K]>) => ReturnType<RendererApi<ParserOutput, RendererOutput>[K]> | false;
404
437
  };
405
- export type TokenizerApi = Omit<_Tokenizer, "constructor" | "options" | "rules" | "lexer">;
406
- export type TokenizerObject = {
407
- [K in keyof TokenizerApi]?: (this: _Tokenizer, ...args: Parameters<TokenizerApi[K]>) => ReturnType<TokenizerApi[K]> | false;
438
+ export type TokenizerApi<ParserOutput = string, RendererOutput = string> = Omit<_Tokenizer<ParserOutput, RendererOutput>, "constructor" | "options" | "rules" | "lexer">;
439
+ export type TokenizerObject<ParserOutput = string, RendererOutput = string> = {
440
+ [K in keyof TokenizerApi<ParserOutput, RendererOutput>]?: (this: _Tokenizer<ParserOutput, RendererOutput>, ...args: Parameters<TokenizerApi<ParserOutput, RendererOutput>[K]>) => ReturnType<TokenizerApi<ParserOutput, RendererOutput>[K]> | false;
408
441
  };
409
- export interface MarkedExtension {
442
+ export interface MarkedExtension<ParserOutput = string, RendererOutput = string> {
410
443
  /**
411
444
  * True will tell marked to await any walkTokens functions before parsing the tokens and returning an HTML string.
412
445
  */
@@ -414,74 +447,72 @@ export interface MarkedExtension {
414
447
  /**
415
448
  * Enable GFM line breaks. This option requires the gfm option to be true.
416
449
  */
417
- breaks?: boolean | undefined;
450
+ breaks?: boolean;
418
451
  /**
419
452
  * Add tokenizers and renderers to marked
420
453
  */
421
- extensions?: TokenizerAndRendererExtension[] | undefined | null;
454
+ extensions?: TokenizerAndRendererExtension<ParserOutput, RendererOutput>[] | null;
422
455
  /**
423
456
  * Enable GitHub flavored markdown.
424
457
  */
425
- gfm?: boolean | undefined;
458
+ gfm?: boolean;
426
459
  /**
427
460
  * Hooks are methods that hook into some part of marked.
428
461
  * preprocess is called to process markdown before sending it to marked.
429
462
  * processAllTokens is called with the TokensList before walkTokens.
430
463
  * postprocess is called to process html after marked has finished parsing.
464
+ * emStrongMask is called to mask contents that should not be interpreted as em/strong delimiters.
465
+ * provideLexer is called to provide a function to tokenize markdown.
466
+ * provideParser is called to provide a function to parse tokens.
431
467
  */
432
- hooks?: HooksObject | undefined | null;
468
+ hooks?: HooksObject<ParserOutput, RendererOutput> | null;
433
469
  /**
434
470
  * Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
435
471
  */
436
- pedantic?: boolean | undefined;
472
+ pedantic?: boolean;
437
473
  /**
438
474
  * Type: object Default: new Renderer()
439
475
  *
440
476
  * An object containing functions to render tokens to HTML.
441
477
  */
442
- renderer?: RendererObject | undefined | null;
478
+ renderer?: RendererObject<ParserOutput, RendererOutput> | null;
443
479
  /**
444
480
  * Shows an HTML error message when rendering fails.
445
481
  */
446
- silent?: boolean | undefined;
482
+ silent?: boolean;
447
483
  /**
448
484
  * The tokenizer defines how to turn markdown text into tokens.
449
485
  */
450
- tokenizer?: TokenizerObject | undefined | null;
486
+ tokenizer?: TokenizerObject | null;
451
487
  /**
452
488
  * The walkTokens function gets called with every token.
453
489
  * Child tokens are called before moving on to sibling tokens.
454
490
  * Each token is passed by reference so updates are persisted when passed to the parser.
455
491
  * The return value of the function is ignored.
456
492
  */
457
- walkTokens?: ((token: Token) => void | Promise<void>) | undefined | null;
458
- /**
459
- * Use the new renderer that accepts an object instead of individual parameters.
460
- * This option will be removed and default to true in the next major version.
461
- */
462
- useNewRenderer?: boolean | undefined;
493
+ walkTokens?: ((token: Token) => void | Promise<void>) | null;
463
494
  }
464
- export interface MarkedOptions extends Omit<MarkedExtension, "useNewRenderer" | "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
495
+ export interface MarkedOptions<ParserOutput = string, RendererOutput = string> extends Omit<MarkedExtension<ParserOutput, RendererOutput>, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
465
496
  /**
466
497
  * Hooks are methods that hook into some part of marked.
467
498
  */
468
- hooks?: _Hooks | undefined | null;
499
+ hooks?: _Hooks<ParserOutput, RendererOutput> | null;
469
500
  /**
470
501
  * Type: object Default: new Renderer()
471
502
  *
472
503
  * An object containing functions to render tokens to HTML.
473
504
  */
474
- renderer?: _Renderer | undefined | null;
505
+ renderer?: _Renderer<ParserOutput, RendererOutput> | null;
475
506
  /**
476
507
  * The tokenizer defines how to turn markdown text into tokens.
477
508
  */
478
- tokenizer?: _Tokenizer | undefined | null;
509
+ tokenizer?: _Tokenizer<ParserOutput, RendererOutput> | null;
479
510
  /**
480
511
  * Custom extensions
481
512
  */
482
513
  extensions?: null | {
483
514
  renderers: {
484
- [name: string]: RendererExtensionFunction;
515
+ [name: string]: RendererExtensionFunction<ParserOutput, RendererOutput>;
485
516
  };
486
517
  childTokens: {
487
518
  [name: string]: string[];
@@ -499,17 +530,20 @@ export interface MarkedOptions extends Omit<MarkedExtension, "useNewRenderer" |
499
530
  /**
500
531
  * Block Lexer
501
532
  */
502
- declare class _Lexer {
533
+ declare class _Lexer<ParserOutput = string, RendererOutput = string> {
503
534
  tokens: TokensList;
504
- options: MarkedOptions;
535
+ options: MarkedOptions<ParserOutput, RendererOutput>;
505
536
  state: {
506
537
  inLink: boolean;
507
538
  inRawBlock: boolean;
508
539
  top: boolean;
509
540
  };
541
+ inlineQueue: {
542
+ src: string;
543
+ tokens: Token[];
544
+ }[];
510
545
  private tokenizer;
511
- private inlineQueue;
512
- constructor(options?: MarkedOptions);
546
+ constructor(options?: MarkedOptions<ParserOutput, RendererOutput>);
513
547
  /**
514
548
  * Expose Rules
515
549
  */
@@ -530,8 +564,8 @@ declare class _Lexer {
530
564
  table: RegExp;
531
565
  text: RegExp;
532
566
  };
533
- gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
534
- pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
567
+ gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>;
568
+ pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>;
535
569
  };
536
570
  inline: {
537
571
  normal: {
@@ -542,6 +576,8 @@ declare class _Lexer {
542
576
  br: RegExp;
543
577
  code: RegExp;
544
578
  del: RegExp;
579
+ delLDelim: RegExp;
580
+ delRDelim: RegExp;
545
581
  emStrongLDelim: RegExp;
546
582
  emStrongRDelimAst: RegExp;
547
583
  emStrongRDelimUnd: RegExp;
@@ -555,19 +591,19 @@ declare class _Lexer {
555
591
  text: RegExp;
556
592
  url: RegExp;
557
593
  };
558
- gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
559
- breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
560
- pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
594
+ gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "tag" | "escape" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "delLDelim" | "delRDelim" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
595
+ breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "tag" | "escape" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "delLDelim" | "delRDelim" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
596
+ pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "tag" | "escape" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "delLDelim" | "delRDelim" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
561
597
  };
562
598
  };
563
599
  /**
564
600
  * Static Lex Method
565
601
  */
566
- static lex(src: string, options?: MarkedOptions): TokensList;
602
+ static lex<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>): TokensList;
567
603
  /**
568
604
  * Static Lex Inline Method
569
605
  */
570
- static lexInline(src: string, options?: MarkedOptions): Token[];
606
+ static lexInline<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>): Token[];
571
607
  /**
572
608
  * Preprocessing
573
609
  */
@@ -582,34 +618,66 @@ declare class _Lexer {
582
618
  * Lexing/Compiling
583
619
  */
584
620
  inlineTokens(src: string, tokens?: Token[]): Token[];
621
+ private infiniteLoopError;
585
622
  }
586
623
  /**
587
624
  * Gets the original marked default options.
588
625
  */
589
- declare function _getDefaults(): MarkedOptions;
590
- declare let _defaults: MarkedOptions;
626
+ declare function _getDefaults<ParserOutput = string, RendererOutput = string>(): MarkedOptions<ParserOutput, RendererOutput>;
627
+ declare let _defaults: MarkedOptions<any, any>;
591
628
  export type MaybePromise = void | Promise<void>;
592
- export declare class Marked {
593
- #private;
594
- defaults: MarkedOptions;
595
- options: (opt: MarkedOptions) => this;
596
- parse: (src: string, options?: MarkedOptions | undefined | null) => string | Promise<string>;
597
- parseInline: (src: string, options?: MarkedOptions | undefined | null) => string | Promise<string>;
598
- Parser: typeof _Parser;
599
- Renderer: typeof _Renderer;
600
- TextRenderer: typeof _TextRenderer;
629
+ export declare class Marked<ParserOutput = string, RendererOutput = string> {
630
+ defaults: MarkedOptions<ParserOutput, RendererOutput>;
631
+ options: (opt: MarkedOptions<ParserOutput, RendererOutput>) => this;
632
+ parse: {
633
+ (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & {
634
+ async: true;
635
+ }): Promise<ParserOutput>;
636
+ (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & {
637
+ async: false;
638
+ }): ParserOutput;
639
+ (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): ParserOutput | Promise<ParserOutput>;
640
+ };
641
+ parseInline: {
642
+ (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & {
643
+ async: true;
644
+ }): Promise<ParserOutput>;
645
+ (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & {
646
+ async: false;
647
+ }): ParserOutput;
648
+ (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): ParserOutput | Promise<ParserOutput>;
649
+ };
650
+ Parser: {
651
+ new (options?: MarkedOptions<ParserOutput, RendererOutput> | undefined): _Parser<ParserOutput, RendererOutput>;
652
+ parse<ParserOutput_1 = string, RendererOutput_1 = string>(tokens: Token[], options?: MarkedOptions<ParserOutput_1, RendererOutput_1>): ParserOutput_1;
653
+ parseInline<ParserOutput_1 = string, RendererOutput_1 = string>(tokens: Token[], options?: MarkedOptions<ParserOutput_1, RendererOutput_1>): ParserOutput_1;
654
+ };
655
+ Renderer: {
656
+ new (options?: MarkedOptions<ParserOutput, RendererOutput> | undefined): _Renderer<ParserOutput, RendererOutput>;
657
+ };
658
+ TextRenderer: {
659
+ new (): _TextRenderer<RendererOutput>;
660
+ };
601
661
  Lexer: typeof _Lexer;
602
- Tokenizer: typeof _Tokenizer;
603
- Hooks: typeof _Hooks;
604
- constructor(...args: MarkedExtension[]);
662
+ Tokenizer: {
663
+ new (options?: MarkedOptions<ParserOutput, RendererOutput> | undefined): _Tokenizer<ParserOutput, RendererOutput>;
664
+ };
665
+ Hooks: {
666
+ new (options?: MarkedOptions<ParserOutput, RendererOutput> | undefined): _Hooks<ParserOutput, RendererOutput>;
667
+ passThroughHooks: Set<string>;
668
+ passThroughHooksRespectAsync: Set<string>;
669
+ };
670
+ constructor(...args: MarkedExtension<ParserOutput, RendererOutput>[]);
605
671
  /**
606
672
  * Run callback for every token
607
673
  */
608
674
  walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]): MaybePromise[];
609
- use(...args: MarkedExtension[]): this;
610
- setOptions(opt: MarkedOptions): this;
611
- lexer(src: string, options?: MarkedOptions): TokensList;
612
- parser(tokens: Token[], options?: MarkedOptions): string;
675
+ use(...args: MarkedExtension<ParserOutput, RendererOutput>[]): this;
676
+ setOptions(opt: MarkedOptions<ParserOutput, RendererOutput>): this;
677
+ lexer(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>): TokensList;
678
+ parser(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>): ParserOutput;
679
+ private parseMarkdown;
680
+ private onError;
613
681
  }
614
682
  /**
615
683
  * Compiles markdown to HTML asynchronously.
@@ -628,15 +696,29 @@ export declare function marked(src: string, options: MarkedOptions & {
628
696
  * @param options Optional hash of options
629
697
  * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.
630
698
  */
631
- export declare function marked(src: string, options?: MarkedOptions): string | Promise<string>;
699
+ export declare function marked(src: string, options: MarkedOptions & {
700
+ async: false;
701
+ }): string;
702
+ export declare function marked(src: string, options: MarkedOptions & {
703
+ async: true;
704
+ }): Promise<string>;
705
+ export declare function marked(src: string, options?: MarkedOptions | null): string | Promise<string>;
632
706
  export declare namespace marked {
633
707
  var options: (options: MarkedOptions) => typeof marked;
634
708
  var setOptions: (options: MarkedOptions) => typeof marked;
635
709
  var getDefaults: typeof _getDefaults;
636
- var defaults: MarkedOptions;
710
+ var defaults: MarkedOptions<any, any>;
637
711
  var use: (...args: MarkedExtension[]) => typeof marked;
638
712
  var walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
639
- var parseInline: (src: string, options?: MarkedOptions | null | undefined) => string | Promise<string>;
713
+ var parseInline: {
714
+ (src: string, options: MarkedOptions<string, string> & {
715
+ async: true;
716
+ }): Promise<string>;
717
+ (src: string, options: MarkedOptions<string, string> & {
718
+ async: false;
719
+ }): string;
720
+ (src: string, options?: MarkedOptions<string, string> | null | undefined): string | Promise<string>;
721
+ };
640
722
  var Parser: typeof _Parser;
641
723
  var parser: typeof _Parser.parse;
642
724
  var Renderer: typeof _Renderer;
@@ -651,7 +733,15 @@ export declare const options: (options: MarkedOptions) => typeof marked;
651
733
  export declare const setOptions: (options: MarkedOptions) => typeof marked;
652
734
  export declare const use: (...args: MarkedExtension[]) => typeof marked;
653
735
  export declare const walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
654
- export declare const parseInline: (src: string, options?: MarkedOptions | null | undefined) => string | Promise<string>;
736
+ export declare const parseInline: {
737
+ (src: string, options: MarkedOptions<string, string> & {
738
+ async: true;
739
+ }): Promise<string>;
740
+ (src: string, options: MarkedOptions<string, string> & {
741
+ async: false;
742
+ }): string;
743
+ (src: string, options?: MarkedOptions<string, string> | null | undefined): string | Promise<string>;
744
+ };
655
745
  export declare const parse: typeof marked;
656
746
  export declare const parser: typeof _Parser.parse;
657
747
  export declare const lexer: typeof _Lexer.lex;