util/util.ts
2024-11-08 16:15:32 +08:00

119 lines
4.0 KiB
TypeScript

// just for develop
export default {
json,
jsonP,
unJson,
yaml,
unYaml,
load,
save,
base64,
unBase64,
urlBase64,
unUrlBase64,
hex,
unHex,
aes,
unAes,
sm4,
unSM4,
genECDSA,
exportECDSAPrivateKey,
exportECDSAPublicKey,
importECDSAKey,
signECDSA,
verifyECDSA,
encryptECDSA,
decryptECDSA,
gzip,
gunzip,
id,
uniqueId,
token,
md5,
sha1,
sha256,
sha512,
sm3,
hmacMD5,
hmacSHA1,
hmacSHA256,
hmacSHA512,
hmacSM3,
tpl,
sleep,
shell,
toDatetime,
fromDatetime,
toDate,
fromDate,
os,
arch,
joinPath,
getPathDir,
getPathBase,
getPathVolume,
absPath,
cleanPath,
isLocalPath
}
function json(data: any): string { return '' }
function jsonP(data: any): string { return '' }
function unJson(data: string): any { return null }
function yaml(data: any): string { return '' }
function unYaml(data: string): any { return null }
function load(filename: string): any { return null }
function save(filename: string, data: any) { }
function base64(data: any): string { return '' }
function unBase64(data: string): any { return null }
function urlBase64(data: any): string { return '' }
function unUrlBase64(data: string): any { return null }
function hex(data: any): string { return '' }
function unHex(data: string): any { return null }
function aes(data: any, key: string, iv: string): string { return '' }
function unAes(data: string, key: string, iv: string): any { return null }
function sm4(data: any, key: string, iv: string): string { return '' }
function unSM4(data: string, key: string, iv: string): any { return null }
function genECDSA(): string[] { return ['priKey', 'pubKey'] }
function exportECDSAPrivateKey(key: string): string { return '' }
function exportECDSAPublicKey(key: string): string { return '' }
function importECDSAKey(pemKey: string): string { return '' }
function signECDSA(data: any, priKey: string): string { return '' }
function verifyECDSA(data: any, signature: string, pubKey: string): string { return '' }
function encryptECDSA(data: any, pubKey: string): string { return '' }
function decryptECDSA(data: any, priKey: string): string { return '' }
function gzip(data: any): string { return '' }
function gunzip(data: string): any { return null }
function id(): string { return '' }
function uniqueId(): string { return '' }
function token(size: number): string { return '' }
function md5(...data: any[]): string { return '' }
function sha1(...data: any[]): string { return '' }
function sha256(...data: any[]): string { return '' }
function sha512(...data: any[]): string { return '' }
function sm3(...data: any[]): string { return '' }
function hmacMD5(key: any, ...data: any[]): string { return '' }
function hmacSHA1(key: any, ...data: any[]): string { return '' }
function hmacSHA256(key: any, ...data: any[]): string { return '' }
function hmacSHA512(key: any, ...data: any[]): string { return '' }
function hmacSM3(key: any, ...data: any[]): string { return '' }
function tpl(text: string, data: any, functions?: Object): string { return '' }
function sleep(ms: number): void { }
function setTimeout(callback: () => void, ms?: number, ...args: any): void { }
function shell(cmd: string, ...args: string[]): string[] { return [] }
function toDatetime(timestamp: number): string { return '' }
function fromDatetime(datetimeStr: string): number { return 0 }
function toDate(timestamp: number): string { return '' }
function fromDate(dateStr: string): number { return 0 }
function os(): string { return '' }
function arch(): string { return '' }
function joinPath(...paths: string[]): string { return '' }
function getPathDir(path: string): string { return '' }
function getPathBase(path: string): string { return '' }
function getPathVolume(path: string): string { return '' }
function absPath(path: string): string { return '' }
function cleanPath(path: string): string { return '' }
function isLocalPath(path: string): boolean { return false }