@seed-hypermedia/client 0.0.44 → 0.0.46
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/dist/blocks-to-markdown.d.ts +13 -1
- package/dist/{chunk-XHVG24AF.mjs → chunk-SYBWJKDJ.mjs} +1 -0
- package/dist/hm-types.d.ts +539 -0
- package/dist/hm-types.mjs +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +435 -2
- package/dist/resource-read.d.ts +23 -0
- package/package.json +1 -1
- package/src/index.ts +13 -1
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* Round-trip compatible: output can be piped back through `parseMarkdown()`
|
|
14
14
|
* to recreate the same document with block IDs preserved.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { SeedClient } from './client';
|
|
17
|
+
import type { HMBlockNode, HMComment, HMDocument, HMMetadata } from './hm-types';
|
|
17
18
|
export type BlocksToMarkdownOptions = {
|
|
18
19
|
/** Format ipfs:// URLs as https gateway URLs. Default: true. */
|
|
19
20
|
ipfsGateway?: boolean;
|
|
@@ -58,3 +59,14 @@ export declare function parseDraftFilename(filename: string): {
|
|
|
58
59
|
id: string;
|
|
59
60
|
ext: string;
|
|
60
61
|
};
|
|
62
|
+
/** Options for Seed-client-backed markdown rendering that resolves embeds and mentions. */
|
|
63
|
+
export type ResolvedMarkdownOptions = {
|
|
64
|
+
client: Pick<SeedClient, 'request'>;
|
|
65
|
+
maxDepth?: number;
|
|
66
|
+
};
|
|
67
|
+
/** Convert a document to markdown, resolving inline mentions and block embeds through a Seed client. */
|
|
68
|
+
export declare function documentToResolvedMarkdown(doc: HMDocument, options: ResolvedMarkdownOptions): Promise<string>;
|
|
69
|
+
/** Convert comment content to markdown, resolving inline mentions and block embeds through a Seed client. */
|
|
70
|
+
export declare function commentToResolvedMarkdown(comment: HMComment, options: ResolvedMarkdownOptions): Promise<string>;
|
|
71
|
+
/** Convert Seed block content to markdown, resolving inline mentions and block embeds through a Seed client. */
|
|
72
|
+
export declare function contentToResolvedMarkdown(content: HMBlockNode[], options: ResolvedMarkdownOptions): Promise<string>;
|
|
@@ -268,6 +268,7 @@ var HMDocumentMetadataSchema = z.object({
|
|
|
268
268
|
showOutline: z.boolean().optional(),
|
|
269
269
|
showActivity: z.boolean().optional(),
|
|
270
270
|
contentWidth: z.union([z.literal("S"), z.literal("M"), z.literal("L")]).optional(),
|
|
271
|
+
childrenType: HMBlockChildrenTypeSchema.optional(),
|
|
271
272
|
theme: z.object({
|
|
272
273
|
headerLayout: z.union([z.literal("Center"), z.literal("")]).optional()
|
|
273
274
|
}).optional(),
|