UNPKG

docula

Version:

Beautiful Website for Your Projects

133 lines (128 loc) 3.19 kB
import http from 'node:http'; export { Writr } from 'writr'; type DoculaSection = { name: string; order?: number; path: string; children?: DoculaSection[]; }; declare class DoculaOptions { /** * Path to the template directory */ templatePath: string; /** * Path to the output directory */ outputPath: string; /** * Path to the site directory */ sitePath: string; /** * Path to the github repository */ githubPath: string; /** * Site title */ siteTitle: string; /** * Site description */ siteDescription: string; /** * Site URL */ siteUrl: string; /** * Port to run the server */ port: number; /** * Single page website */ singlePage: boolean; /** * Sections */ sections?: DoculaSection[]; constructor(options?: Record<string, unknown>); parseOptions(options: Record<string, any>): void; } declare class Docula { private _options; private readonly _console; private _configFileModule; private _server; /** * Initialize the Docula class * @param {DoculaOptions} options * @returns {void} * @constructor */ constructor(options?: DoculaOptions); /** * Get the options * @returns {DoculaOptions} */ get options(): DoculaOptions; /** * Set the options * @param {DoculaOptions} value */ set options(value: DoculaOptions); /** * The http server used to serve the site * @returns {http.Server | undefined} */ get server(): http.Server | undefined; /** * The config file module. This is the module that is loaded from the docula.config.ts or docula.config.mjs file * @returns {any} */ get configFileModule(): any; /** * Check for updates * @returns {void} */ checkForUpdates(): void; /** * Is the execution process that runs the docula command * @param {NodeJS.Process} process * @returns {Promise<void>} */ execute(process: NodeJS.Process): Promise<void>; /** * Checks if the site is a single page website * @param {string} sitePath * @returns {boolean} */ isSinglePageWebsite(sitePath: string): boolean; /** * Generate the init files * @param {string} sitePath * @param {boolean} typescript - If true, generates docula.config.ts instead of docula.config.mjs * @returns {void} */ generateInit(sitePath: string, typescript?: boolean): void; /** * Get the version of the package * @returns {string} */ getVersion(): string; /** * Load the config file. Supports both .mjs and .ts config files. * Priority: docula.config.ts > docula.config.mjs * @param {string} sitePath * @returns {Promise<void>} */ loadConfigFile(sitePath: string): Promise<void>; /** * Serve the site based on the options (port and output path) * @param {DoculaOptions} options * @returns {Promise<void>} */ serve(options: DoculaOptions): Promise<http.Server>; } export { Docula as default };