update to latest standards

This commit is contained in:
2017-04-27 16:48:08 +02:00
parent c29084f000
commit eb3c720d4e
9 changed files with 425 additions and 515 deletions

View File

@ -6,23 +6,71 @@ export interface ISmartfileConstructorOptions {
contentBuffer?: Buffer
}
/**
* class Smartfile
* -> is vinyl file compatible
*/
export class Smartfile {
/**
* the full path of the file on disk
*/
path: string
/**
* The contents of the file as Buffer
*/
contents: Buffer
constructor(optionsArg: ISmartfileConstructorOptions) {
/**
* The current working directory of the file
*/
cwd: string
/**
* sync the file with disk
*/
sync: boolean
/**
* the constructor of Smartfile
* @param optionsArg
*/
constructor (optionsArg: ISmartfileConstructorOptions) {
if (optionsArg.contentBuffer) {
this.contents = optionsArg.contentBuffer
} else if(optionsArg.contentsString) {
} else if (optionsArg.contentsString) {
this.contents = new Buffer(optionsArg.contentsString)
}
this.path = optionsArg.path
}
/**
* return relative path of file
* ->
*/
get relative () {
return ''
}
/**
* set contents from string
* @param contentString
*/
setContentFromString(contentString: string) {
setContentsFromString(contentString: string) {
this.contents = new Buffer(contentString)
}
/**
* write file to disk
*/
async write () {
}
/**
* read file from disk
*/
async read () {
}
}