main.tea (23 lines of code) (raw):
/**
* This is a stream module
*/
/**
* The model is for genrating stream
*/
model FileField {
filename: string(description='the name of the file',example='a.txt',default=''),
contentType: string(description='the MIME of the file',example='txt',default=''),
content: readable(description='the content of the file')
}
/**
* Gets a boundary string
* @return the random boundary string
*/
static function getBoundary(): string;
/**
* Give a form and boundary string, wrap it to a readable stream
* @param form The form map
* @param boundary the boundary string
* @return the readable from file form
*/
static function toFileForm(form: object, boundary: string): readable;