UNPKG

@azure/static-web-apps-cli

Version:
35 lines 1.51 kB
import type http from "node:http"; /** * A utility function to recursively traverse a folder and returns its entries. * @param folder The folder to traverse. * @returns A Generator object that yields entry paths. * @example * ``` * for await (const file of traverseFolder(folder)) { * console.log(file); * } * ``` */ export declare function traverseFolder(folder: string): AsyncGenerator<string>; /** * Find the `staticwebapp.config.json` (or `routes.json`) configuration file in a specific folder. * @param folder The folder where to lookup for the configuration file. * @returns `staticwebapp.config.json` if it was found, or fallback to `routes.json`. Return `null` if none were found. */ export declare function findSWAConfigFile(folder: string): Promise<{ filepath: string; content: SWAConfigFile; } | null>; /** * Valide and normalize all paths of a workflow confifuration. * @param userWorkflowConfig The project workflow configuration. * @returns A configuration object. */ export declare function validateUserWorkflowConfig(userWorkflowConfig: Partial<GithubActionWorkflow> | undefined): Partial<GithubActionWorkflow> | undefined; /** * Check if an HTTP request path contains `staticwebapp.config.json` * @param req Node.js HTTP request object. * @returns True if the request is accessing the configuration file. False otherwise. */ export declare function isSWAConfigFileUrl(req: http.IncomingMessage): boolean | undefined; //# sourceMappingURL=user-config.d.ts.map