diff --git a/index.d.ts b/index.d.ts index edbe260..d81a141 100644 --- a/index.d.ts +++ b/index.d.ts @@ -306,11 +306,70 @@ export interface HookContext extends GetHookData, PostHookData { * @param iso8859 iso string */ iso8859ToUtf8(iso8859: string): string + + /** + * convert image from source file to target file with filters + * + * @param sourceFile + * @param targetFile + * @param filters + */ + imageFilter( + sourceFile: string, + targetFile: string, + filters: { + fit?: boolean + fill?: boolean + width?: number + height?: number + brightness?: number + saturation?: number + contrast?: number + gamma?: number + blur?: number + sharpen?: number + invert?: boolean + grayscale?: boolean + quality?: number + }[] + ): void + + /** + * stat file or directory + * + * @param path + */ + fsStat(path: string): { + name: string + size: number + isDir: boolean + modTime: string + } + + /** + * list directory entries + * + * @param path + */ + fsReadDir(path: string): { + name: string + size: number + isDir: boolean + modTime: string + }[] + + /** + * make directory and all missing sub directories, no error if directory already exists + * + * @param path + */ + fsMkDir(path: string): void } export interface HookException { status?: number html?: string + file?: string [key: string]: any } @@ -321,4 +380,4 @@ export interface HookResponse extends GetHookData, PostHookData { declare global { var context: HookContext -} \ No newline at end of file +}