Skip to content

Commit

Permalink
Prep DefinitelyTyped exports
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxy committed May 2, 2024
1 parent efadfe0 commit 1438fb6
Showing 1 changed file with 86 additions and 8 deletions.
94 changes: 86 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>

/**
* Generate file source from a template.
*/
export function createFile(name: string, outPath: string, basePath: string): Promise<void>

/**
* Install remote middleware
*/
export function addPackage(name: string): Promise<string|undefined>

/**
* Request plugin list from the package repo.
*/
export function listPackages(): Promise<PluginInfo[]>

0 comments on commit 1438fb6

Please sign in to comment.