typescript-scaffolder
Version:
 
36 lines • 1.8 kB
TypeScript
import { Endpoint, SchemaConsumer } from 'models/api-definitions';
/**
* returns the function name and filename for a specified action given an endpoint and parent object
* @param endpoint
*/
export declare function generateClientAction(endpoint: Endpoint): {
functionName: string;
fileName: string;
};
export declare function determineHasBody(method: string): boolean;
export declare function constructUrlPath(endpoint: Endpoint): string;
export declare function addClientRequiredImports(sourceFile: import('ts-morph').SourceFile, outputFilePath: string, interfaceInputDir: string, requestSchema: string | undefined, responseSchema: string, hasBody: boolean, addAxios?: boolean): void;
/**
* Creates a set for the schemas that are required of each consumer
* @param consumers
*/
export declare function collectRequiredSchemas<T extends SchemaConsumer>(consumers: T[]): Set<string>;
/**
* Locates the directory where al the schemas are located and returns them as a string
*
* @param requiredSchemas
* @param interfaceNameToDirs
* @param configPath
* @param funcName
*/
export declare function findDirectoryContainingAllSchemas(requiredSchemas: Set<string>, interfaceNameToDirs: Map<string, Set<string>>, configPath: string): string | null;
/**
* Wrapper that enforces a hard failure if the directory cannot be found.
* Use this at call sites where generation must stop when schemas are missing.
*/
export declare function assertDirectoryContainingAllSchemas(requiredSchemas: Set<string>, interfaceNameToDirs: Map<string, Set<string>>, configPath: string): string;
export declare function buildImportMapAndRegistryEntries(importMap: Map<string, string[]>): {
importStatements: string[];
registryEntries: string[];
};
//# sourceMappingURL=client-constructors.d.ts.map