mdast2docx 0.0.0-beta.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.
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-KRMGJ4HN.mjs";import"./chunk-O6BHSWEF.mjs";export{a as toSection};
@@ -0,0 +1,55 @@
1
+ import { IImageOptions } from "@mayank1513/docx";
2
+ import { BlockContent, DefinitionContent, RootContent } from "mdast";
3
+ export { convertInchesToTwip, convertMillimetersToTwip } from "@mayank1513/docx";
4
+ /** Type representing definition mappings */
5
+ export type Definitions = Record<string, string>;
6
+ /** Type representing footnote definitions */
7
+ export type FootnoteDefinitions = Record<string, {
8
+ children: (BlockContent | DefinitionContent)[];
9
+ id?: number;
10
+ }>;
11
+ /**
12
+ * Extracts definitions and footnote definitions from a list of MDAST nodes.
13
+ * @param nodes - Array of MDAST nodes.
14
+ * @returns An object containing `definitions` and `footnoteDefinitions`.
15
+ */
16
+ export declare const getDefinitions: (nodes: RootContent[]) => {
17
+ definitions: Definitions;
18
+ footnoteDefinitions: FootnoteDefinitions;
19
+ };
20
+ /**
21
+ * Type definition for an image resolver function.
22
+ */
23
+ export type ImageResolver = (src: string) => Promise<IImageOptions>;
24
+ /**
25
+ * Interface defining properties for MDAST to DOCX conversion.
26
+ */
27
+ export interface IMdastToDocxSectionProps {
28
+ /**
29
+ * If true, H1 corresponds to the title, H2 to Heading1, etc.
30
+ * @default true
31
+ */
32
+ useTitle?: boolean;
33
+ /**
34
+ * Custom image resolver function. Defaults to assuming client-side code.
35
+ */
36
+ imageResolver?: ImageResolver;
37
+ }
38
+ /**
39
+ * Determines the MIME type of an image from its binary buffer.
40
+ * @param buffer - The image buffer (ArrayBuffer or Buffer).
41
+ * @returns The detected MIME type as a string.
42
+ */
43
+ export declare function getImageMimeType(buffer: Buffer | ArrayBuffer): "bmp" | "png" | "gif" | "jpg" | undefined;
44
+ /**
45
+ * Default properties for MDAST to DOCX conversion.
46
+ */
47
+ interface IDefaultMdastToDocxSectionProps extends IMdastToDocxSectionProps {
48
+ useTitle: boolean;
49
+ imageResolver: ImageResolver;
50
+ }
51
+ export declare const defaultProps: IDefaultMdastToDocxSectionProps;
52
+ /**
53
+ * @mayank/docx is a fork of the `docx` library with minor changes,
54
+ * specifically exporting additional types that were not included in the original `docx` library.
55
+ */