@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,483 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline-level AST nodes for text content (emphasis, links, mentions, etc.).
|
|
3
|
+
*
|
|
4
|
+
* **Mental model**
|
|
5
|
+
*
|
|
6
|
+
* - **Leaf and recursive nodes**: `Text`, `InlineCode`, `LineBreak` are leaves;
|
|
7
|
+
* `Strong`, `Emphasis`, `Highlight` contain nested `InlineNode` children via `Schema.suspend`.
|
|
8
|
+
* - **Unsupported preservation**: {@link UnsupportedInline} captures raw content that can't be
|
|
9
|
+
* mapped, enabling non-destructive roundtrips.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
/**
|
|
15
|
+
* Optional raw source HTML for exact roundtrip preservation.
|
|
16
|
+
*
|
|
17
|
+
* @category InlineNode
|
|
18
|
+
*/
|
|
19
|
+
export declare const RawSource: Schema.optional<typeof Schema.String>;
|
|
20
|
+
declare const Text_base: Schema.TaggedClass<Text, "Text", {
|
|
21
|
+
readonly _tag: Schema.tag<"Text">;
|
|
22
|
+
} & {
|
|
23
|
+
value: typeof Schema.String;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Plain text content.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { Text } from "@knpkv/atlassian-common/ast"
|
|
31
|
+
*
|
|
32
|
+
* const text = new Text({ value: "Hello world" })
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @category InlineNode
|
|
36
|
+
*/
|
|
37
|
+
export declare class Text extends Text_base {
|
|
38
|
+
}
|
|
39
|
+
declare const InlineCode_base: Schema.TaggedClass<InlineCode, "InlineCode", {
|
|
40
|
+
readonly _tag: Schema.tag<"InlineCode">;
|
|
41
|
+
} & {
|
|
42
|
+
value: typeof Schema.String;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Inline code span.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { InlineCode } from "@knpkv/atlassian-common/ast"
|
|
50
|
+
*
|
|
51
|
+
* const code = new InlineCode({ value: "const x = 1" })
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category InlineNode
|
|
55
|
+
*/
|
|
56
|
+
export declare class InlineCode extends InlineCode_base {
|
|
57
|
+
}
|
|
58
|
+
declare const LineBreak_base: Schema.TaggedClass<LineBreak, "LineBreak", {
|
|
59
|
+
readonly _tag: Schema.tag<"LineBreak">;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Line break element.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { LineBreak } from "@knpkv/atlassian-common/ast"
|
|
67
|
+
*
|
|
68
|
+
* const br = new LineBreak({})
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @category InlineNode
|
|
72
|
+
*/
|
|
73
|
+
export declare class LineBreak extends LineBreak_base {
|
|
74
|
+
}
|
|
75
|
+
declare const UnsupportedInline_base: Schema.TaggedClass<UnsupportedInline, "UnsupportedInline", {
|
|
76
|
+
readonly _tag: Schema.tag<"UnsupportedInline">;
|
|
77
|
+
} & {
|
|
78
|
+
raw: typeof Schema.String;
|
|
79
|
+
source: Schema.Literal<["confluence", "markdown", "adf"]>;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Unsupported inline element - preserves raw content for round-tripping.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* import { UnsupportedInline } from "@knpkv/atlassian-common/ast"
|
|
87
|
+
*
|
|
88
|
+
* const unknown = new UnsupportedInline({
|
|
89
|
+
* raw: "<custom-tag>content</custom-tag>",
|
|
90
|
+
* source: "confluence"
|
|
91
|
+
* })
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @category InlineNode
|
|
95
|
+
*/
|
|
96
|
+
export declare class UnsupportedInline extends UnsupportedInline_base {
|
|
97
|
+
}
|
|
98
|
+
declare const Emoticon_base: Schema.TaggedClass<Emoticon, "Emoticon", {
|
|
99
|
+
readonly _tag: Schema.tag<"Emoticon">;
|
|
100
|
+
} & {
|
|
101
|
+
shortname: typeof Schema.String;
|
|
102
|
+
emojiId: typeof Schema.String;
|
|
103
|
+
fallback: typeof Schema.String;
|
|
104
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Emoticon/emoji element.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* import { Emoticon } from "@knpkv/atlassian-common/ast"
|
|
112
|
+
*
|
|
113
|
+
* const emoji = new Emoticon({
|
|
114
|
+
* shortname: ":grinning:",
|
|
115
|
+
* emojiId: "1f600",
|
|
116
|
+
* fallback: "grinning"
|
|
117
|
+
* })
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @category InlineNode
|
|
121
|
+
*/
|
|
122
|
+
export declare class Emoticon extends Emoticon_base {
|
|
123
|
+
}
|
|
124
|
+
declare const UserMention_base: Schema.TaggedClass<UserMention, "UserMention", {
|
|
125
|
+
readonly _tag: Schema.tag<"UserMention">;
|
|
126
|
+
} & {
|
|
127
|
+
accountId: typeof Schema.String;
|
|
128
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
129
|
+
}>;
|
|
130
|
+
/**
|
|
131
|
+
* User mention element.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* import { UserMention } from "@knpkv/atlassian-common/ast"
|
|
136
|
+
*
|
|
137
|
+
* const mention = new UserMention({ accountId: "557058:..." })
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @category InlineNode
|
|
141
|
+
*/
|
|
142
|
+
export declare class UserMention extends UserMention_base {
|
|
143
|
+
}
|
|
144
|
+
declare const DateTime_base: Schema.TaggedClass<DateTime, "DateTime", {
|
|
145
|
+
readonly _tag: Schema.tag<"DateTime">;
|
|
146
|
+
} & {
|
|
147
|
+
datetime: typeof Schema.String;
|
|
148
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
149
|
+
}>;
|
|
150
|
+
/**
|
|
151
|
+
* Date/time element.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* import { DateTime } from "@knpkv/atlassian-common/ast"
|
|
156
|
+
*
|
|
157
|
+
* const date = new DateTime({ datetime: "2026-01-01" })
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @category InlineNode
|
|
161
|
+
*/
|
|
162
|
+
export declare class DateTime extends DateTime_base {
|
|
163
|
+
}
|
|
164
|
+
declare const Underline_base: Schema.TaggedClass<Underline, "Underline", {
|
|
165
|
+
readonly _tag: Schema.tag<"Underline">;
|
|
166
|
+
} & {
|
|
167
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
168
|
+
readonly value: string;
|
|
169
|
+
readonly _tag: "Text";
|
|
170
|
+
} | {
|
|
171
|
+
readonly value: string;
|
|
172
|
+
readonly _tag: "InlineCode";
|
|
173
|
+
} | {
|
|
174
|
+
readonly _tag: "LineBreak";
|
|
175
|
+
} | {
|
|
176
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
177
|
+
readonly _tag: "UnsupportedInline";
|
|
178
|
+
readonly raw: string;
|
|
179
|
+
} | {
|
|
180
|
+
readonly _tag: "Emoticon";
|
|
181
|
+
readonly shortname: string;
|
|
182
|
+
readonly emojiId: string;
|
|
183
|
+
readonly fallback: string;
|
|
184
|
+
readonly rawSource?: string | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
readonly _tag: "UserMention";
|
|
187
|
+
readonly accountId: string;
|
|
188
|
+
readonly rawSource?: string | undefined;
|
|
189
|
+
} | {
|
|
190
|
+
readonly _tag: "DateTime";
|
|
191
|
+
readonly datetime: string;
|
|
192
|
+
readonly rawSource?: string | undefined;
|
|
193
|
+
})[], never>;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Underlined text.
|
|
197
|
+
*
|
|
198
|
+
* @category InlineNode
|
|
199
|
+
*/
|
|
200
|
+
export declare class Underline extends Underline_base {
|
|
201
|
+
}
|
|
202
|
+
declare const Subscript_base: Schema.TaggedClass<Subscript, "Subscript", {
|
|
203
|
+
readonly _tag: Schema.tag<"Subscript">;
|
|
204
|
+
} & {
|
|
205
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
206
|
+
readonly value: string;
|
|
207
|
+
readonly _tag: "Text";
|
|
208
|
+
} | {
|
|
209
|
+
readonly value: string;
|
|
210
|
+
readonly _tag: "InlineCode";
|
|
211
|
+
} | {
|
|
212
|
+
readonly _tag: "LineBreak";
|
|
213
|
+
} | {
|
|
214
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
215
|
+
readonly _tag: "UnsupportedInline";
|
|
216
|
+
readonly raw: string;
|
|
217
|
+
} | {
|
|
218
|
+
readonly _tag: "Emoticon";
|
|
219
|
+
readonly shortname: string;
|
|
220
|
+
readonly emojiId: string;
|
|
221
|
+
readonly fallback: string;
|
|
222
|
+
readonly rawSource?: string | undefined;
|
|
223
|
+
} | {
|
|
224
|
+
readonly _tag: "UserMention";
|
|
225
|
+
readonly accountId: string;
|
|
226
|
+
readonly rawSource?: string | undefined;
|
|
227
|
+
} | {
|
|
228
|
+
readonly _tag: "DateTime";
|
|
229
|
+
readonly datetime: string;
|
|
230
|
+
readonly rawSource?: string | undefined;
|
|
231
|
+
})[], never>;
|
|
232
|
+
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Subscript text.
|
|
235
|
+
*
|
|
236
|
+
* @category InlineNode
|
|
237
|
+
*/
|
|
238
|
+
export declare class Subscript extends Subscript_base {
|
|
239
|
+
}
|
|
240
|
+
declare const Superscript_base: Schema.TaggedClass<Superscript, "Superscript", {
|
|
241
|
+
readonly _tag: Schema.tag<"Superscript">;
|
|
242
|
+
} & {
|
|
243
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
244
|
+
readonly value: string;
|
|
245
|
+
readonly _tag: "Text";
|
|
246
|
+
} | {
|
|
247
|
+
readonly value: string;
|
|
248
|
+
readonly _tag: "InlineCode";
|
|
249
|
+
} | {
|
|
250
|
+
readonly _tag: "LineBreak";
|
|
251
|
+
} | {
|
|
252
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
253
|
+
readonly _tag: "UnsupportedInline";
|
|
254
|
+
readonly raw: string;
|
|
255
|
+
} | {
|
|
256
|
+
readonly _tag: "Emoticon";
|
|
257
|
+
readonly shortname: string;
|
|
258
|
+
readonly emojiId: string;
|
|
259
|
+
readonly fallback: string;
|
|
260
|
+
readonly rawSource?: string | undefined;
|
|
261
|
+
} | {
|
|
262
|
+
readonly _tag: "UserMention";
|
|
263
|
+
readonly accountId: string;
|
|
264
|
+
readonly rawSource?: string | undefined;
|
|
265
|
+
} | {
|
|
266
|
+
readonly _tag: "DateTime";
|
|
267
|
+
readonly datetime: string;
|
|
268
|
+
readonly rawSource?: string | undefined;
|
|
269
|
+
})[], never>;
|
|
270
|
+
}>;
|
|
271
|
+
/**
|
|
272
|
+
* Superscript text.
|
|
273
|
+
*
|
|
274
|
+
* @category InlineNode
|
|
275
|
+
*/
|
|
276
|
+
export declare class Superscript extends Superscript_base {
|
|
277
|
+
}
|
|
278
|
+
declare const Strikethrough_base: Schema.TaggedClass<Strikethrough, "Strikethrough", {
|
|
279
|
+
readonly _tag: Schema.tag<"Strikethrough">;
|
|
280
|
+
} & {
|
|
281
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
282
|
+
readonly value: string;
|
|
283
|
+
readonly _tag: "Text";
|
|
284
|
+
} | {
|
|
285
|
+
readonly value: string;
|
|
286
|
+
readonly _tag: "InlineCode";
|
|
287
|
+
} | {
|
|
288
|
+
readonly _tag: "LineBreak";
|
|
289
|
+
} | {
|
|
290
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
291
|
+
readonly _tag: "UnsupportedInline";
|
|
292
|
+
readonly raw: string;
|
|
293
|
+
} | {
|
|
294
|
+
readonly _tag: "Emoticon";
|
|
295
|
+
readonly shortname: string;
|
|
296
|
+
readonly emojiId: string;
|
|
297
|
+
readonly fallback: string;
|
|
298
|
+
readonly rawSource?: string | undefined;
|
|
299
|
+
} | {
|
|
300
|
+
readonly _tag: "UserMention";
|
|
301
|
+
readonly accountId: string;
|
|
302
|
+
readonly rawSource?: string | undefined;
|
|
303
|
+
} | {
|
|
304
|
+
readonly _tag: "DateTime";
|
|
305
|
+
readonly datetime: string;
|
|
306
|
+
readonly rawSource?: string | undefined;
|
|
307
|
+
})[], never>;
|
|
308
|
+
}>;
|
|
309
|
+
/**
|
|
310
|
+
* Strikethrough text.
|
|
311
|
+
*
|
|
312
|
+
* @category InlineNode
|
|
313
|
+
*/
|
|
314
|
+
export declare class Strikethrough extends Strikethrough_base {
|
|
315
|
+
}
|
|
316
|
+
declare const ColoredText_base: Schema.TaggedClass<ColoredText, "ColoredText", {
|
|
317
|
+
readonly _tag: Schema.tag<"ColoredText">;
|
|
318
|
+
} & {
|
|
319
|
+
color: typeof Schema.String;
|
|
320
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
321
|
+
readonly value: string;
|
|
322
|
+
readonly _tag: "Text";
|
|
323
|
+
} | {
|
|
324
|
+
readonly value: string;
|
|
325
|
+
readonly _tag: "InlineCode";
|
|
326
|
+
} | {
|
|
327
|
+
readonly _tag: "LineBreak";
|
|
328
|
+
} | {
|
|
329
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
330
|
+
readonly _tag: "UnsupportedInline";
|
|
331
|
+
readonly raw: string;
|
|
332
|
+
} | {
|
|
333
|
+
readonly _tag: "Emoticon";
|
|
334
|
+
readonly shortname: string;
|
|
335
|
+
readonly emojiId: string;
|
|
336
|
+
readonly fallback: string;
|
|
337
|
+
readonly rawSource?: string | undefined;
|
|
338
|
+
} | {
|
|
339
|
+
readonly _tag: "UserMention";
|
|
340
|
+
readonly accountId: string;
|
|
341
|
+
readonly rawSource?: string | undefined;
|
|
342
|
+
} | {
|
|
343
|
+
readonly _tag: "DateTime";
|
|
344
|
+
readonly datetime: string;
|
|
345
|
+
readonly rawSource?: string | undefined;
|
|
346
|
+
})[], never>;
|
|
347
|
+
}>;
|
|
348
|
+
/**
|
|
349
|
+
* Colored text with CSS color value.
|
|
350
|
+
*
|
|
351
|
+
* @category InlineNode
|
|
352
|
+
*/
|
|
353
|
+
export declare class ColoredText extends ColoredText_base {
|
|
354
|
+
}
|
|
355
|
+
declare const Highlight_base: Schema.TaggedClass<Highlight, "Highlight", {
|
|
356
|
+
readonly _tag: Schema.tag<"Highlight">;
|
|
357
|
+
} & {
|
|
358
|
+
backgroundColor: typeof Schema.String;
|
|
359
|
+
children: Schema.suspend<readonly (Text | InlineCode | LineBreak | UnsupportedInline | Emoticon | UserMention | DateTime)[], readonly ({
|
|
360
|
+
readonly value: string;
|
|
361
|
+
readonly _tag: "Text";
|
|
362
|
+
} | {
|
|
363
|
+
readonly value: string;
|
|
364
|
+
readonly _tag: "InlineCode";
|
|
365
|
+
} | {
|
|
366
|
+
readonly _tag: "LineBreak";
|
|
367
|
+
} | {
|
|
368
|
+
readonly source: "confluence" | "markdown" | "adf";
|
|
369
|
+
readonly _tag: "UnsupportedInline";
|
|
370
|
+
readonly raw: string;
|
|
371
|
+
} | {
|
|
372
|
+
readonly _tag: "Emoticon";
|
|
373
|
+
readonly shortname: string;
|
|
374
|
+
readonly emojiId: string;
|
|
375
|
+
readonly fallback: string;
|
|
376
|
+
readonly rawSource?: string | undefined;
|
|
377
|
+
} | {
|
|
378
|
+
readonly _tag: "UserMention";
|
|
379
|
+
readonly accountId: string;
|
|
380
|
+
readonly rawSource?: string | undefined;
|
|
381
|
+
} | {
|
|
382
|
+
readonly _tag: "DateTime";
|
|
383
|
+
readonly datetime: string;
|
|
384
|
+
readonly rawSource?: string | undefined;
|
|
385
|
+
})[], never>;
|
|
386
|
+
}>;
|
|
387
|
+
/**
|
|
388
|
+
* Highlighted text with background color.
|
|
389
|
+
*
|
|
390
|
+
* @category InlineNode
|
|
391
|
+
*/
|
|
392
|
+
export declare class Highlight extends Highlight_base {
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Inline node children schema - use this for recursive inline content.
|
|
396
|
+
*
|
|
397
|
+
* @category InlineNode
|
|
398
|
+
*/
|
|
399
|
+
export declare const InlineNodeChildren: Schema.Schema<ReadonlyArray<InlineNode>>;
|
|
400
|
+
declare const Strong_base: Schema.TaggedClass<Strong, "Strong", {
|
|
401
|
+
readonly _tag: Schema.tag<"Strong">;
|
|
402
|
+
} & {
|
|
403
|
+
children: Schema.suspend<readonly InlineNode[], readonly InlineNode[], never>;
|
|
404
|
+
}>;
|
|
405
|
+
/**
|
|
406
|
+
* Strong/bold text.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```typescript
|
|
410
|
+
* import { Strong, Text } from "@knpkv/atlassian-common/ast"
|
|
411
|
+
*
|
|
412
|
+
* const bold = new Strong({ children: [new Text({ value: "important" })] })
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
415
|
+
* @category InlineNode
|
|
416
|
+
*/
|
|
417
|
+
export declare class Strong extends Strong_base {
|
|
418
|
+
}
|
|
419
|
+
declare const Emphasis_base: Schema.TaggedClass<Emphasis, "Emphasis", {
|
|
420
|
+
readonly _tag: Schema.tag<"Emphasis">;
|
|
421
|
+
} & {
|
|
422
|
+
children: Schema.suspend<readonly InlineNode[], readonly InlineNode[], never>;
|
|
423
|
+
}>;
|
|
424
|
+
/**
|
|
425
|
+
* Emphasized/italic text.
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* ```typescript
|
|
429
|
+
* import { Emphasis, Text } from "@knpkv/atlassian-common/ast"
|
|
430
|
+
*
|
|
431
|
+
* const italic = new Emphasis({ children: [new Text({ value: "emphasized" })] })
|
|
432
|
+
* ```
|
|
433
|
+
*
|
|
434
|
+
* @category InlineNode
|
|
435
|
+
*/
|
|
436
|
+
export declare class Emphasis extends Emphasis_base {
|
|
437
|
+
}
|
|
438
|
+
declare const Link_base: Schema.TaggedClass<Link, "Link", {
|
|
439
|
+
readonly _tag: Schema.tag<"Link">;
|
|
440
|
+
} & {
|
|
441
|
+
href: typeof Schema.String;
|
|
442
|
+
title: Schema.optional<typeof Schema.String>;
|
|
443
|
+
children: Schema.suspend<readonly InlineNode[], readonly InlineNode[], never>;
|
|
444
|
+
rawSource: Schema.optional<typeof Schema.String>;
|
|
445
|
+
}>;
|
|
446
|
+
/**
|
|
447
|
+
* Hyperlink with optional title.
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```typescript
|
|
451
|
+
* import { Link, Text } from "@knpkv/atlassian-common/ast"
|
|
452
|
+
*
|
|
453
|
+
* const link = new Link({
|
|
454
|
+
* href: "https://example.com",
|
|
455
|
+
* title: "Example",
|
|
456
|
+
* children: [new Text({ value: "Click here" })]
|
|
457
|
+
* })
|
|
458
|
+
* ```
|
|
459
|
+
*
|
|
460
|
+
* @category InlineNode
|
|
461
|
+
*/
|
|
462
|
+
export declare class Link extends Link_base {
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Union of all inline node types.
|
|
466
|
+
*
|
|
467
|
+
* @category InlineNode
|
|
468
|
+
*/
|
|
469
|
+
export declare const InlineNode: Schema.Union<[typeof Text, typeof Strong, typeof Emphasis, typeof InlineCode, typeof Link, typeof LineBreak, typeof Emoticon, typeof UserMention, typeof DateTime, typeof Underline, typeof Subscript, typeof Superscript, typeof Strikethrough, typeof ColoredText, typeof Highlight, typeof UnsupportedInline]>;
|
|
470
|
+
/**
|
|
471
|
+
* Type for inline nodes.
|
|
472
|
+
*
|
|
473
|
+
* @category Types
|
|
474
|
+
*/
|
|
475
|
+
export type InlineNode = Text | Strong | Emphasis | InlineCode | Link | LineBreak | Emoticon | UserMention | DateTime | Underline | Subscript | Superscript | Strikethrough | ColoredText | Highlight | UnsupportedInline;
|
|
476
|
+
/**
|
|
477
|
+
* Schema type helper for InlineNode.
|
|
478
|
+
*
|
|
479
|
+
* @category Types
|
|
480
|
+
*/
|
|
481
|
+
export type InlineNodeSchema = typeof InlineNode;
|
|
482
|
+
export {};
|
|
483
|
+
//# sourceMappingURL=InlineNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineNode.d.ts","sourceRoot":"","sources":["../../src/ast/InlineNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,SAAS,uCAAiC,CAAA;;;;;;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,IAAK,SAAQ,SAExB;CAAG;;;;;;AAEL;;;;;;;;;;;GAWG;AACH,qBAAa,UAAW,SAAQ,eAE9B;CAAG;;;;AAEL;;;;;;;;;;;GAWG;AACH,qBAAa,SAAU,SAAQ,cAAgD;CAAG;;;;;;;AAElF;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAkB,SAAQ,sBAGrC;CAAG;;;;;;;;;AAEL;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAS,SAAQ,aAK5B;CAAG;;;;;;;AAEL;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;;;;;;;AAEL;;;;;;;;;;;GAWG;AACH,qBAAa,QAAS,SAAQ,aAG5B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,cAE7B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,cAE7B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,gBAE/B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,kBAEjC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,cAG7B;CAAG;AAaL;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAEvE,CAAA;;;;;;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,MAAO,SAAQ,WAE1B;CAAG;;;;;;AAEL;;;;;;;;;;;GAWG;AACH,qBAAa,QAAS,SAAQ,aAE5B;CAAG;;;;;;;;;AAEL;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,IAAK,SAAQ,SAKxB;CAAG;AAEL;;;;GAIG;AACH,eAAO,MAAM,UAAU,mTAiBtB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,MAAM,GACN,QAAQ,GACR,UAAU,GACV,IAAI,GACJ,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,WAAW,GACX,aAAa,GACb,WAAW,GACX,SAAS,GACT,iBAAiB,CAAA;AAErB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,UAAU,CAAA"}
|