context.json package
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-12-07 14:53:01 +00:00
parent 6350eac2c5
commit a6911b3ed6
2 changed files with 35 additions and 2 deletions

28
index.d.ts vendored
View File

@@ -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 {