This commit is contained in:
28
index.d.ts
vendored
28
index.d.ts
vendored
@@ -580,6 +580,31 @@ declare global {
|
||||
): any
|
||||
}
|
||||
|
||||
interface CryptoPackage {
|
||||
/**
|
||||
* get hex of sha256 hash
|
||||
*
|
||||
* @param sata string
|
||||
*
|
||||
* @returns hex hash
|
||||
*/
|
||||
sha256(data: string): string
|
||||
}
|
||||
|
||||
interface JsonPackage {
|
||||
/**
|
||||
* parse json string to json
|
||||
* @param str json string
|
||||
*/
|
||||
parse(str: string): any
|
||||
|
||||
/**
|
||||
* stringify json string
|
||||
* @param json json object
|
||||
*/
|
||||
stringify(json: any): string
|
||||
}
|
||||
|
||||
export interface HookContext
|
||||
extends GetHookData,
|
||||
GetHookGetOnlyData,
|
||||
@@ -588,6 +613,7 @@ declare global {
|
||||
request(): {
|
||||
method: string
|
||||
remoteAddr: string
|
||||
clientIp(): string
|
||||
host: string
|
||||
url: string
|
||||
path: string
|
||||
@@ -616,6 +642,8 @@ declare global {
|
||||
xml: XmlPackage
|
||||
cookie: CookiePackage
|
||||
pdf: PdfPackage
|
||||
crypto: CryptoPackage
|
||||
json: JsonPackage
|
||||
}
|
||||
|
||||
export interface HookException {
|
||||
|
||||
Reference in New Issue
Block a user