@oasisdigital/ng-doc-portal-plugin
Version:
Nx plugin for adding the ng-doc-portal system to your nx workspace
43 lines (42 loc) • 2.11 kB
TypeScript
import { EventPayload, GlobPattern, ProcessedFileEvent } from './types';
/**
* Extract all the payloads from the various processed file events.
*
* @param acc The previous accumulated payloads
* @param curr The current file event
*/
export declare function accumulatePayloads(acc: EventPayload[], curr: ProcessedFileEvent): EventPayload[];
export declare function sortFullPayloadList(list: EventPayload[]): EventPayload[];
export declare function insertIntoSortedPayloadList(list: EventPayload[], item: EventPayload): EventPayload[];
export declare function comparePayloadTitles(a: EventPayload, b: EventPayload): 1 | -1 | 0;
export declare function findTitlePrefixFromGlobPatterns(filePath: string, globPatterns: (string | GlobPattern)[]): string | undefined;
export declare function generateTitleFromFilePath(filePath: string): string;
export declare function getTitleFromTypeScript(filePath: string): Promise<string>;
/**
* Extract the title from the doc page file's config
*
* @param filePath The location of the file. Both the filename and the
* contents of the file will be used to extract title from the config in the file
*/
export declare function extractTitleFromDocPageFile(filePath: string, globPatterns: (string | GlobPattern)[]): Promise<string>;
/**
* Generate the doc page loader from the filePath and the title.
*
* @param filePath The original filePath (with '.ts')
* @param title The title for the file
*/
export declare function generateDocPageLoader(filePath: string, title: string): string;
/**
* Prettier formats any file content string passed in
*
* @param content The file content to be prettified
*/
export declare function formatContent(content: string): Promise<string>;
/**
* Generate the text of formatted TypeScript file around the config strings.
*
* @param configStrings The config strings generated from our path files
*/
export declare function wrapTypescriptBoilerplate(configStrings: string[]): string;
export declare function convertPatternOrGlobPatternArray(patterns: (string | GlobPattern)[]): string[];
export declare function timeNow(): string;