@linxiraos/pi-utils 1.0.0
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.
- package/CHANGELOG.md +449 -0
- package/README.md +36 -0
- package/dist/types/abortable.d.ts +32 -0
- package/dist/types/acp/connection.d.ts +118 -0
- package/dist/types/acp/protocol.d.ts +526 -0
- package/dist/types/acp/schema.d.ts +41 -0
- package/dist/types/acp/stream.d.ts +8 -0
- package/dist/types/acp/transport.d.ts +81 -0
- package/dist/types/acp.d.ts +6 -0
- package/dist/types/async.d.ts +20 -0
- package/dist/types/binary.d.ts +17 -0
- package/dist/types/browsers.d.ts +68 -0
- package/dist/types/chalk.d.ts +125 -0
- package/dist/types/cli.d.ts +134 -0
- package/dist/types/color.d.ts +102 -0
- package/dist/types/dates.d.ts +7 -0
- package/dist/types/dirs.d.ts +282 -0
- package/dist/types/docx/converter.d.ts +46 -0
- package/dist/types/docx/xml.d.ts +26 -0
- package/dist/types/docx/zip.d.ts +6 -0
- package/dist/types/docx.d.ts +11 -0
- package/dist/types/dom/core.d.ts +431 -0
- package/dist/types/dom/parser.d.ts +7 -0
- package/dist/types/dom/selector.d.ts +5 -0
- package/dist/types/dom.d.ts +5 -0
- package/dist/types/env.d.ts +124 -0
- package/dist/types/fetch-retry.d.ts +96 -0
- package/dist/types/file-lock.d.ts +23 -0
- package/dist/types/format.d.ts +37 -0
- package/dist/types/frontmatter.d.ts +46 -0
- package/dist/types/fs-error.d.ts +31 -0
- package/dist/types/glob.d.ts +28 -0
- package/dist/types/headers.d.ts +34 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/json-parse.d.ts +74 -0
- package/dist/types/json.d.ts +14 -0
- package/dist/types/logger/rotating-file.d.ts +18 -0
- package/dist/types/logger.d.ts +96 -0
- package/dist/types/loop-phase.d.ts +10 -0
- package/dist/types/lru.d.ts +46 -0
- package/dist/types/marked/core.d.ts +445 -0
- package/dist/types/marked.d.ts +2 -0
- package/dist/types/mermaid-ascii.d.ts +11 -0
- package/dist/types/mime.d.ts +29 -0
- package/dist/types/module-timer.d.ts +1 -0
- package/dist/types/path-tree.d.ts +76 -0
- package/dist/types/path.d.ts +2 -0
- package/dist/types/peek-file.d.ts +29 -0
- package/dist/types/postmortem.d.ts +104 -0
- package/dist/types/process-name.d.ts +7 -0
- package/dist/types/procmgr.d.ts +74 -0
- package/dist/types/prompt.d.ts +18 -0
- package/dist/types/ptree.d.ts +110 -0
- package/dist/types/readability/readability.d.ts +9 -0
- package/dist/types/readability/readerable.d.ts +10 -0
- package/dist/types/readability/types.d.ts +70 -0
- package/dist/types/readability.d.ts +4 -0
- package/dist/types/ring.d.ts +93 -0
- package/dist/types/runtime-install.d.ts +78 -0
- package/dist/types/sanitize-text.d.ts +29 -0
- package/dist/types/snowflake.d.ts +25 -0
- package/dist/types/stderr-guard.d.ts +22 -0
- package/dist/types/stream.d.ts +67 -0
- package/dist/types/tab-spacing.d.ts +24 -0
- package/dist/types/temp.d.ts +17 -0
- package/dist/types/template.d.ts +62 -0
- package/dist/types/timing-buffer.d.ts +22 -0
- package/dist/types/tls-fetch.d.ts +37 -0
- package/dist/types/turndown/gfm.d.ts +11 -0
- package/dist/types/turndown/html.d.ts +5 -0
- package/dist/types/turndown/service.d.ts +21 -0
- package/dist/types/turndown/types.d.ts +70 -0
- package/dist/types/turndown.d.ts +4 -0
- package/dist/types/type-guards.d.ts +5 -0
- package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +41 -0
- package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +89 -0
- package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +7 -0
- package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +12 -0
- package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +66 -0
- package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +48 -0
- package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +43 -0
- package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +7 -0
- package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +56 -0
- package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +65 -0
- package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +27 -0
- package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +17 -0
- package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +7 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +11 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +34 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +11 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +11 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +26 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +31 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +11 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +59 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +17 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +30 -0
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +55 -0
- package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +206 -0
- package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +51 -0
- package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +2 -0
- package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +6 -0
- package/dist/types/vendor/mermaid-ascii/class/types.d.ts +102 -0
- package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +6 -0
- package/dist/types/vendor/mermaid-ascii/er/types.d.ts +76 -0
- package/dist/types/vendor/mermaid-ascii/index.d.ts +1 -0
- package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +9 -0
- package/dist/types/vendor/mermaid-ascii/parser.d.ts +7 -0
- package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +6 -0
- package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +130 -0
- package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +21 -0
- package/dist/types/vendor/mermaid-ascii/types.d.ts +114 -0
- package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +25 -0
- package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +6 -0
- package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +145 -0
- package/dist/types/version.d.ts +18 -0
- package/dist/types/vterm/buffer.d.ts +99 -0
- package/dist/types/vterm/terminal.d.ts +44 -0
- package/dist/types/vterm.d.ts +8 -0
- package/dist/types/which.d.ts +37 -0
- package/dist/types/worker-host.d.ts +51 -0
- package/dist/types/xml.d.ts +31 -0
- package/package.json +59 -0
- package/src/abortable.ts +109 -0
- package/src/acp/connection.ts +344 -0
- package/src/acp/protocol.ts +466 -0
- package/src/acp/schema.ts +160 -0
- package/src/acp/stream.ts +82 -0
- package/src/acp/transport.ts +213 -0
- package/src/acp.ts +6 -0
- package/src/async.ts +91 -0
- package/src/binary.ts +50 -0
- package/src/browsers.ts +501 -0
- package/src/chalk.ts +312 -0
- package/src/cli.ts +529 -0
- package/src/color.ts +302 -0
- package/src/dates.ts +194 -0
- package/src/dirs.ts +1026 -0
- package/src/docx/converter.ts +681 -0
- package/src/docx/xml.ts +166 -0
- package/src/docx/zip.ts +87 -0
- package/src/docx.ts +20 -0
- package/src/dom/core.ts +1254 -0
- package/src/dom/parser.ts +370 -0
- package/src/dom/selector.ts +290 -0
- package/src/dom.ts +33 -0
- package/src/env.ts +400 -0
- package/src/fetch-retry.ts +379 -0
- package/src/file-lock.ts +69 -0
- package/src/format.ts +113 -0
- package/src/frontmatter.ts +205 -0
- package/src/fs-error.ts +56 -0
- package/src/glob.ts +189 -0
- package/src/headers.ts +167 -0
- package/src/index.ts +59 -0
- package/src/json-parse.ts +821 -0
- package/src/json.ts +23 -0
- package/src/logger/rotating-file.ts +149 -0
- package/src/logger.ts +798 -0
- package/src/loop-phase.ts +49 -0
- package/src/lru.ts +185 -0
- package/src/marked/core.ts +1576 -0
- package/src/marked.ts +2 -0
- package/src/mermaid-ascii.ts +31 -0
- package/src/mime.ts +159 -0
- package/src/module-timer.ts +148 -0
- package/src/path-tree.ts +147 -0
- package/src/path.ts +28 -0
- package/src/peek-file.ts +188 -0
- package/src/postmortem.ts +433 -0
- package/src/process-name.ts +57 -0
- package/src/procmgr.ts +247 -0
- package/src/prompt.ts +545 -0
- package/src/ptree.ts +412 -0
- package/src/readability/readability.ts +533 -0
- package/src/readability/readerable.ts +51 -0
- package/src/readability/types.ts +72 -0
- package/src/readability.ts +11 -0
- package/src/ring.ts +169 -0
- package/src/runtime-install.ts +393 -0
- package/src/sanitize-text.ts +96 -0
- package/src/snowflake.ts +121 -0
- package/src/stderr-guard.ts +155 -0
- package/src/stream.ts +454 -0
- package/src/tab-spacing.ts +336 -0
- package/src/temp.ts +134 -0
- package/src/template.ts +586 -0
- package/src/timing-buffer.ts +47 -0
- package/src/tls-fetch.ts +178 -0
- package/src/turndown/gfm.ts +106 -0
- package/src/turndown/html.ts +257 -0
- package/src/turndown/service.ts +334 -0
- package/src/turndown/types.ts +81 -0
- package/src/turndown.ts +5 -0
- package/src/type-guards.ts +17 -0
- package/src/vendor/mermaid-ascii/NOTICE +33 -0
- package/src/vendor/mermaid-ascii/ascii/ansi.ts +409 -0
- package/src/vendor/mermaid-ascii/ascii/canvas.ts +476 -0
- package/src/vendor/mermaid-ascii/ascii/class-diagram.ts +699 -0
- package/src/vendor/mermaid-ascii/ascii/converter.ts +271 -0
- package/src/vendor/mermaid-ascii/ascii/draw.ts +1382 -0
- package/src/vendor/mermaid-ascii/ascii/edge-bundling.ts +328 -0
- package/src/vendor/mermaid-ascii/ascii/edge-routing.ts +297 -0
- package/src/vendor/mermaid-ascii/ascii/er-diagram.ts +441 -0
- package/src/vendor/mermaid-ascii/ascii/grid.ts +578 -0
- package/src/vendor/mermaid-ascii/ascii/index.ts +187 -0
- package/src/vendor/mermaid-ascii/ascii/multiline-utils.ts +78 -0
- package/src/vendor/mermaid-ascii/ascii/pathfinder.ts +277 -0
- package/src/vendor/mermaid-ascii/ascii/sequence.ts +460 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/circle.ts +27 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/corners.ts +127 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/diamond.ts +27 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/hexagon.ts +27 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/index.ts +101 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/rectangle.ts +175 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/rounded.ts +27 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/special.ts +296 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/stadium.ts +114 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/state.ts +192 -0
- package/src/vendor/mermaid-ascii/ascii/shapes/types.ts +73 -0
- package/src/vendor/mermaid-ascii/ascii/types.ts +273 -0
- package/src/vendor/mermaid-ascii/ascii/validate.ts +120 -0
- package/src/vendor/mermaid-ascii/ascii/xychart.ts +875 -0
- package/src/vendor/mermaid-ascii/class/parser.ts +290 -0
- package/src/vendor/mermaid-ascii/class/types.ts +121 -0
- package/src/vendor/mermaid-ascii/er/parser.ts +181 -0
- package/src/vendor/mermaid-ascii/er/types.ts +91 -0
- package/src/vendor/mermaid-ascii/index.ts +14 -0
- package/src/vendor/mermaid-ascii/multiline-utils.ts +30 -0
- package/src/vendor/mermaid-ascii/parser.ts +645 -0
- package/src/vendor/mermaid-ascii/sequence/parser.ts +207 -0
- package/src/vendor/mermaid-ascii/sequence/types.ts +146 -0
- package/src/vendor/mermaid-ascii/text-metrics.ts +71 -0
- package/src/vendor/mermaid-ascii/types.ts +164 -0
- package/src/vendor/mermaid-ascii/xychart/colors.ts +140 -0
- package/src/vendor/mermaid-ascii/xychart/parser.ts +115 -0
- package/src/vendor/mermaid-ascii/xychart/types.ts +150 -0
- package/src/version.ts +99 -0
- package/src/vterm/buffer.ts +218 -0
- package/src/vterm/terminal.ts +773 -0
- package/src/vterm.ts +8 -0
- package/src/which.ts +234 -0
- package/src/worker-host.ts +100 -0
- package/src/xml.ts +313 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/** Token shapes emitted by the Markdown lexer. */
|
|
2
|
+
export declare namespace Tokens {
|
|
3
|
+
/** A block quote. */
|
|
4
|
+
interface Blockquote {
|
|
5
|
+
type: "blockquote";
|
|
6
|
+
raw: string;
|
|
7
|
+
text: string;
|
|
8
|
+
tokens: Token[];
|
|
9
|
+
}
|
|
10
|
+
/** A hard line break. */
|
|
11
|
+
interface Br {
|
|
12
|
+
type: "br";
|
|
13
|
+
raw: string;
|
|
14
|
+
}
|
|
15
|
+
/** A task-list checkbox. */
|
|
16
|
+
interface Checkbox {
|
|
17
|
+
type: "checkbox";
|
|
18
|
+
raw: string;
|
|
19
|
+
checked: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A code block. */
|
|
22
|
+
interface Code {
|
|
23
|
+
type: "code";
|
|
24
|
+
raw: string;
|
|
25
|
+
codeBlockStyle?: "indented";
|
|
26
|
+
lang?: string;
|
|
27
|
+
text: string;
|
|
28
|
+
escaped?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** An inline code span. */
|
|
31
|
+
interface Codespan {
|
|
32
|
+
type: "codespan";
|
|
33
|
+
raw: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
/** A reference-link definition. */
|
|
37
|
+
interface Def {
|
|
38
|
+
type: "def";
|
|
39
|
+
raw: string;
|
|
40
|
+
tag: string;
|
|
41
|
+
href: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Deleted text. */
|
|
45
|
+
interface Del {
|
|
46
|
+
type: "del";
|
|
47
|
+
raw: string;
|
|
48
|
+
text: string;
|
|
49
|
+
tokens: Token[];
|
|
50
|
+
}
|
|
51
|
+
/** Emphasized text. */
|
|
52
|
+
interface Em {
|
|
53
|
+
type: "em";
|
|
54
|
+
raw: string;
|
|
55
|
+
text: string;
|
|
56
|
+
tokens: Token[];
|
|
57
|
+
}
|
|
58
|
+
/** An escaped punctuation character. */
|
|
59
|
+
interface Escape {
|
|
60
|
+
type: "escape";
|
|
61
|
+
raw: string;
|
|
62
|
+
text: string;
|
|
63
|
+
}
|
|
64
|
+
/** A custom extension token. */
|
|
65
|
+
interface Generic {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
type: string;
|
|
68
|
+
raw: string;
|
|
69
|
+
tokens?: Token[];
|
|
70
|
+
}
|
|
71
|
+
/** A heading. */
|
|
72
|
+
interface Heading {
|
|
73
|
+
type: "heading";
|
|
74
|
+
raw: string;
|
|
75
|
+
depth: number;
|
|
76
|
+
text: string;
|
|
77
|
+
tokens: Token[];
|
|
78
|
+
}
|
|
79
|
+
/** A horizontal rule. */
|
|
80
|
+
interface Hr {
|
|
81
|
+
type: "hr";
|
|
82
|
+
raw: string;
|
|
83
|
+
}
|
|
84
|
+
/** Raw block or inline HTML. */
|
|
85
|
+
interface HTML {
|
|
86
|
+
type: "html";
|
|
87
|
+
raw: string;
|
|
88
|
+
pre?: boolean;
|
|
89
|
+
text: string;
|
|
90
|
+
block: boolean;
|
|
91
|
+
inLink?: boolean;
|
|
92
|
+
inRawBlock?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** An image. */
|
|
95
|
+
interface Image {
|
|
96
|
+
type: "image";
|
|
97
|
+
raw: string;
|
|
98
|
+
href: string;
|
|
99
|
+
title: string | null;
|
|
100
|
+
text: string;
|
|
101
|
+
tokens: Token[];
|
|
102
|
+
}
|
|
103
|
+
/** A hyperlink. */
|
|
104
|
+
interface Link {
|
|
105
|
+
type: "link";
|
|
106
|
+
raw: string;
|
|
107
|
+
href: string;
|
|
108
|
+
title?: string | null;
|
|
109
|
+
text: string;
|
|
110
|
+
tokens: Token[];
|
|
111
|
+
}
|
|
112
|
+
/** A list. */
|
|
113
|
+
interface List {
|
|
114
|
+
type: "list";
|
|
115
|
+
raw: string;
|
|
116
|
+
ordered: boolean;
|
|
117
|
+
start: number | "";
|
|
118
|
+
loose: boolean;
|
|
119
|
+
items: ListItem[];
|
|
120
|
+
}
|
|
121
|
+
/** A list item. */
|
|
122
|
+
interface ListItem {
|
|
123
|
+
type: "list_item";
|
|
124
|
+
raw: string;
|
|
125
|
+
task: boolean;
|
|
126
|
+
checked?: boolean;
|
|
127
|
+
loose: boolean;
|
|
128
|
+
text: string;
|
|
129
|
+
tokens: Token[];
|
|
130
|
+
}
|
|
131
|
+
/** A paragraph. */
|
|
132
|
+
interface Paragraph {
|
|
133
|
+
type: "paragraph";
|
|
134
|
+
raw: string;
|
|
135
|
+
pre?: boolean;
|
|
136
|
+
text: string;
|
|
137
|
+
tokens: Token[];
|
|
138
|
+
}
|
|
139
|
+
/** Blank block space. */
|
|
140
|
+
interface Space {
|
|
141
|
+
type: "space";
|
|
142
|
+
raw: string;
|
|
143
|
+
}
|
|
144
|
+
/** Strongly emphasized text. */
|
|
145
|
+
interface Strong {
|
|
146
|
+
type: "strong";
|
|
147
|
+
raw: string;
|
|
148
|
+
text: string;
|
|
149
|
+
tokens: Token[];
|
|
150
|
+
}
|
|
151
|
+
/** A GFM table cell. */
|
|
152
|
+
interface TableCell {
|
|
153
|
+
text: string;
|
|
154
|
+
tokens: Token[];
|
|
155
|
+
header: boolean;
|
|
156
|
+
align: "center" | "left" | "right" | null;
|
|
157
|
+
}
|
|
158
|
+
/** A GFM table. */
|
|
159
|
+
interface Table {
|
|
160
|
+
type: "table";
|
|
161
|
+
raw: string;
|
|
162
|
+
align: Array<"center" | "left" | "right" | null>;
|
|
163
|
+
header: TableCell[];
|
|
164
|
+
rows: TableCell[][];
|
|
165
|
+
}
|
|
166
|
+
/** Plain text. */
|
|
167
|
+
interface Text {
|
|
168
|
+
type: "text";
|
|
169
|
+
raw: string;
|
|
170
|
+
text: string;
|
|
171
|
+
tokens?: Token[];
|
|
172
|
+
escaped?: boolean;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
type KnownToken = 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.Text;
|
|
176
|
+
/** A built-in or extension Markdown token. */
|
|
177
|
+
export type Token = KnownToken | Tokens.Generic;
|
|
178
|
+
/** Reference definitions collected while lexing. */
|
|
179
|
+
export type Links = Record<string, Pick<Tokens.Link | Tokens.Image, "href" | "title">>;
|
|
180
|
+
/** A token array carrying its reference-definition map. */
|
|
181
|
+
export type TokensList = Token[] & {
|
|
182
|
+
links: Links;
|
|
183
|
+
};
|
|
184
|
+
/** Context supplied to extension tokenizers. */
|
|
185
|
+
export interface TokenizerThis {
|
|
186
|
+
lexer: Lexer;
|
|
187
|
+
}
|
|
188
|
+
/** A tokenizer extension callback. */
|
|
189
|
+
export type TokenizerExtensionFunction = (this: TokenizerThis, src: string, tokens: Token[] | TokensList) => Tokens.Generic | undefined;
|
|
190
|
+
/** A tokenizer extension start hint. */
|
|
191
|
+
export type TokenizerStartFunction = (this: TokenizerThis, src: string) => number | void;
|
|
192
|
+
/** An inline or block tokenizer extension. */
|
|
193
|
+
export interface TokenizerExtension {
|
|
194
|
+
name: string;
|
|
195
|
+
level: "block" | "inline";
|
|
196
|
+
start?: TokenizerStartFunction;
|
|
197
|
+
tokenizer: TokenizerExtensionFunction;
|
|
198
|
+
childTokens?: string[];
|
|
199
|
+
}
|
|
200
|
+
/** Context supplied to extension renderers. */
|
|
201
|
+
export interface RendererThis {
|
|
202
|
+
parser: Parser;
|
|
203
|
+
}
|
|
204
|
+
/** A custom renderer extension callback. */
|
|
205
|
+
export type RendererExtensionFunction = (this: RendererThis, token: Tokens.Generic) => string | false | undefined;
|
|
206
|
+
/** A named renderer extension. */
|
|
207
|
+
export interface RendererExtension {
|
|
208
|
+
name: string;
|
|
209
|
+
renderer: RendererExtensionFunction;
|
|
210
|
+
}
|
|
211
|
+
/** A combined tokenizer/renderer extension. */
|
|
212
|
+
export type TokenizerAndRendererExtension = TokenizerExtension | RendererExtension | (TokenizerExtension & RendererExtension);
|
|
213
|
+
/** Overrides for built-in tokenizer methods. */
|
|
214
|
+
export interface TokenizerObject {
|
|
215
|
+
url?(this: Tokenizer, src: string): Tokens.Link | undefined | false;
|
|
216
|
+
lheading?(this: Tokenizer, src: string): Tokens.Heading | undefined | false;
|
|
217
|
+
del?(this: Tokenizer, src: string, maskedSrc?: string, prevChar?: string): Tokens.Del | undefined | false;
|
|
218
|
+
}
|
|
219
|
+
interface RendererTokenMap {
|
|
220
|
+
space: Tokens.Space;
|
|
221
|
+
html: Tokens.HTML;
|
|
222
|
+
link: Tokens.Link;
|
|
223
|
+
image: Tokens.Image;
|
|
224
|
+
text: Tokens.Text | Tokens.Escape;
|
|
225
|
+
code: Tokens.Code;
|
|
226
|
+
blockquote: Tokens.Blockquote;
|
|
227
|
+
heading: Tokens.Heading;
|
|
228
|
+
hr: Tokens.Hr;
|
|
229
|
+
list: Tokens.List;
|
|
230
|
+
listitem: Tokens.ListItem;
|
|
231
|
+
paragraph: Tokens.Paragraph;
|
|
232
|
+
strong: Tokens.Strong;
|
|
233
|
+
em: Tokens.Em;
|
|
234
|
+
codespan: Tokens.Codespan;
|
|
235
|
+
br: Tokens.Br;
|
|
236
|
+
del: Tokens.Del;
|
|
237
|
+
}
|
|
238
|
+
/** Overrides for built-in HTML renderer methods. */
|
|
239
|
+
export type RendererObject = {
|
|
240
|
+
[K in keyof RendererTokenMap]?: (this: Renderer, token: RendererTokenMap[K]) => string | false;
|
|
241
|
+
};
|
|
242
|
+
/** Options supported by the in-house Markdown implementation. */
|
|
243
|
+
export interface MarkedOptions {
|
|
244
|
+
async?: boolean;
|
|
245
|
+
breaks?: boolean;
|
|
246
|
+
gfm?: boolean;
|
|
247
|
+
pedantic?: boolean;
|
|
248
|
+
silent?: boolean;
|
|
249
|
+
tokenizer?: Tokenizer | TokenizerObject | null;
|
|
250
|
+
/** Built-in tokenizer overrides composed by Marked.use(). */
|
|
251
|
+
tokenizerOverrides?: TokenizerObject;
|
|
252
|
+
renderer?: Renderer | RendererObject | null;
|
|
253
|
+
walkTokens?: ((token: Token) => void | Promise<void>) | null;
|
|
254
|
+
extensions?: ExtensionRegistry | null;
|
|
255
|
+
}
|
|
256
|
+
interface ExtensionRegistry {
|
|
257
|
+
block: TokenizerExtension[];
|
|
258
|
+
inline: TokenizerExtension[];
|
|
259
|
+
renderers: Record<string, RendererExtensionFunction>;
|
|
260
|
+
childTokens: Record<string, string[]>;
|
|
261
|
+
}
|
|
262
|
+
/** Options accepted by Marked.use(). */
|
|
263
|
+
export interface MarkedExtension extends Omit<MarkedOptions, "extensions"> {
|
|
264
|
+
extensions?: TokenizerAndRendererExtension[] | null;
|
|
265
|
+
}
|
|
266
|
+
/** Tokenizes the built-in inline Markdown surface. */
|
|
267
|
+
export declare class Tokenizer {
|
|
268
|
+
options: MarkedOptions;
|
|
269
|
+
lexer: Lexer;
|
|
270
|
+
/** Creates a tokenizer with the supplied options. */
|
|
271
|
+
constructor(options?: MarkedOptions);
|
|
272
|
+
/** Tokenizes GFM deletion. */
|
|
273
|
+
del(src: string): Tokens.Del | undefined;
|
|
274
|
+
}
|
|
275
|
+
/** Stateful block and inline Markdown lexer. */
|
|
276
|
+
export declare class Lexer {
|
|
277
|
+
tokens: TokensList;
|
|
278
|
+
options: MarkedOptions;
|
|
279
|
+
state: {
|
|
280
|
+
inLink: boolean;
|
|
281
|
+
inRawBlock: boolean;
|
|
282
|
+
top: boolean;
|
|
283
|
+
};
|
|
284
|
+
inlineQueue: Array<{
|
|
285
|
+
src: string;
|
|
286
|
+
tokens: Token[];
|
|
287
|
+
}>;
|
|
288
|
+
tokenizer: Tokenizer;
|
|
289
|
+
tokenizerOverrides: TokenizerObject;
|
|
290
|
+
extensions: ExtensionRegistry;
|
|
291
|
+
/** Creates a lexer. */
|
|
292
|
+
constructor(options?: MarkedOptions);
|
|
293
|
+
/** Exposes rule objects for callers that optimize regular expressions. */
|
|
294
|
+
static get rules(): {
|
|
295
|
+
block: {
|
|
296
|
+
normal: {
|
|
297
|
+
blockquote: RegExp;
|
|
298
|
+
code: RegExp;
|
|
299
|
+
def: RegExp;
|
|
300
|
+
fences: RegExp;
|
|
301
|
+
heading: RegExp;
|
|
302
|
+
hr: RegExp;
|
|
303
|
+
html: RegExp;
|
|
304
|
+
lheading: RegExp;
|
|
305
|
+
list: RegExp;
|
|
306
|
+
newline: RegExp;
|
|
307
|
+
paragraph: RegExp;
|
|
308
|
+
table: RegExp;
|
|
309
|
+
text: RegExp;
|
|
310
|
+
};
|
|
311
|
+
gfm: Record<string, RegExp>;
|
|
312
|
+
pedantic: Record<string, RegExp>;
|
|
313
|
+
};
|
|
314
|
+
inline: {
|
|
315
|
+
normal: {
|
|
316
|
+
_backpedal: RegExp;
|
|
317
|
+
anyPunctuation: RegExp;
|
|
318
|
+
autolink: RegExp;
|
|
319
|
+
blockSkip: RegExp;
|
|
320
|
+
br: RegExp;
|
|
321
|
+
code: RegExp;
|
|
322
|
+
del: RegExp;
|
|
323
|
+
delLDelim: RegExp;
|
|
324
|
+
delRDelim: RegExp;
|
|
325
|
+
emStrongLDelim: RegExp;
|
|
326
|
+
emStrongRDelimAst: RegExp;
|
|
327
|
+
emStrongRDelimUnd: RegExp;
|
|
328
|
+
escape: RegExp;
|
|
329
|
+
link: RegExp;
|
|
330
|
+
nolink: RegExp;
|
|
331
|
+
punctuation: RegExp;
|
|
332
|
+
reflink: RegExp;
|
|
333
|
+
reflinkSearch: RegExp;
|
|
334
|
+
tag: RegExp;
|
|
335
|
+
text: RegExp;
|
|
336
|
+
url: RegExp;
|
|
337
|
+
};
|
|
338
|
+
gfm: Record<string, RegExp>;
|
|
339
|
+
breaks: Record<string, RegExp>;
|
|
340
|
+
pedantic: Record<string, RegExp>;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
/** Lexes a complete document. */
|
|
344
|
+
static lex(src: string, options?: MarkedOptions): TokensList;
|
|
345
|
+
/** Lexes inline Markdown. */
|
|
346
|
+
static lexInline(src: string, options?: MarkedOptions): Token[];
|
|
347
|
+
/** Lexes and resolves a complete document. */
|
|
348
|
+
lex(src: string): TokensList;
|
|
349
|
+
/** Appends block tokens to an output array. */
|
|
350
|
+
blockTokens(src: string, tokens?: Token[] | TokensList): Token[] | TokensList;
|
|
351
|
+
/** Queues inline tokenization compatibly with marked. */
|
|
352
|
+
inline(src: string, tokens?: Token[]): Token[];
|
|
353
|
+
/** Tokenizes inline Markdown immediately. */
|
|
354
|
+
inlineTokens(src: string, tokens?: Token[]): Token[];
|
|
355
|
+
}
|
|
356
|
+
/** Default HTML renderer. */
|
|
357
|
+
export declare class Renderer {
|
|
358
|
+
options: MarkedOptions;
|
|
359
|
+
parser: Parser;
|
|
360
|
+
overrides: RendererObject;
|
|
361
|
+
/** Creates an HTML renderer. */
|
|
362
|
+
constructor(options?: MarkedOptions, overrides?: RendererObject);
|
|
363
|
+
/** Renders blank space. */ space(_token: Tokens.Space): string;
|
|
364
|
+
/** Renders a code block. */ code({ text, lang, escaped }: Tokens.Code): string;
|
|
365
|
+
/** Renders a block quote. */ blockquote({ tokens }: Tokens.Blockquote): string;
|
|
366
|
+
/** Passes raw HTML through. */ html({ text }: Tokens.HTML): string;
|
|
367
|
+
/** Renders a definition as no output. */ def(_token: Tokens.Def): string;
|
|
368
|
+
/** Renders a heading. */ heading({ tokens, depth }: Tokens.Heading): string;
|
|
369
|
+
/** Renders a horizontal rule. */ hr(_token: Tokens.Hr): string;
|
|
370
|
+
/** Renders a list. */ list(token: Tokens.List): string;
|
|
371
|
+
/** Renders a list item. */ listitem(item: Tokens.ListItem): string;
|
|
372
|
+
/** Renders a checkbox. */ checkbox({ checked }: Tokens.Checkbox): string;
|
|
373
|
+
/** Renders a paragraph. */ paragraph({ tokens }: Tokens.Paragraph): string;
|
|
374
|
+
/** Renders a table. */ table(token: Tokens.Table): string;
|
|
375
|
+
/** Renders a table row. */ tablerow(text: string): string;
|
|
376
|
+
/** Renders a table cell. */ tablecell(token: Tokens.TableCell): string;
|
|
377
|
+
/** Renders strong text. */ strong({ tokens }: Tokens.Strong): string;
|
|
378
|
+
/** Renders emphasized text. */ em({ tokens }: Tokens.Em): string;
|
|
379
|
+
/** Renders inline code. */ codespan({ text }: Tokens.Codespan): string;
|
|
380
|
+
/** Renders a line break. */ br(_token: Tokens.Br): string;
|
|
381
|
+
/** Renders deleted text. */ del({ tokens }: Tokens.Del): string;
|
|
382
|
+
/** Renders a link. */ link({ href, title, tokens }: Tokens.Link): string;
|
|
383
|
+
/** Renders an image. */ image({ href, title, text }: Tokens.Image): string;
|
|
384
|
+
/** Renders plain text. */ text({ text }: Tokens.Text | Tokens.Escape): string;
|
|
385
|
+
}
|
|
386
|
+
/** Converts token streams into HTML. */
|
|
387
|
+
export declare class Parser {
|
|
388
|
+
options: MarkedOptions;
|
|
389
|
+
renderer: Renderer;
|
|
390
|
+
extensions: ExtensionRegistry;
|
|
391
|
+
/** Creates a parser. */
|
|
392
|
+
constructor(options?: MarkedOptions);
|
|
393
|
+
/** Parses block tokens. */ static parse(tokens: Token[], options?: MarkedOptions): string;
|
|
394
|
+
/** Parses inline tokens. */ static parseInline(tokens: Token[], options?: MarkedOptions): string;
|
|
395
|
+
/** Parses block tokens with the configured renderer. */
|
|
396
|
+
parse(tokens: Token[]): string;
|
|
397
|
+
/** Parses inline tokens with the configured renderer. */
|
|
398
|
+
parseInline(tokens: Token[]): string;
|
|
399
|
+
/** Renders a list item, including custom renderer overrides. */
|
|
400
|
+
renderListItem(item: Tokens.ListItem): string;
|
|
401
|
+
call<K extends keyof RendererTokenMap>(name: K, token: RendererTokenMap[K], fallback: () => string): string;
|
|
402
|
+
}
|
|
403
|
+
/** Configurable Markdown lexer and HTML parser. */
|
|
404
|
+
export declare class Marked {
|
|
405
|
+
defaults: MarkedOptions;
|
|
406
|
+
/** Creates an isolated Marked instance. */
|
|
407
|
+
constructor(...extensions: MarkedExtension[]);
|
|
408
|
+
/** Merges default options. */ options(options: MarkedOptions): this;
|
|
409
|
+
/** Merges default options. */ setOptions(options: MarkedOptions): this;
|
|
410
|
+
/** Adds tokenizer, renderer, and walk-token extensions. */
|
|
411
|
+
use(...extensions: MarkedExtension[]): this;
|
|
412
|
+
/** Lexes Markdown into tokens. */ lexer(src: string, options?: MarkedOptions): TokensList;
|
|
413
|
+
/** Parses a token stream to HTML. */ parser(tokens: Token[], options?: MarkedOptions): string;
|
|
414
|
+
/** Walks a token tree depth first. */ walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => void | Promise<void>): Array<void | Promise<void>>;
|
|
415
|
+
/** Parses Markdown to HTML, synchronously unless async mode is requested. */
|
|
416
|
+
parse(src: string, options: MarkedOptions & {
|
|
417
|
+
async: true;
|
|
418
|
+
}): Promise<string>;
|
|
419
|
+
parse(src: string, options: MarkedOptions & {
|
|
420
|
+
async: false;
|
|
421
|
+
}): string;
|
|
422
|
+
parse(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
423
|
+
/** Parses inline Markdown to HTML. */ parseInline(src: string, options?: MarkedOptions): string;
|
|
424
|
+
}
|
|
425
|
+
/** Parses Markdown with a shared default instance. */
|
|
426
|
+
export declare function marked(src: string, options: MarkedOptions & {
|
|
427
|
+
async: true;
|
|
428
|
+
}): Promise<string>;
|
|
429
|
+
export declare function marked(src: string, options: MarkedOptions & {
|
|
430
|
+
async: false;
|
|
431
|
+
}): string;
|
|
432
|
+
export declare function marked(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
433
|
+
/** Parses Markdown with a shared default instance. */
|
|
434
|
+
export declare const parse: typeof marked;
|
|
435
|
+
/** Lexes Markdown with default options. */
|
|
436
|
+
export declare const lexer: typeof Lexer.lex;
|
|
437
|
+
/** Parses inline Markdown with default options. */
|
|
438
|
+
export declare const parseInline: (src: string, options?: MarkedOptions) => string;
|
|
439
|
+
/** Parses a token stream with default options. */
|
|
440
|
+
export declare const parser: typeof Parser.parse;
|
|
441
|
+
/** The default option object. */
|
|
442
|
+
export declare const defaults: MarkedOptions;
|
|
443
|
+
/** Returns a fresh copy of the default options. */
|
|
444
|
+
export declare function getDefaults(): MarkedOptions;
|
|
445
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AsciiRenderOptions } from "./vendor/mermaid-ascii/index.js";
|
|
2
|
+
export type { AsciiRenderOptions as MermaidAsciiRenderOptions };
|
|
3
|
+
export declare function renderMermaidAscii(source: string, options?: AsciiRenderOptions): string;
|
|
4
|
+
export declare function renderMermaidAsciiSafe(source: string, options?: AsciiRenderOptions): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Extract mermaid code blocks from markdown text.
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractMermaidBlocks(markdown: string): {
|
|
9
|
+
source: string;
|
|
10
|
+
hash: bigint | number;
|
|
11
|
+
}[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const SUPPORTED_IMAGE_MIME_TYPES: Set<string>;
|
|
2
|
+
export type ImageMetadata = {
|
|
3
|
+
mimeType: "image/png";
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
channels?: number;
|
|
7
|
+
hasAlpha?: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
mimeType: "image/jpeg";
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
channels?: number;
|
|
13
|
+
hasAlpha?: false;
|
|
14
|
+
} | {
|
|
15
|
+
mimeType: "image/gif";
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
channels?: 3;
|
|
19
|
+
hasAlpha?: never;
|
|
20
|
+
} | {
|
|
21
|
+
mimeType: "image/webp";
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
channels?: number;
|
|
25
|
+
hasAlpha?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare function parseImageMetadata(header: Uint8Array): ImageMetadata | null;
|
|
28
|
+
export declare function readImageMetadataSync(filePath: string, maxBytes?: number): ImageMetadata | null;
|
|
29
|
+
export declare function readImageMetadata(filePath: string, maxBytes?: number): Promise<ImageMetadata | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-level path tree shared by grouped file listings (find / grep / ast tools)
|
|
3
|
+
* and compaction file-operation lists.
|
|
4
|
+
*
|
|
5
|
+
* Flat path lists used to group by the *immediate* parent directory and print the
|
|
6
|
+
* full directory path in every header. For results spread across a deep tree — or
|
|
7
|
+
* rooted outside cwd, where paths stay absolute — that repeated the shared prefix
|
|
8
|
+
* on every line. The tree below folds single-child directory chains (so the common
|
|
9
|
+
* prefix collapses into one header) and nests the rest, charging the model one
|
|
10
|
+
* token per path segment instead of one per file.
|
|
11
|
+
*/
|
|
12
|
+
/** True for `scheme://…` entries that have no meaningful directory structure. */
|
|
13
|
+
export declare function isUrlLikePath(filePath: string): boolean;
|
|
14
|
+
export interface PathTreeNode {
|
|
15
|
+
/** Direct file leaves, in first-seen order. */
|
|
16
|
+
files: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
key: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Dedup set for `files` (a glob can surface the same path twice on retry). */
|
|
21
|
+
fileNames: Set<string>;
|
|
22
|
+
/** Child directories, in first-seen order. */
|
|
23
|
+
subdirs: Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
node: PathTreeNode;
|
|
26
|
+
}>;
|
|
27
|
+
/** Dedup index for `subdirs`. */
|
|
28
|
+
dirIndex: Map<string, PathTreeNode>;
|
|
29
|
+
}
|
|
30
|
+
export interface PathTreeInput {
|
|
31
|
+
/** Path string; absolute, cwd-relative, or url-like. Backslashes are normalized. */
|
|
32
|
+
path: string;
|
|
33
|
+
/** Whether the leaf itself is a directory (trailing-slash match from find). */
|
|
34
|
+
isDir: boolean;
|
|
35
|
+
/** Opaque key carried onto file events for section lookup. Defaults to `path`. */
|
|
36
|
+
key?: string;
|
|
37
|
+
}
|
|
38
|
+
/** One node emitted while walking the tree: a folded directory or a file leaf. */
|
|
39
|
+
export interface GroupedTreeEvent {
|
|
40
|
+
kind: "dir" | "file";
|
|
41
|
+
/** 0-based nesting depth (root children are depth 0). */
|
|
42
|
+
depth: number;
|
|
43
|
+
/** Folded chain for dirs (e.g. `a/b/c`, no trailing slash); basename for files. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** File key for `kind === "file"`; empty string for directories. */
|
|
46
|
+
key: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build a directory tree from a flat list of paths. URL-like entries are kept
|
|
50
|
+
* whole as root-level file leaves (they have no meaningful directory structure).
|
|
51
|
+
* Absolute paths carry a leading empty segment so they share a common `/` root
|
|
52
|
+
* and fold like any other prefix.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildPathTree(entries: Iterable<PathTreeInput>): PathTreeNode;
|
|
55
|
+
/**
|
|
56
|
+
* Depth-first walk yielding directory and file events. Directories collapse their
|
|
57
|
+
* single-child chains (`a` → `a/b` → `a/b/c`) so a shared prefix becomes one
|
|
58
|
+
* header. Each node's direct files are emitted before its subdirectories, keeping
|
|
59
|
+
* a file unambiguously attached to the header above it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function walkPathTree(node: PathTreeNode, depth?: number): Generator<GroupedTreeEvent>;
|
|
62
|
+
/**
|
|
63
|
+
* Render a flat path list as a grouped, prefix-folded directory tree without
|
|
64
|
+
* per-file bodies (find-tool output shape, also used by compaction `<files>`
|
|
65
|
+
* lists). Single-child directory chains fold into one header (`# a/b/c/`),
|
|
66
|
+
* each level adds one `#`, and files are listed bare under the deepest
|
|
67
|
+
* directory header that owns them. Trailing-slash entries are directory
|
|
68
|
+
* leaves and keep their slash in the header.
|
|
69
|
+
*
|
|
70
|
+
* `annotate` receives each file's full original path and its return value is
|
|
71
|
+
* appended verbatim to the file line (e.g. ` (RW)`).
|
|
72
|
+
*
|
|
73
|
+
* Order follows the input: a directory appears when its first member is
|
|
74
|
+
* emitted, and a node's own files precede its subdirectories.
|
|
75
|
+
*/
|
|
76
|
+
export declare function formatGroupedPaths(paths: readonly string[], annotate?: (path: string) => string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronously reads up to `maxBytes` from the start of `filePath` and returns `op(header)`.
|
|
3
|
+
* If the file is shorter, `header` is only the bytes actually read.
|
|
4
|
+
*/
|
|
5
|
+
export declare function peekFileSync<T>(filePath: string, maxBytes: number, op: (header: Uint8Array) => T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Like {@link peekFileSync} but uses async I/O.
|
|
8
|
+
*/
|
|
9
|
+
export declare function peekFile<T>(filePath: string, maxBytes: number, op: (header: Uint8Array) => T): Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Read up to the last `maxBytes` of `filePath` and pass that slice to `op`.
|
|
12
|
+
*
|
|
13
|
+
* The tail mirror of {@link peekFile}: same pooled-buffer strategy (no per-call
|
|
14
|
+
* allocation for small reads), but the read is positioned at `size - len` so the
|
|
15
|
+
* window ends at EOF. When the file is shorter than `maxBytes`, the whole file is
|
|
16
|
+
* returned. A multi-byte codepoint straddling the leading cut decodes to a
|
|
17
|
+
* replacement char — callers that parse line-oriented tails drop the partial
|
|
18
|
+
* leading line anyway.
|
|
19
|
+
*/
|
|
20
|
+
export declare function peekFileTail<T>(filePath: string, maxBytes: number, op: (tail: Uint8Array) => T): Promise<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Read up to the first `prefixBytes` and last `suffixBytes` of `filePath`, then
|
|
23
|
+
* pass both slices to `op`.
|
|
24
|
+
*
|
|
25
|
+
* Uses a single open/stat sequence. When the whole file fits in the head window,
|
|
26
|
+
* the tail is sliced from the already-read head bytes instead of issuing a
|
|
27
|
+
* second read.
|
|
28
|
+
*/
|
|
29
|
+
export declare function peekFileEnds<T>(filePath: string, prefixBytes: number, suffixBytes: number, op: (head: Uint8Array, tail: Uint8Array) => T): Promise<T>;
|