diff --git a/index.d.ts b/index.d.ts index 7713977..57c0994 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,29 +8,107 @@ */ export interface AppConfig { + + /** + * Application name (Example: restfulApiHandler) + */ name: string, + + /** + * Application description + */ description: string, + + /** + * Request prefix (Example: /api) + */ prefix: string, + + /** + * Use asynchronous handler? + */ asynchronous: string, + + /** + * Function timeout (in seconds) + */ timeout: string, + + /** + * AWS SDK for JavaScript version + */ sdkVersion: string, + + /** + * Node.js Lambda runtime identifier + */ runtime: string } +export interface PluginInfo { + [key: string]: any + + /** + * Middleware plugin name. + */ + name: string, + + /** + * Github content URL + */ + html_url: string +} + export interface TemplateVars { + appName?: AppConfig['name'], appDescription?: AppConfig['description'], appPrefix?: AppConfig['prefix'], appTimeout?: AppConfig['timeout'], appRuntime?: AppConfig['runtime'], - pkgName?: string, - sdkPackage?: string, - cfResourceName?: string, + + /** + * Package name (Example: restful-api-handler) + */ + pkgName?: string | undefined, + + /** + * AWS SDK mock library (Options: aws-sdk-client-mock|aws-sdk-mock)' + */ + sdkPackage?: string | undefined, + + /** + * CloudFront resource name + */ + cfResourceName?: string | undefined, + + /** + * Router path (Example: /api) + */ routePath: string, - nodeVersion?: string -} -export interface PluginInfo { - name: string, - html_url: string + /** + * Node version number + */ + nodeVersion?: string | undefined } + +/** + * Generate app sources from templates. + */ +export function createFiles(appConfig: AppConfig, outPath: string): Promise + +/** + * Generate file source from a template. + */ +export function createFile(name: string, outPath: string, basePath: string): Promise + +/** + * Install remote middleware + */ +export function addPackage(name: string): Promise + +/** + * Request plugin list from the package repo. + */ +export function listPackages(): Promise