added types
This commit is contained in:
parent
1760eef571
commit
7a628c0a55
61
index.d.ts
vendored
61
index.d.ts
vendored
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user