@b4moss/hyogen-md 0.10.1 → 0.12.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/README.md +6 -6
- package/README_ja.md +6 -6
- package/dist/client.js +977 -758
- package/dist/index.d.ts +14 -0
- package/dist/index.js +1017 -632
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare type BuildOptions = RenderOptions & {
|
|
|
6
6
|
includeUnderscoreEntries?: boolean;
|
|
7
7
|
context?: HyogenContext;
|
|
8
8
|
serverContext?: HyogenContext;
|
|
9
|
+
dataSources?: DataSourcesMap;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export declare type BuildResult = {
|
|
@@ -19,6 +20,8 @@ export declare type BuildResult = {
|
|
|
19
20
|
declare type ClientRenderOptions = RenderOptions & {
|
|
20
21
|
/** Rejected on client — use renderServer/build instead */
|
|
21
22
|
serverContext?: HyogenContext;
|
|
23
|
+
/** Rejected on client — use renderServer/build instead */
|
|
24
|
+
dataSources?: DataSourcesMap;
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export declare function createFsLoader(options?: FsLoaderOptions): Loader;
|
|
@@ -32,6 +35,8 @@ export declare function createHyogenError(options: {
|
|
|
32
35
|
|
|
33
36
|
export declare function createNodeLoader(options?: NodeLoaderOptions): Loader;
|
|
34
37
|
|
|
38
|
+
export declare type DataSourcesMap = Record<string, string>;
|
|
39
|
+
|
|
35
40
|
/**
|
|
36
41
|
* Formats a diagnostic as multi-line log text (api.md).
|
|
37
42
|
* Does not write to console — callers decide how to output.
|
|
@@ -62,6 +67,13 @@ export declare type HyogenWarning = HyogenDiagnostic;
|
|
|
62
67
|
/** Returns true when path is an http(s) URL. */
|
|
63
68
|
export declare function isRemotePath(path: string): boolean;
|
|
64
69
|
|
|
70
|
+
export declare function loadDataSources(sources: DataSourcesMap, options?: LoadDataSourcesOptions): Promise<HyogenContext>;
|
|
71
|
+
|
|
72
|
+
declare type LoadDataSourcesOptions = {
|
|
73
|
+
root?: string;
|
|
74
|
+
loader?: Loader;
|
|
75
|
+
};
|
|
76
|
+
|
|
65
77
|
export declare type Loader = (path: string) => Promise<string>;
|
|
66
78
|
|
|
67
79
|
declare type NodeLoaderOptions = FsLoaderOptions;
|
|
@@ -94,6 +106,8 @@ export declare function renderServer(input: string | {
|
|
|
94
106
|
|
|
95
107
|
export declare type ServerRenderOptions = RenderOptions & {
|
|
96
108
|
serverContext?: HyogenContext;
|
|
109
|
+
/** Variable name → root-relative data file path (YAML / JSON / CSV). */
|
|
110
|
+
dataSources?: DataSourcesMap;
|
|
97
111
|
};
|
|
98
112
|
|
|
99
113
|
export { }
|