@knpkv/atlassian-common 0.2.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 +11 -0
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/Brand.d.ts +118 -0
- package/dist/Brand.d.ts.map +1 -0
- package/dist/Brand.js +107 -0
- package/dist/Brand.js.map +1 -0
- package/dist/Hash.d.ts +53 -0
- package/dist/Hash.d.ts.map +1 -0
- package/dist/Hash.js +63 -0
- package/dist/Hash.js.map +1 -0
- package/dist/SerializeError.d.ts +48 -0
- package/dist/SerializeError.d.ts.map +1 -0
- package/dist/SerializeError.js +42 -0
- package/dist/SerializeError.js.map +1 -0
- package/dist/ast/BlockNode.d.ts +429 -0
- package/dist/ast/BlockNode.d.ts.map +1 -0
- package/dist/ast/BlockNode.js +279 -0
- package/dist/ast/BlockNode.js.map +1 -0
- package/dist/ast/Document.d.ts +255 -0
- package/dist/ast/Document.d.ts.map +1 -0
- package/dist/ast/Document.js +80 -0
- package/dist/ast/Document.js.map +1 -0
- package/dist/ast/InlineNode.d.ts +483 -0
- package/dist/ast/InlineNode.d.ts.map +1 -0
- package/dist/ast/InlineNode.js +268 -0
- package/dist/ast/InlineNode.js.map +1 -0
- package/dist/ast/MacroNode.d.ts +214 -0
- package/dist/ast/MacroNode.d.ts.map +1 -0
- package/dist/ast/MacroNode.js +110 -0
- package/dist/ast/MacroNode.js.map +1 -0
- package/dist/ast/index.d.ts +10 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +14 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/auth/OAuthEndpoints.d.ts +95 -0
- package/dist/auth/OAuthEndpoints.d.ts.map +1 -0
- package/dist/auth/OAuthEndpoints.js +112 -0
- package/dist/auth/OAuthEndpoints.js.map +1 -0
- package/dist/auth/OAuthErrors.d.ts +76 -0
- package/dist/auth/OAuthErrors.d.ts.map +1 -0
- package/dist/auth/OAuthErrors.js +85 -0
- package/dist/auth/OAuthErrors.js.map +1 -0
- package/dist/auth/OAuthOperations.d.ts +87 -0
- package/dist/auth/OAuthOperations.d.ts.map +1 -0
- package/dist/auth/OAuthOperations.js +169 -0
- package/dist/auth/OAuthOperations.js.map +1 -0
- package/dist/auth/OAuthResponseSchemas.d.ts +65 -0
- package/dist/auth/OAuthResponseSchemas.d.ts.map +1 -0
- package/dist/auth/OAuthResponseSchemas.js +47 -0
- package/dist/auth/OAuthResponseSchemas.js.map +1 -0
- package/dist/auth/index.d.ts +11 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +16 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/uuid.d.ts +14 -0
- package/dist/auth/uuid.d.ts.map +1 -0
- package/dist/auth/uuid.js +14 -0
- package/dist/auth/uuid.js.map +1 -0
- package/dist/config/ConfigPaths.d.ts +95 -0
- package/dist/config/ConfigPaths.d.ts.map +1 -0
- package/dist/config/ConfigPaths.js +102 -0
- package/dist/config/ConfigPaths.js.map +1 -0
- package/dist/config/OAuthSchemas.d.ts +144 -0
- package/dist/config/OAuthSchemas.d.ts.map +1 -0
- package/dist/config/OAuthSchemas.js +107 -0
- package/dist/config/OAuthSchemas.js.map +1 -0
- package/dist/config/TokenStorage.d.ts +96 -0
- package/dist/config/TokenStorage.d.ts.map +1 -0
- package/dist/config/TokenStorage.js +128 -0
- package/dist/config/TokenStorage.js.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +12 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/index.d.ts +7 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +8 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/serializers/MarkdownSerializer.d.ts +63 -0
- package/dist/serializers/MarkdownSerializer.d.ts.map +1 -0
- package/dist/serializers/MarkdownSerializer.js +367 -0
- package/dist/serializers/MarkdownSerializer.js.map +1 -0
- package/dist/serializers/index.d.ts +7 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/serializers/index.js +7 -0
- package/dist/serializers/index.js.map +1 -0
- package/package.json +86 -0
- package/src/Brand.ts +142 -0
- package/src/Hash.ts +68 -0
- package/src/SerializeError.ts +50 -0
- package/src/ast/BlockNode.ts +386 -0
- package/src/ast/Document.ts +101 -0
- package/src/ast/InlineNode.ts +328 -0
- package/src/ast/MacroNode.ts +172 -0
- package/src/ast/index.ts +87 -0
- package/src/auth/OAuthEndpoints.ts +142 -0
- package/src/auth/OAuthErrors.ts +101 -0
- package/src/auth/OAuthOperations.ts +276 -0
- package/src/auth/OAuthResponseSchemas.ts +70 -0
- package/src/auth/index.ts +47 -0
- package/src/auth/uuid.ts +14 -0
- package/src/config/ConfigPaths.ts +179 -0
- package/src/config/OAuthSchemas.ts +146 -0
- package/src/config/TokenStorage.ts +228 -0
- package/src/config/index.ts +43 -0
- package/src/index.ts +34 -0
- package/src/parsers/index.ts +8 -0
- package/src/serializers/MarkdownSerializer.ts +498 -0
- package/src/serializers/index.ts +7 -0
- package/test/Brand.test.ts +90 -0
- package/test/MarkdownSerializer.test.ts +82 -0
- package/test/OAuthEndpoints.test.ts +109 -0
- package/test/OAuthOperations.test.ts +315 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block-level AST nodes for Atlassian content (headings, paragraphs, tables, lists, etc.).
|
|
3
|
+
*
|
|
4
|
+
* **Mental model**
|
|
5
|
+
*
|
|
6
|
+
* - **Schema-driven ADT**: Each node is an Effect `Schema.Struct` with a `_tag` discriminant,
|
|
7
|
+
* composed into the {@link BlockNode} union via `Schema.Union`.
|
|
8
|
+
* - **Recursive via suspend**: `List` → `ListItem` → `BlockNode` cycles use `Schema.suspend`
|
|
9
|
+
* to break infinite type recursion.
|
|
10
|
+
* - **Inline children**: Most blocks contain `InlineNode` children for text-level content.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import * as Schema from "effect/Schema";
|
|
15
|
+
import { type InlineNode as InlineNodeType } from "./InlineNode.js";
|
|
16
|
+
/**
|
|
17
|
+
* Schema version for migration support.
|
|
18
|
+
*
|
|
19
|
+
* @category Version
|
|
20
|
+
*/
|
|
21
|
+
export declare const SchemaVersion: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
22
|
+
default: () => number;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Optional raw source for exact roundtrip preservation.
|
|
26
|
+
*
|
|
27
|
+
* @category BlockNode
|
|
28
|
+
*/
|
|
29
|
+
export declare const RawSource: Schema.optional<typeof Schema.String>;
|
|
30
|
+
declare const Heading_base: Schema.TaggedClass<Heading, "Heading", {
|
|
31
|
+
readonly _tag: Schema.tag<"Heading">;
|
|
32
|
+
} & {
|
|
33
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
34
|
+
default: () => number;
|
|
35
|
+
}>;
|
|
36
|
+
level: Schema.Literal<[1, 2, 3, 4, 5, 6]>;
|
|
37
|
+
children: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
38
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Heading element (h1-h6).
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import { Heading, Text } from "@knpkv/atlassian-common/ast"
|
|
46
|
+
*
|
|
47
|
+
* const h1 = new Heading({
|
|
48
|
+
* level: 1,
|
|
49
|
+
* children: [new Text({ value: "Introduction" })]
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @category BlockNode
|
|
54
|
+
*/
|
|
55
|
+
export declare class Heading extends Heading_base {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Text alignment options.
|
|
59
|
+
*
|
|
60
|
+
* @category BlockNode
|
|
61
|
+
*/
|
|
62
|
+
export declare const TextAlignment: Schema.Literal<["left", "center", "right"]>;
|
|
63
|
+
/**
|
|
64
|
+
* Type for TextAlignment.
|
|
65
|
+
*
|
|
66
|
+
* @category Types
|
|
67
|
+
*/
|
|
68
|
+
export type TextAlignment = Schema.Schema.Type<typeof TextAlignment>;
|
|
69
|
+
declare const Paragraph_base: Schema.TaggedClass<Paragraph, "Paragraph", {
|
|
70
|
+
readonly _tag: Schema.tag<"Paragraph">;
|
|
71
|
+
} & {
|
|
72
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
73
|
+
default: () => number;
|
|
74
|
+
}>;
|
|
75
|
+
alignment: Schema.optional<Schema.Literal<["left", "center", "right"]>>;
|
|
76
|
+
indent: Schema.optional<typeof Schema.Number>;
|
|
77
|
+
children: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
78
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Paragraph element with optional alignment and indentation.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* import { Paragraph, Text } from "@knpkv/atlassian-common/ast"
|
|
86
|
+
*
|
|
87
|
+
* const para = new Paragraph({
|
|
88
|
+
* children: [new Text({ value: "Hello world" })]
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @category BlockNode
|
|
93
|
+
*/
|
|
94
|
+
export declare class Paragraph extends Paragraph_base {
|
|
95
|
+
}
|
|
96
|
+
declare const CodeBlock_base: Schema.TaggedClass<CodeBlock, "CodeBlock", {
|
|
97
|
+
readonly _tag: Schema.tag<"CodeBlock">;
|
|
98
|
+
} & {
|
|
99
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
100
|
+
default: () => number;
|
|
101
|
+
}>;
|
|
102
|
+
language: Schema.optional<typeof Schema.String>;
|
|
103
|
+
code: typeof Schema.String;
|
|
104
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Code block with optional language.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* import { CodeBlock } from "@knpkv/atlassian-common/ast"
|
|
112
|
+
*
|
|
113
|
+
* const code = new CodeBlock({
|
|
114
|
+
* language: "typescript",
|
|
115
|
+
* code: "const x = 1"
|
|
116
|
+
* })
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @category BlockNode
|
|
120
|
+
*/
|
|
121
|
+
export declare class CodeBlock extends CodeBlock_base {
|
|
122
|
+
}
|
|
123
|
+
declare const ThematicBreak_base: Schema.TaggedClass<ThematicBreak, "ThematicBreak", {
|
|
124
|
+
readonly _tag: Schema.tag<"ThematicBreak">;
|
|
125
|
+
} & {
|
|
126
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Thematic break / horizontal rule.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* import { ThematicBreak } from "@knpkv/atlassian-common/ast"
|
|
134
|
+
*
|
|
135
|
+
* const hr = new ThematicBreak({})
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @category BlockNode
|
|
139
|
+
*/
|
|
140
|
+
export declare class ThematicBreak extends ThematicBreak_base {
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Attachment reference for images.
|
|
144
|
+
*
|
|
145
|
+
* @category BlockNode
|
|
146
|
+
*/
|
|
147
|
+
export declare const ImageAttachment: Schema.Struct<{
|
|
148
|
+
filename: typeof Schema.String;
|
|
149
|
+
version: Schema.optional<typeof Schema.Number>;
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Type for ImageAttachment.
|
|
153
|
+
*
|
|
154
|
+
* @category Types
|
|
155
|
+
*/
|
|
156
|
+
export type ImageAttachment = Schema.Schema.Type<typeof ImageAttachment>;
|
|
157
|
+
declare const Image_base: Schema.TaggedClass<Image, "Image", {
|
|
158
|
+
readonly _tag: Schema.tag<"Image">;
|
|
159
|
+
} & {
|
|
160
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
161
|
+
default: () => number;
|
|
162
|
+
}>;
|
|
163
|
+
src: Schema.optional<typeof Schema.String>;
|
|
164
|
+
attachment: Schema.optional<Schema.Struct<{
|
|
165
|
+
filename: typeof Schema.String;
|
|
166
|
+
version: Schema.optional<typeof Schema.Number>;
|
|
167
|
+
}>>;
|
|
168
|
+
alt: Schema.optional<typeof Schema.String>;
|
|
169
|
+
title: Schema.optional<typeof Schema.String>;
|
|
170
|
+
align: Schema.optional<typeof Schema.String>;
|
|
171
|
+
width: Schema.optional<typeof Schema.Number>;
|
|
172
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
173
|
+
}>;
|
|
174
|
+
/**
|
|
175
|
+
* Image element with support for both URL and attachments.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* import { Image } from "@knpkv/atlassian-common/ast"
|
|
180
|
+
*
|
|
181
|
+
* const img = new Image({
|
|
182
|
+
* src: "https://example.com/image.png",
|
|
183
|
+
* alt: "Example image"
|
|
184
|
+
* })
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @category BlockNode
|
|
188
|
+
*/
|
|
189
|
+
export declare class Image extends Image_base {
|
|
190
|
+
}
|
|
191
|
+
declare const TableCell_base: Schema.TaggedClass<TableCell, "TableCell", {
|
|
192
|
+
readonly _tag: Schema.tag<"TableCell">;
|
|
193
|
+
} & {
|
|
194
|
+
isHeader: Schema.optionalWith<typeof Schema.Boolean, {
|
|
195
|
+
default: () => false;
|
|
196
|
+
}>;
|
|
197
|
+
children: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
198
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
199
|
+
}>;
|
|
200
|
+
/**
|
|
201
|
+
* Table cell element.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* import { TableCell, Text } from "@knpkv/atlassian-common/ast"
|
|
206
|
+
*
|
|
207
|
+
* const cell = new TableCell({
|
|
208
|
+
* isHeader: true,
|
|
209
|
+
* children: [new Text({ value: "Header" })]
|
|
210
|
+
* })
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @category BlockNode
|
|
214
|
+
*/
|
|
215
|
+
export declare class TableCell extends TableCell_base {
|
|
216
|
+
}
|
|
217
|
+
declare const TableRow_base: Schema.TaggedClass<TableRow, "TableRow", {
|
|
218
|
+
readonly _tag: Schema.tag<"TableRow">;
|
|
219
|
+
} & {
|
|
220
|
+
cells: Schema.Array$<typeof TableCell>;
|
|
221
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
222
|
+
}>;
|
|
223
|
+
/**
|
|
224
|
+
* Table row element.
|
|
225
|
+
*
|
|
226
|
+
* @category BlockNode
|
|
227
|
+
*/
|
|
228
|
+
export declare class TableRow extends TableRow_base {
|
|
229
|
+
}
|
|
230
|
+
declare const Table_base: Schema.TaggedClass<Table, "Table", {
|
|
231
|
+
readonly _tag: Schema.tag<"Table">;
|
|
232
|
+
} & {
|
|
233
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
234
|
+
default: () => number;
|
|
235
|
+
}>;
|
|
236
|
+
header: Schema.optional<typeof TableRow>;
|
|
237
|
+
rows: Schema.Array$<typeof TableRow>;
|
|
238
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
239
|
+
}>;
|
|
240
|
+
/**
|
|
241
|
+
* Table element with optional header row.
|
|
242
|
+
*
|
|
243
|
+
* @category BlockNode
|
|
244
|
+
*/
|
|
245
|
+
export declare class Table extends Table_base {
|
|
246
|
+
}
|
|
247
|
+
declare const UnsupportedBlock_base: Schema.TaggedClass<UnsupportedBlock, "UnsupportedBlock", {
|
|
248
|
+
readonly _tag: Schema.tag<"UnsupportedBlock">;
|
|
249
|
+
} & {
|
|
250
|
+
rawHtml: Schema.optional<typeof Schema.String>;
|
|
251
|
+
rawMarkdown: Schema.optional<typeof Schema.String>;
|
|
252
|
+
rawAdf: Schema.optional<typeof Schema.String>;
|
|
253
|
+
source: Schema.Literal<["confluence", "markdown", "adf"]>;
|
|
254
|
+
}>;
|
|
255
|
+
/**
|
|
256
|
+
* Unsupported block element - preserves raw content for round-tripping.
|
|
257
|
+
*
|
|
258
|
+
* @category BlockNode
|
|
259
|
+
*/
|
|
260
|
+
export declare class UnsupportedBlock extends UnsupportedBlock_base {
|
|
261
|
+
}
|
|
262
|
+
declare const SimpleBlockNode: Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>;
|
|
263
|
+
/**
|
|
264
|
+
* Block quote element with nested block content.
|
|
265
|
+
*
|
|
266
|
+
* @category BlockNode
|
|
267
|
+
*/
|
|
268
|
+
export declare const BlockQuote: Schema.Struct<{
|
|
269
|
+
_tag: Schema.Literal<["BlockQuote"]>;
|
|
270
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
271
|
+
default: () => number;
|
|
272
|
+
}>;
|
|
273
|
+
children: Schema.Array$<Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>>;
|
|
274
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
275
|
+
}>;
|
|
276
|
+
/**
|
|
277
|
+
* Type for BlockQuote.
|
|
278
|
+
*
|
|
279
|
+
* @category Types
|
|
280
|
+
*/
|
|
281
|
+
export type BlockQuote = Schema.Schema.Type<typeof BlockQuote>;
|
|
282
|
+
/**
|
|
283
|
+
* List item with nested block content.
|
|
284
|
+
*
|
|
285
|
+
* @category BlockNode
|
|
286
|
+
*/
|
|
287
|
+
export declare const ListItem: Schema.Struct<{
|
|
288
|
+
_tag: Schema.Literal<["ListItem"]>;
|
|
289
|
+
checked: Schema.optional<typeof Schema.Boolean>;
|
|
290
|
+
children: Schema.Array$<Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>>;
|
|
291
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
292
|
+
}>;
|
|
293
|
+
/**
|
|
294
|
+
* Type for ListItem.
|
|
295
|
+
*
|
|
296
|
+
* @category Types
|
|
297
|
+
*/
|
|
298
|
+
export type ListItem = Schema.Schema.Type<typeof ListItem>;
|
|
299
|
+
/**
|
|
300
|
+
* List element (ordered or unordered).
|
|
301
|
+
*
|
|
302
|
+
* @category BlockNode
|
|
303
|
+
*/
|
|
304
|
+
export declare const List: Schema.Struct<{
|
|
305
|
+
_tag: Schema.Literal<["List"]>;
|
|
306
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
307
|
+
default: () => number;
|
|
308
|
+
}>;
|
|
309
|
+
ordered: typeof Schema.Boolean;
|
|
310
|
+
start: Schema.optional<typeof Schema.Number>;
|
|
311
|
+
children: Schema.Array$<Schema.Struct<{
|
|
312
|
+
_tag: Schema.Literal<["ListItem"]>;
|
|
313
|
+
checked: Schema.optional<typeof Schema.Boolean>;
|
|
314
|
+
children: Schema.Array$<Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>>;
|
|
315
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
316
|
+
}>>;
|
|
317
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
318
|
+
}>;
|
|
319
|
+
/**
|
|
320
|
+
* Type for List.
|
|
321
|
+
*
|
|
322
|
+
* @category Types
|
|
323
|
+
*/
|
|
324
|
+
export type List = Schema.Schema.Type<typeof List>;
|
|
325
|
+
/**
|
|
326
|
+
* Task item with status.
|
|
327
|
+
*
|
|
328
|
+
* @category BlockNode
|
|
329
|
+
*/
|
|
330
|
+
export declare const TaskItem: Schema.Struct<{
|
|
331
|
+
_tag: Schema.Literal<["TaskItem"]>;
|
|
332
|
+
id: typeof Schema.String;
|
|
333
|
+
uuid: typeof Schema.String;
|
|
334
|
+
status: Schema.Literal<["incomplete", "complete"]>;
|
|
335
|
+
body: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
336
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
337
|
+
}>;
|
|
338
|
+
/**
|
|
339
|
+
* Type for TaskItem.
|
|
340
|
+
*
|
|
341
|
+
* @category Types
|
|
342
|
+
*/
|
|
343
|
+
export type TaskItem = Schema.Schema.Type<typeof TaskItem>;
|
|
344
|
+
/**
|
|
345
|
+
* Task list.
|
|
346
|
+
*
|
|
347
|
+
* @category BlockNode
|
|
348
|
+
*/
|
|
349
|
+
export declare const TaskList: Schema.Struct<{
|
|
350
|
+
_tag: Schema.Literal<["TaskList"]>;
|
|
351
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
352
|
+
default: () => number;
|
|
353
|
+
}>;
|
|
354
|
+
children: Schema.Array$<Schema.Struct<{
|
|
355
|
+
_tag: Schema.Literal<["TaskItem"]>;
|
|
356
|
+
id: typeof Schema.String;
|
|
357
|
+
uuid: typeof Schema.String;
|
|
358
|
+
status: Schema.Literal<["incomplete", "complete"]>;
|
|
359
|
+
body: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
360
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
361
|
+
}>>;
|
|
362
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
363
|
+
}>;
|
|
364
|
+
/**
|
|
365
|
+
* Type for TaskList.
|
|
366
|
+
*
|
|
367
|
+
* @category Types
|
|
368
|
+
*/
|
|
369
|
+
export type TaskList = Schema.Schema.Type<typeof TaskList>;
|
|
370
|
+
/**
|
|
371
|
+
* Union of all block node types.
|
|
372
|
+
*
|
|
373
|
+
* @category BlockNode
|
|
374
|
+
*/
|
|
375
|
+
export declare const BlockNode: Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, Schema.Struct<{
|
|
376
|
+
_tag: Schema.Literal<["BlockQuote"]>;
|
|
377
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
378
|
+
default: () => number;
|
|
379
|
+
}>;
|
|
380
|
+
children: Schema.Array$<Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>>;
|
|
381
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
382
|
+
}>, typeof Image, typeof Table, Schema.Struct<{
|
|
383
|
+
_tag: Schema.Literal<["List"]>;
|
|
384
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
385
|
+
default: () => number;
|
|
386
|
+
}>;
|
|
387
|
+
ordered: typeof Schema.Boolean;
|
|
388
|
+
start: Schema.optional<typeof Schema.Number>;
|
|
389
|
+
children: Schema.Array$<Schema.Struct<{
|
|
390
|
+
_tag: Schema.Literal<["ListItem"]>;
|
|
391
|
+
checked: Schema.optional<typeof Schema.Boolean>;
|
|
392
|
+
children: Schema.Array$<Schema.Union<[typeof Heading, typeof Paragraph, typeof CodeBlock, typeof ThematicBreak, typeof Image, typeof Table, typeof UnsupportedBlock]>>;
|
|
393
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
394
|
+
}>>;
|
|
395
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
396
|
+
}>, Schema.Struct<{
|
|
397
|
+
_tag: Schema.Literal<["TaskList"]>;
|
|
398
|
+
version: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
399
|
+
default: () => number;
|
|
400
|
+
}>;
|
|
401
|
+
children: Schema.Array$<Schema.Struct<{
|
|
402
|
+
_tag: Schema.Literal<["TaskItem"]>;
|
|
403
|
+
id: typeof Schema.String;
|
|
404
|
+
uuid: typeof Schema.String;
|
|
405
|
+
status: Schema.Literal<["incomplete", "complete"]>;
|
|
406
|
+
body: Schema.Array$<Schema.Union<[typeof import("./InlineNode.js").Text, typeof import("./InlineNode.js").Strong, typeof import("./InlineNode.js").Emphasis, typeof import("./InlineNode.js").InlineCode, typeof import("./InlineNode.js").Link, typeof import("./InlineNode.js").LineBreak, typeof import("./InlineNode.js").Emoticon, typeof import("./InlineNode.js").UserMention, typeof import("./InlineNode.js").DateTime, typeof import("./InlineNode.js").Underline, typeof import("./InlineNode.js").Subscript, typeof import("./InlineNode.js").Superscript, typeof import("./InlineNode.js").Strikethrough, typeof import("./InlineNode.js").ColoredText, typeof import("./InlineNode.js").Highlight, typeof import("./InlineNode.js").UnsupportedInline]>>;
|
|
407
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
408
|
+
}>>;
|
|
409
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
410
|
+
}>, typeof UnsupportedBlock]>;
|
|
411
|
+
/**
|
|
412
|
+
* Type for block nodes.
|
|
413
|
+
*
|
|
414
|
+
* @category Types
|
|
415
|
+
*/
|
|
416
|
+
export type BlockNode = Heading | Paragraph | CodeBlock | ThematicBreak | BlockQuote | Image | Table | List | TaskList | UnsupportedBlock;
|
|
417
|
+
/**
|
|
418
|
+
* Type helper for inline node children in blocks.
|
|
419
|
+
*
|
|
420
|
+
* @category Types
|
|
421
|
+
*/
|
|
422
|
+
export type { InlineNodeType as InlineNode };
|
|
423
|
+
/**
|
|
424
|
+
* Simple block nodes (non-recursive).
|
|
425
|
+
*
|
|
426
|
+
* @category BlockNode
|
|
427
|
+
*/
|
|
428
|
+
export { SimpleBlockNode };
|
|
429
|
+
//# sourceMappingURL=BlockNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockNode.d.ts","sourceRoot":"","sources":["../../src/ast/BlockNode.ts"],"names":[],"mappings":"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"}
|