@f12o/papyr-moonbit-bridge 2026.5.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/dist/index.d.ts +73 -0
- package/dist/index.js +15645 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -0
- package/src/generated/bridge.d.ts +27 -0
- package/src/generated/bridge.js +26888 -0
- package/src/generated/bridge.js.map +1 -0
- package/src/generated/moonbit.d.ts +62 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare type BridgeResultEnvelope<TResult = unknown> = DocumentStackEnvelope<TResult>;
|
|
2
|
+
|
|
3
|
+
export declare function collectDocumentHeadingsJson<THeading = unknown>(document: unknown): THeading[];
|
|
4
|
+
|
|
5
|
+
export declare interface DocumentEnvelope<TDocument = unknown> {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
tool: string;
|
|
8
|
+
document?: TDocument;
|
|
9
|
+
diagnostics: MoonBitDiagnostic[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare function documentPlainTextJson(document: unknown): string;
|
|
13
|
+
|
|
14
|
+
export declare interface DocumentStackEnvelope<TResult = unknown> {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
tool: string;
|
|
17
|
+
result?: TResult;
|
|
18
|
+
diagnostics: MoonBitDiagnostic[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare function documentTitleJson(document: unknown): string;
|
|
22
|
+
|
|
23
|
+
export declare function documentToolJson<TResult = unknown>(tool: string, input: unknown): DocumentStackEnvelope<TResult>;
|
|
24
|
+
|
|
25
|
+
export declare function insertDocumentBlockAfterJson<TDocument = unknown>(document: unknown, blockId: string, block: unknown): TDocument;
|
|
26
|
+
|
|
27
|
+
export declare interface MarkdownEnvelope {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
tool: string;
|
|
30
|
+
markdown: string;
|
|
31
|
+
diagnostics: MoonBitDiagnostic[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare interface MoonBitDiagnostic {
|
|
35
|
+
kind: string;
|
|
36
|
+
code: string;
|
|
37
|
+
path: string;
|
|
38
|
+
message: string;
|
|
39
|
+
expected?: string;
|
|
40
|
+
received?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare function parseMarkdownJson<TDocument = unknown>(markdown: string, id?: string): DocumentEnvelope<TDocument>;
|
|
44
|
+
|
|
45
|
+
export declare interface PdfLayoutResolveEnvelope<TPage = unknown> {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
tool: string;
|
|
48
|
+
/** Matches the MoonBit JSON wire format. */
|
|
49
|
+
document_id: string;
|
|
50
|
+
mode: string;
|
|
51
|
+
pages: TPage[];
|
|
52
|
+
diagnostics: MoonBitDiagnostic[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare interface PdfLayoutResolveInput<TDocument = unknown, TData = unknown> {
|
|
56
|
+
document: TDocument;
|
|
57
|
+
data?: TData;
|
|
58
|
+
mode?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare function removeDocumentBlockJson<TDocument = unknown>(document: unknown, blockId: string): TDocument;
|
|
62
|
+
|
|
63
|
+
export declare function replaceDocumentBlockJson<TDocument = unknown>(document: unknown, blockId: string, block: unknown): TDocument;
|
|
64
|
+
|
|
65
|
+
export declare function resolvePdfLayoutJson<TPage = unknown>(input: PdfLayoutResolveInput): PdfLayoutResolveEnvelope<TPage>;
|
|
66
|
+
|
|
67
|
+
export declare function serializeDocumentJson(document: unknown): MarkdownEnvelope;
|
|
68
|
+
|
|
69
|
+
export declare function validateDocumentJson<TDocument = unknown>(document: unknown): DocumentEnvelope<TDocument>;
|
|
70
|
+
|
|
71
|
+
export declare function visitDocumentBlocksJson<TVisit = unknown>(document: unknown): TVisit[];
|
|
72
|
+
|
|
73
|
+
export { }
|