statigen
Version:
A static site generator that supports html, ejs, and markdown source files
39 lines (38 loc) • 1.76 kB
TypeScript
import type { Range } from './interfaces';
/**
*
*/
export declare function standardizePath(...parts: string[]): string;
/**
* Normalize, resolve, and standardize path.sep for a chunk of path parts.A tagged template literal function for standardizing the path. This has to be defined as standalone function since it's a tagged template literal function,
* we can't use `object.tag` syntax.
*/
export declare function s(stringParts: any, ...expressions: any[]): string;
export declare function log<T>(...messages: T[]): void;
export declare function createRange(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range;
/**
* Given an ejs error message, parse it and find the actual error information
*/
export declare function getEjsError(error: Error): {
message: string;
line: number;
};
/**
* Given a path to a file, convert it into a title
* (remove extension, replace dashes with spaces, upper case first letter of each word)
*/
export declare function getTitleFromFilePath(filePath: string): string;
/**
* Get a relative url based on the position of the template file and the host file
* @param url the URL relative to the `templateOutPath`
* @param templateOutPath the output path of the template
* @param hostOutPath the outPath of the host file (the file being published)
*/
export declare function getRelativeUrl(url: string, templateOutPath: string, hostOutPath: string): string;
export declare function toUnixPath(thePath: string): string;
export declare function replacePath(subject: string, search: string, replace: string): string;
/**
*
* @param packageName Find the latest-published version of an npm package
*/
export declare function getLatestVersion(packageName: string): string;