Utils
各类工具类的集合
Date
k.utils.date.formate(dateTime: Date, formate: string): string
k.utils.date.now
k.utils.date.utcNow
String
字符串的一些扩展方法
k.utils.string.remove(input: string, ValueToRemove: string): string
k.utils.string.removeHtml(input: string): string
k.utils.string.replace(input: string, oldValue: string, newValue: string): string
k.utils.string.sementicSubString(input: string, start: number, count: number): string
k.utils.string.subString(input: string, start: number, count: number): string
Compression
k.utils.compression.unzip(Binary: number[]): ZipItem[]
k.utils.compression.decompressGzip(path: string): string
Office
k.utils.office.excel.createNewWorkbook
k.utils.office.excel.getWorkBook
k.utils.office.excel.readAsObjects
k.utils.office.excel.readSheetNames
...
CDN
Kooboo内置CDN服务器的通知机制
k.utils.CDN.disableCDN(): void
k.utils.CDN.enableCDN(): void
k.utils.CDN.setCacheTime(minutes: number): void
Template
Kooboo 模板引擎
k.utils.template.render(view: string): string
Converter
k.utils.converter.htmlToPdf(htmlcode: string): number[]
k.utils.converter.officeToHTML(officebytes: number[], filename: string): string
ClientJs
把后台对象做为前台脚本发到浏览器
var obj = {};
obj.firstname = "name";
obj.lastname = "lastname";
k.clientJS.setVariable("myname", obj);
k.utils.clientJS.monacoResource(callback: string): string
Image
k.utils.image.changeFormat(Binary: number[], NewExtension: string): number[]
k.utils.image.resize(image: number[], height: number, width: number): number[]
k.utils.image.getSize(Image: number[]): SizeMeansurement
Screenshot
从远程获取网址的截图
k.utils.screenShot.take(absoluteUrl: string): number[]
k.utils.screenShot.takeFromHTML(HTMLCode: string, width: number, height: number, fullPage: boolean): number[]
k.utils.screenShot.takeLocalPageUrl(LocalPageRelitiveUrl: string, width: number, height: number, fullPage: boolean): number[]
k.utils.screenShot.takePage(PageName: string, width: number, height: number, fullPage: boolean): number[]
Network
k.utils.ping('www.kooboo.com');
k.utils.sshClient.passwordConnect(host: string, user: string, password: string, callback: (p1: KScript.Ssh.ConnectedClient) => void, timeout: number): void
k.utils.sshClient.privateKeyConnect(host: string, user: string, privateKey: string, callback: (p1: KScript.Ssh.ConnectedClient) => void, timeout: number): void
k.utils.sftpClient.passwordConnect();
k.utils.sftpClient.privateKeyConnect();