docula 0.41.0 → 0.41.1

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,138 @@
1
+ import http from 'node:http';
2
+ export { Writr } from 'writr';
3
+
4
+ type DoculaSection = {
5
+ name: string;
6
+ order?: number;
7
+ path: string;
8
+ children?: DoculaSection[];
9
+ };
10
+
11
+ declare class DoculaOptions {
12
+ /**
13
+ * Path to the template directory
14
+ */
15
+ templatePath: string;
16
+ /**
17
+ * Path to the output directory
18
+ */
19
+ outputPath: string;
20
+ /**
21
+ * Path to the site directory
22
+ */
23
+ sitePath: string;
24
+ /**
25
+ * Path to the github repository
26
+ */
27
+ githubPath: string;
28
+ /**
29
+ * Site title
30
+ */
31
+ siteTitle: string;
32
+ /**
33
+ * Site description
34
+ */
35
+ siteDescription: string;
36
+ /**
37
+ * Site URL
38
+ */
39
+ siteUrl: string;
40
+ /**
41
+ * Port to run the server
42
+ */
43
+ port: number;
44
+ /**
45
+ * Single page website
46
+ */
47
+ singlePage: boolean;
48
+ /**
49
+ * Sections
50
+ */
51
+ sections?: DoculaSection[];
52
+ /**
53
+ * OpenAPI specification URL for API documentation.
54
+ * When provided, creates a dedicated /api page
55
+ * Supports both external URLs (https://...) and relative paths (/openapi.json)
56
+ */
57
+ openApiUrl?: string;
58
+ constructor(options?: Record<string, unknown>);
59
+ parseOptions(options: Record<string, any>): void;
60
+ }
61
+
62
+ declare class Docula {
63
+ private _options;
64
+ private readonly _console;
65
+ private _configFileModule;
66
+ private _server;
67
+ /**
68
+ * Initialize the Docula class
69
+ * @param {DoculaOptions} options
70
+ * @returns {void}
71
+ * @constructor
72
+ */
73
+ constructor(options?: DoculaOptions);
74
+ /**
75
+ * Get the options
76
+ * @returns {DoculaOptions}
77
+ */
78
+ get options(): DoculaOptions;
79
+ /**
80
+ * Set the options
81
+ * @param {DoculaOptions} value
82
+ */
83
+ set options(value: DoculaOptions);
84
+ /**
85
+ * The http server used to serve the site
86
+ * @returns {http.Server | undefined}
87
+ */
88
+ get server(): http.Server | undefined;
89
+ /**
90
+ * The config file module. This is the module that is loaded from the docula.config.ts or docula.config.mjs file
91
+ * @returns {any}
92
+ */
93
+ get configFileModule(): any;
94
+ /**
95
+ * Check for updates
96
+ * @returns {void}
97
+ */
98
+ checkForUpdates(): void;
99
+ /**
100
+ * Is the execution process that runs the docula command
101
+ * @param {NodeJS.Process} process
102
+ * @returns {Promise<void>}
103
+ */
104
+ execute(process: NodeJS.Process): Promise<void>;
105
+ /**
106
+ * Checks if the site is a single page website
107
+ * @param {string} sitePath
108
+ * @returns {boolean}
109
+ */
110
+ isSinglePageWebsite(sitePath: string): boolean;
111
+ /**
112
+ * Generate the init files
113
+ * @param {string} sitePath
114
+ * @param {boolean} typescript - If true, generates docula.config.ts instead of docula.config.mjs
115
+ * @returns {void}
116
+ */
117
+ generateInit(sitePath: string, typescript?: boolean): void;
118
+ /**
119
+ * Get the version of the package
120
+ * @returns {string}
121
+ */
122
+ getVersion(): string;
123
+ /**
124
+ * Load the config file. Supports both .mjs and .ts config files.
125
+ * Priority: docula.config.ts > docula.config.mjs
126
+ * @param {string} sitePath
127
+ * @returns {Promise<void>}
128
+ */
129
+ loadConfigFile(sitePath: string): Promise<void>;
130
+ /**
131
+ * Serve the site based on the options (port and output path)
132
+ * @param {DoculaOptions} options
133
+ * @returns {Promise<void>}
134
+ */
135
+ serve(options: DoculaOptions): Promise<http.Server>;
136
+ }
137
+
138
+ export { Docula as default };