mfdoc
Version:
Auto generate JS SDK and HTTP API documentation
53 lines (52 loc) • 2.7 kB
TypeScript
import { MfdocHttpEndpointDefinitionTypePrimitive } from './mfdoc.js';
export declare function filterEndpointsByTags(endpoints: MfdocHttpEndpointDefinitionTypePrimitive[], tags: string[]): MfdocHttpEndpointDefinitionTypePrimitive<import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject, import("softkave-js-utils").AnyObject>[];
/**
* Parses a regexp string in the format "/pattern/flags" into a RegExp object.
* Returns null if the string is not a valid regexp format.
*/
export declare function parseRegExpString(input: string): RegExp | null;
export interface FilterEndpointsOptions {
includeTags?: string[];
ignoreTags?: string[];
includeTagsRegExp?: RegExp[];
ignoreTagsRegExp?: RegExp[];
includePaths?: string[];
ignorePaths?: string[];
includePathsRegExp?: RegExp[];
ignorePathsRegExp?: RegExp[];
includeNames?: string[];
ignoreNames?: string[];
includeNamesRegExp?: RegExp[];
ignoreNamesRegExp?: RegExp[];
}
export declare function filterEndpoints(endpoints: MfdocHttpEndpointDefinitionTypePrimitive[], options?: FilterEndpointsOptions): MfdocHttpEndpointDefinitionTypePrimitive[];
export declare function hasPackageJson(params: {
outputPath: string;
}): Promise<boolean>;
export declare const kInstallScripts: {
readonly npm: (pkgName: string) => string;
readonly yarn: (pkgName: string) => string;
readonly pnpm: (pkgName: string) => string;
readonly bun: (pkgName: string) => string;
readonly deno: (pkgName: string) => string;
};
export type InstallScriptProvider = keyof typeof kInstallScripts;
export declare function hasPkgInstalled(params: {
outputPath: string;
pkgName: string;
}): Promise<boolean>;
export declare function getEndpointNames(endpoint: MfdocHttpEndpointDefinitionTypePrimitive): string[];
export declare function addScriptToPackageJson(params: {
outputPath: string;
scriptName: string;
scriptValue: string;
}): Promise<void>;
type DescriptionOrExample = string | unknown | undefined | (string | undefined | unknown)[];
export declare function gatherDescriptionAndExample(item: unknown): {
descriptions: unknown[];
examples: unknown[];
};
export declare function getDescriptionForEndpointInfo(inputDescriptions: DescriptionOrExample, inputExamples?: DescriptionOrExample): string;
export declare function getDescriptionForJsDoc(inputDescriptions: DescriptionOrExample, inputExamples?: DescriptionOrExample): string;
export declare function stringToJsDoc(input?: string): string;
export {};