@backan/builder
Version:
Backan library for building executables, client libraries, JSON schema files, TypeScript definitions, and Markdown documentation.
69 lines (58 loc) • 2.7 kB
TypeScript
import { App } from '@backan/core';
import { build } from 'binarium';
import { buildAuto } from 'binarium';
import { buildDeno } from 'binarium';
import { buildNode } from 'binarium';
import { defineConfig } from 'binarium';
export { build }
export { buildAuto }
export { buildDeno }
export declare type BuilderMDParams<Env extends object> = {
/**
* The instance of the Backan application used to generate the OpenAPI schema.
*/
app: App<Env>;
/**
* The path where the resulting `Markdown` file will be saved.
*/
output: string;
};
export declare type BuilderSchemaParams<Env extends object> = {
/**
* The instance of the Backan application used to generate the OpenAPI schema.
*/
app: App<Env>;
/**
* The path where the resulting `json` file will be saved.
*/
output: string;
/**
* Generate dts file.
* @default true
*/
dts?: boolean;
};
/**
* Builds a Markdown file from Backan app.
* @param {object} params - The parameters for building the Markdown file.
* @param {App<object>} params.app - The instance of the Backan application used to generate the OpenAPI schema.
* @param {string} params.output - The path where the resulting Markdown file will be saved.
* @returns {Promise<void>} - A promise that resolves when the Markdown file is successfully built.
* @throws {Error} Throws an error if any of the operations fail, including schema generation, file execution, or file removal.
* @see https://backan.pigeonposse.com/guide/builder/
*/
export declare const buildMD: <Env extends object>({ app, output, }: BuilderMDParams<Env>) => Promise<void>;
export { buildNode }
/**
* Builds the OpenAPI schema and saves it to a file from the Backan app.
* @param {BuilderSchemaParams} props - The properties needed to build and save the schema.
* @param {App} props.app - The instance of the application used to get the OpenAPI object.
* @param {string} props.output - The path to the file where the schema will be saved.
* @param {boolean} props.dts - Generate dts file. Default: true.
* @returns {Promise<void>} - A promise that resolves when the file writing operation completes.
* @throws {Error} Throws an error if there is a problem during the file writing operation.
* @see https://backan.pigeonposse.com/guide/builder/
*/
export declare const buildSchema: <Env extends object>({ app, output, dts, }: BuilderSchemaParams<Env>) => Promise<void>;
export { defineConfig }
export { }