Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@icreate/ics-chromely-plugin-core

Package Overview
Dependencies
Maintainers
8
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icreate/ics-chromely-plugin-core - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20-beta1

94

dist/ics-chromely-plugin-core.es5.js

@@ -97,6 +97,17 @@ import { LogLevels } from '@icreate/core';

url: "Browser/Open".concat(type),
data: { url: url }
data: { url: url },
};
icsChromelyRequest.command(opts);
};
Browser.OperateEx = function (url, data, method, headers) {
if (method === void 0) { method = 'GET'; }
if (headers === void 0) { headers = { 'Content-Type': 'application/json' }; }
// let opts =
return icsChromelyRequest.function({
url: "Browser/".concat(url),
method: method,
data: data,
headers: headers,
});
};
/**

@@ -130,2 +141,18 @@ * @description: 打开Chrome浏览器

};
/**
* @description: Html转Pdf
* @param {PdfSettings} settings pdf设置
* @return 返回流或者错误消息
*/
Browser.HtmlToPdf = function (settings) {
return this.OperateEx('HtmlToPdf', settings);
};
/**
* @description: 打印html字符串
* @param {PrintSettings} settings 打印设置
* @return 返回 ok或错误消息
*/
Browser.PrintHtml = function (settings) {
return this.OperateEx('PrintHtml', settings);
};
return Browser;

@@ -351,6 +378,28 @@ }());

* @LastEditors: 陶慧灵
* @LastEditTime: 2022-12-13 13:43:25
* @LastEditTime: 2022-12-13 15:13:33
* @Description:
* @FilePath: \ics-chromely-plugin-core\src\core\printer.ts
*/
var Duplex;
(function (Duplex) {
//
// 摘要:
// The printer's default duplex setting.
Duplex[Duplex["Default"] = -1] = "Default";
//
// 摘要:
// Single-sided printing.
Duplex[Duplex["Simplex"] = 1] = "Simplex";
//
// 摘要:
// Double-sided, vertical printing.
Duplex[Duplex["Vertical"] = 2] = "Vertical";
//
// 摘要:
// Double-sided, horizontal printing.
Duplex[Duplex["Horizontal"] = 3] = "Horizontal";
})(Duplex || (Duplex = {}));
/**
* 打印类
*/
var Printer = /** @class */ (function () {

@@ -370,7 +419,27 @@ function Printer() {

};
// 获取本地打印机列表
/**
* 获取本地打印机列表
* @returns ["Microsoft Print to PDF"],第一个打印机是默认打印机
*/
Printer.getPrinterList = function () {
return this.OperateEx('List');
};
// 获取本地打印机列表
/**
* 获取本地打印机对象列表
* @returns
* [{
* "Name": "Microsoft Print to PDF", //打印机名称
* "IsDefault": true, //是否默认打印机
* "IsDuplex": false //是否支持双面打印
* },
* {
* "Name": "Fax",
* "IsDefault": false,
* "IsDuplex": false
* }]
*/
Printer.getPrinterListEx = function () {
return this.OperateEx('ListEx');
};
// 获取本地默认打印机
Printer.getPrinterDefault = function () {

@@ -384,7 +453,16 @@ return this.OperateEx('Default');

/**
* 打印pdf流
* @param blob 流
* 打印pdf内容
* @param bytes 二进制内容
*/
Printer.printPdf = function (bytes) {
return this.OperateEx('PrintPdf', bytes, "POST", { 'Content-Type': 'application/pdf' });
Printer.printPdf = function (bytes, settings) {
if (settings === void 0) { settings = null; }
var params = [], url = 'PrintPdf';
// 如果有打印设置则拼接url参数
if (settings) {
for (var key in settings) {
params.push(key + '=' + settings[key]);
}
url = url + (params.length > 0 ? "?".concat(params.join('&')) : '');
}
return this.OperateEx(url, bytes, 'POST', { 'Content-Type': 'application/pdf' });
};

@@ -391,0 +469,0 @@ return Printer;

@@ -104,6 +104,17 @@ (function (global, factory) {

url: "Browser/Open".concat(type),
data: { url: url }
data: { url: url },
};
icsChromelyRequest__default["default"].command(opts);
};
Browser.OperateEx = function (url, data, method, headers) {
if (method === void 0) { method = 'GET'; }
if (headers === void 0) { headers = { 'Content-Type': 'application/json' }; }
// let opts =
return icsChromelyRequest__default["default"].function({
url: "Browser/".concat(url),
method: method,
data: data,
headers: headers,
});
};
/**

@@ -137,2 +148,18 @@ * @description: 打开Chrome浏览器

};
/**
* @description: Html转Pdf
* @param {PdfSettings} settings pdf设置
* @return 返回流或者错误消息
*/
Browser.HtmlToPdf = function (settings) {
return this.OperateEx('HtmlToPdf', settings);
};
/**
* @description: 打印html字符串
* @param {PrintSettings} settings 打印设置
* @return 返回 ok或错误消息
*/
Browser.PrintHtml = function (settings) {
return this.OperateEx('PrintHtml', settings);
};
return Browser;

@@ -358,6 +385,28 @@ }());

* @LastEditors: 陶慧灵
* @LastEditTime: 2022-12-13 13:43:25
* @LastEditTime: 2022-12-13 15:13:33
* @Description:
* @FilePath: \ics-chromely-plugin-core\src\core\printer.ts
*/
var Duplex;
(function (Duplex) {
//
// 摘要:
// The printer's default duplex setting.
Duplex[Duplex["Default"] = -1] = "Default";
//
// 摘要:
// Single-sided printing.
Duplex[Duplex["Simplex"] = 1] = "Simplex";
//
// 摘要:
// Double-sided, vertical printing.
Duplex[Duplex["Vertical"] = 2] = "Vertical";
//
// 摘要:
// Double-sided, horizontal printing.
Duplex[Duplex["Horizontal"] = 3] = "Horizontal";
})(Duplex || (Duplex = {}));
/**
* 打印类
*/
var Printer = /** @class */ (function () {

@@ -377,7 +426,27 @@ function Printer() {

};
// 获取本地打印机列表
/**
* 获取本地打印机列表
* @returns ["Microsoft Print to PDF"],第一个打印机是默认打印机
*/
Printer.getPrinterList = function () {
return this.OperateEx('List');
};
// 获取本地打印机列表
/**
* 获取本地打印机对象列表
* @returns
* [{
* "Name": "Microsoft Print to PDF", //打印机名称
* "IsDefault": true, //是否默认打印机
* "IsDuplex": false //是否支持双面打印
* },
* {
* "Name": "Fax",
* "IsDefault": false,
* "IsDuplex": false
* }]
*/
Printer.getPrinterListEx = function () {
return this.OperateEx('ListEx');
};
// 获取本地默认打印机
Printer.getPrinterDefault = function () {

@@ -391,7 +460,16 @@ return this.OperateEx('Default');

/**
* 打印pdf流
* @param blob 流
* 打印pdf内容
* @param bytes 二进制内容
*/
Printer.printPdf = function (bytes) {
return this.OperateEx('PrintPdf', bytes, "POST", { 'Content-Type': 'application/pdf' });
Printer.printPdf = function (bytes, settings) {
if (settings === void 0) { settings = null; }
var params = [], url = 'PrintPdf';
// 如果有打印设置则拼接url参数
if (settings) {
for (var key in settings) {
params.push(key + '=' + settings[key]);
}
url = url + (params.length > 0 ? "?".concat(params.join('&')) : '');
}
return this.OperateEx(url, bytes, 'POST', { 'Content-Type': 'application/pdf' });
};

@@ -398,0 +476,0 @@ return Printer;

@@ -18,6 +18,17 @@ "use strict";

url: "Browser/Open".concat(type),
data: { url: url }
data: { url: url },
};
ics_chromely_js_sdk_1.default.command(opts);
};
Browser.OperateEx = function (url, data, method, headers) {
if (method === void 0) { method = 'GET'; }
if (headers === void 0) { headers = { 'Content-Type': 'application/json' }; }
// let opts =
return ics_chromely_js_sdk_1.default.function({
url: "Browser/".concat(url),
method: method,
data: data,
headers: headers,
});
};
/**

@@ -51,2 +62,18 @@ * @description: 打开Chrome浏览器

};
/**
* @description: Html转Pdf
* @param {PdfSettings} settings pdf设置
* @return 返回流或者错误消息
*/
Browser.HtmlToPdf = function (settings) {
return this.OperateEx('HtmlToPdf', settings);
};
/**
* @description: 打印html字符串
* @param {PrintSettings} settings 打印设置
* @return 返回 ok或错误消息
*/
Browser.PrintHtml = function (settings) {
return this.OperateEx('PrintHtml', settings);
};
return Browser;

@@ -53,0 +80,0 @@ }());

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrinterSettings = void 0;
/*

@@ -7,3 +8,3 @@ * @Author: 刘邓

* @LastEditors: 陶慧灵
* @LastEditTime: 2022-12-13 13:43:25
* @LastEditTime: 2022-12-13 15:13:33
* @Description:

@@ -13,2 +14,33 @@ * @FilePath: \ics-chromely-plugin-core\src\core\printer.ts

var ics_chromely_js_sdk_1 = require("@icreate/ics-chromely-js-sdk");
var Duplex;
(function (Duplex) {
//
// 摘要:
// The printer's default duplex setting.
Duplex[Duplex["Default"] = -1] = "Default";
//
// 摘要:
// Single-sided printing.
Duplex[Duplex["Simplex"] = 1] = "Simplex";
//
// 摘要:
// Double-sided, vertical printing.
Duplex[Duplex["Vertical"] = 2] = "Vertical";
//
// 摘要:
// Double-sided, horizontal printing.
Duplex[Duplex["Horizontal"] = 3] = "Horizontal";
})(Duplex || (Duplex = {}));
/**
* 打印设置
*/
var PrinterSettings = /** @class */ (function () {
function PrinterSettings() {
}
return PrinterSettings;
}());
exports.PrinterSettings = PrinterSettings;
/**
* 打印类
*/
var Printer = /** @class */ (function () {

@@ -28,7 +60,27 @@ function Printer() {

};
// 获取本地打印机列表
/**
* 获取本地打印机列表
* @returns ["Microsoft Print to PDF"],第一个打印机是默认打印机
*/
Printer.getPrinterList = function () {
return this.OperateEx('List');
};
// 获取本地打印机列表
/**
* 获取本地打印机对象列表
* @returns
* [{
* "Name": "Microsoft Print to PDF", //打印机名称
* "IsDefault": true, //是否默认打印机
* "IsDuplex": false //是否支持双面打印
* },
* {
* "Name": "Fax",
* "IsDefault": false,
* "IsDuplex": false
* }]
*/
Printer.getPrinterListEx = function () {
return this.OperateEx('ListEx');
};
// 获取本地默认打印机
Printer.getPrinterDefault = function () {

@@ -42,7 +94,16 @@ return this.OperateEx('Default');

/**
* 打印pdf流
* @param blob 流
* 打印pdf内容
* @param bytes 二进制内容
*/
Printer.printPdf = function (bytes) {
return this.OperateEx('PrintPdf', bytes, "POST", { 'Content-Type': 'application/pdf' });
Printer.printPdf = function (bytes, settings) {
if (settings === void 0) { settings = null; }
var params = [], url = 'PrintPdf';
// 如果有打印设置则拼接url参数
if (settings) {
for (var key in settings) {
params.push(key + '=' + settings[key]);
}
url = url + (params.length > 0 ? "?".concat(params.join('&')) : '');
}
return this.OperateEx(url, bytes, 'POST', { 'Content-Type': 'application/pdf' });
};

@@ -49,0 +110,0 @@ return Printer;

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrintSettings = exports.PdfSettings = void 0;
/**
* Pdf打印设置
*/
var PdfSettings = /** @class */ (function () {
function PdfSettings() {
/**
* Scale of the webpage rendering. Defaults to 1.
*/
this.scale = 1;
/**
* 纸张名称 A1,A2,A3,A4
*/
this.paperName = 'A4';
/**
* Display header and footer. Defaults to false.
*/
this.displayHeaderFooter = false;
/**
* Top margin in inches. Defaults to 1cm (~0.4 inches).
*/
this.marginBottom = 0;
/**
* Right margin in inches. Defaults to 1cm (~0.4 inches).h
*/
this.marginRight = 0;
/**
* Top margin in inches. Defaults to 1cm (~0.4 inches).h
*/
this.marginTop = 0;
/**
* Left margin in inches. Defaults to 1cm (~0.4 inches).h
*/
this.marginLeft = 0;
/**
* 是否选择由css定义的页面大小。默认为false,在这种情况下,内容将缩放以适应纸张大小。
*/
this.preferCssPageSize = false;
/**
* Paper height in inches. Defaults to 11.69 inches.
*/
this.paperHeight = 11.69;
/**
* Paper width in inches. Defaults to 8.27 inches.
*/
this.paperWidth = 8.27;
/**
* Print background graphics. Defaults to false.
*/
this.printBackground = false;
/**
* Paper orientation. Defaults to false.
*/
this.landscape = false;
}
return PdfSettings;
}());
exports.PdfSettings = PdfSettings;
/**
* 打印设置
*/
var PrintSettings = /** @class */ (function (_super) {
__extends(PrintSettings, _super);
function PrintSettings() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
* 打印副本数
*/
_this.copies = 1;
/**
* 双面打印
*/
_this.duplex = 1;
return _this;
}
return PrintSettings;
}(PdfSettings));
exports.PrintSettings = PrintSettings;
//# sourceMappingURL=interfaces.js.map

@@ -0,3 +1,5 @@

import { PdfSettings, PrintSettings } from '../interfaces/interfaces';
export default class Browser {
private static Open;
private static OperateEx;
/**

@@ -23,2 +25,14 @@ * @description: 打开Chrome浏览器

static OpenDefault(url: string): void;
/**
* @description: Html转Pdf
* @param {PdfSettings} settings pdf设置
* @return 返回流或者错误消息
*/
static HtmlToPdf(settings: PdfSettings): Promise<any>;
/**
* @description: 打印html字符串
* @param {PrintSettings} settings 打印设置
* @return 返回 ok或错误消息
*/
static PrintHtml(settings: PrintSettings): Promise<any>;
}

@@ -0,11 +1,73 @@

declare enum Duplex {
Default = -1,
Simplex = 1,
Vertical = 2,
Horizontal = 3
}
/**
* 打印设置
*/
export declare class PrinterSettings {
/**
* 打印机名称
*/
printerName: string;
/**
* 打印文档名称
*/
documentName: string;
/**
* 打印纸张名
*/
paperName: string;
/**
* 打印副本数
*/
copies: number;
/**
* 双面打印设置
*/
duplex: Duplex;
/**
*自定义纸张宽度
*/
customWidth: number;
/**
* 自定义纸张高度
*/
customHeight: number;
}
/**
* 打印类
*/
export default class Printer {
private static OperateEx;
/**
* 获取本地打印机列表
* @returns ["Microsoft Print to PDF"],第一个打印机是默认打印机
*/
static getPrinterList(): Promise<any>;
/**
* 获取本地打印机对象列表
* @returns
* [{
* "Name": "Microsoft Print to PDF", //打印机名称
* "IsDefault": true, //是否默认打印机
* "IsDuplex": false //是否支持双面打印
* },
* {
* "Name": "Fax",
* "IsDefault": false,
* "IsDuplex": false
* }]
*/
static getPrinterListEx(): Promise<any>;
static getPrinterDefault(): Promise<any>;
static isPrinterExists(printerName: string): Promise<any>;
/**
* 打印pdf流
* @param blob 流
* 打印pdf内容
* @param bytes 二进制内容
*/
static printPdf(bytes: ArrayBuffer): Promise<any>;
static printPdf(bytes: ArrayBuffer, settings?: PrinterSettings | null): Promise<any>;
}
export {};

@@ -25,1 +25,110 @@ import { LogLevels } from '@icreate/core/dist/types/interfaces/interfaces';

}
/**
* Pdf打印设置
*/
export declare class PdfSettings {
/**
* Url地址
*/
url: string;
/**
* Html中的链接基本地址
*/
baseUrl: string;
/**
* html字符串
*/
html: string;
/**
* 导出格式 pdf和image
*/
format: string;
/**
* Scale of the webpage rendering. Defaults to 1.
*/
scale: number;
/**
* 纸张名称 A1,A2,A3,A4
*/
paperName: string;
/**
* HTML模板打印页脚。应该使用与' headerTemplate '相同的格式。
*/
footerTemplate: string;
/**
* 打印头的HTML模板。应该是有效的HTML标记,具有以下类,用于将打印值注入其中:
* date: formatted print date
* title: document title
* url: document location
* pageNumber: current page number
* totalPages: total pages in the document
* 例如: <span class=”title”></span>
* 将生成包含title的span。
*/
headerTemplate: string;
/**
* Display header and footer. Defaults to false.
*/
displayHeaderFooter: boolean;
/**
* Paper ranges to print, e.g., ‘1-5, 8, 11-13’. Defaults to the empty string, which means print all pages.
*/
pageRanges: string;
/**
* Top margin in inches. Defaults to 1cm (~0.4 inches).
*/
marginBottom: Number;
/**
* Right margin in inches. Defaults to 1cm (~0.4 inches).h
*/
marginRight: Number;
/**
* Top margin in inches. Defaults to 1cm (~0.4 inches).h
*/
marginTop: Number;
/**
* Left margin in inches. Defaults to 1cm (~0.4 inches).h
*/
marginLeft: Number;
/**
* 是否选择由css定义的页面大小。默认为false,在这种情况下,内容将缩放以适应纸张大小。
*/
preferCssPageSize: boolean;
/**
* Paper height in inches. Defaults to 11.69 inches.
*/
paperHeight: Number;
/**
* Paper width in inches. Defaults to 8.27 inches.
*/
paperWidth: Number;
/**
* Print background graphics. Defaults to false.
*/
printBackground: boolean;
/**
* Paper orientation. Defaults to false.
*/
landscape: boolean;
}
/**
* 打印设置
*/
export declare class PrintSettings extends PdfSettings {
/**
* 打印机名称
*/
printerName: string;
/**
* 打印列表显示文档名称
*/
documentName: string;
/**
* 打印副本数
*/
copies: number;
/**
* 双面打印
*/
duplex: number;
}

2

package.json
{
"name": "@icreate/ics-chromely-plugin-core",
"version": "0.0.19",
"version": "0.0.20-beta1",
"description": "提供Ics Chromely Client核心本地操作插件js sdk,包含本地日志、主窗体控制、打开三方浏览器、打印机列表、硬件IP和Mac地址、本地配置获取和注册表读写等",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -5,3 +5,3 @@ <!--

* @LastEditors: 陶慧灵
* @LastEditTime: 2022-11-22 12:47:09
* @LastEditTime: 2022-12-13 15:05:17
* @Descripttion:

@@ -17,2 +17,6 @@ * @FilePath: \ics-chromely-plugin-core\README.md

```
0.0.20-beta1 增加html转pdf和打印html
0.0.20 增加获取打印机列表扩展方法
0.0.19-beta.1 增加pdf打印设置
0.0.19 增加pdf打印
0.0.18-beta7 新增获取本机Ip和Mac地址列表方法`getIpMacAddress`

@@ -56,13 +60,31 @@ 0.0.18-beta6 修复注册表调用方法对应路由

```javascript
// 日志级别
/**
* 日志级别
*/
level: LogLevels
// 输出调试日志
/**
* 输出调试日志
*/
debug(logObject: any): Promise<String>
// 输出普通日志
/**
* 输出普通日志
*/
info(logObject: any): Promise<String>
// 输出警告日志
/**
* 输出警告日志
*/
warn(logObject: any): Promise<String>
// 输出错误日志
/**
* 输出错误日志
*/
error(logObject: any): Promise<String>
// 输出致命错误日志
/**
* 输出致命错误日志
*/
fatal(logObject: any): Promise<String>

@@ -74,10 +96,35 @@ ```

```javascript
// 打开Google浏览器
/**
* 打开Google浏览器
*/
OpenChrome(url:string):void
// 打开IE浏览器
/**
* 打开IE浏览器
*/
OpenIE(url:string):void
// 打开FireFox浏览器
/**
* 打开FireFox浏览器
*/
OpenFireFox(url:string):void
// 打开默认浏览器
/**
* 打开默认浏览器
*/
OpenDefault(url:string):void
/**
* @description: Html转Pdf
* @param {PdfSettings} settings pdf设置
* @return 返回流或者错误消息
*/
public static HtmlToPdf(settings: PdfSettings): Promise<any>
/**
* @description: 打印html字符串
* @param {PrintSettings} settings 打印设置
* @return 返回 ok或错误消息
*/
public static PrintHtml(settings: PrintSettings): Promise<any>
```

@@ -88,31 +135,75 @@

```javascript
// 主窗体最小化
/**
* 主窗体最小化
*/
Minimize(): void
// 主窗体最大化
/**
* 主窗体最大化
*/
Maximize(): void
// 主窗体还原
/**
* 主窗体还原
*/
Restore(): void
// 主窗体关闭
/**
* 主窗体关闭
*/
Close(): void
// 重启程序
/**
* 重启程序
*/
Restart(): void
// 主窗体状态
/**
* 主窗体状态
*/
State(): Promise<String>
// 关闭闪屏
/**
* 关闭闪屏
*/
CloseSplash(): void
// 重绘闪屏
/**
* 重绘闪屏
*/
RedrawSplash(message: string): void
//显示屏幕键盘
/**
* 显示屏幕键盘
*/
ShowScreenKeyboard(): void
//发送按键事件
/**
* 发送按键事件
*/
SendKeyEvent(keycode: number): void
//切换输入语言
/**
* 切换输入语言
*/
SwitchLanguage(cultureType: string): void
//切换为中文输入法
/**
* 切换为中文输入法
*/
SwitchLanguageToChinese(): void
//切换为英文输入法
/**
* 切换为英文输入法
*/
SwitchLanguageToEnglish(): void
//切换当前语言的具体输入法
/**
* 切换当前语言的具体输入法
*/
ChangeInputMethod(name: string): Promise<any>
//获取当前语言输入法列表
/**
* 获取当前语言输入法列表
*/
GetInputMethodList(): Promise<any>

@@ -124,9 +215,20 @@ ```

```javascript
// 是否处于非浏览器环境
/**
* 是否处于非浏览器环境
*/
isChromely: boolean
// 订阅C#事件
/**
* 订阅C#事件
*/
$on(eventName: string, callback: Function): void
// 取消订阅C#事件
/**
* 取消订阅C#事件
*/
$off(eventName: string, callback: Function): void
// 触发C#事件
/**
* 触发C#事件
*/
$emit(eventName: string): void

@@ -137,27 +239,50 @@ ```

```javascript
// 获取本机Mac地址 ["00:E0:4C:68:0B:D4"]
/**
* 获取本机Mac地址 ["00:E0:4C:68:0B:D4"]
*/
getMacAddress(): Promise<array>
// 获取本机Ip地址 ["192.168.2.8"]
/**
* 获取本机Ip地址 ["192.168.2.8"]
*/
getIpAddress(): Promise<array>
// 获取本机Ip和Mac地址列表 [{"Ip":"192.168.2.8","Mac":"00:E0:4C:68:0B:D4"}]
/**
* 获取本机Ip和Mac地址列表 [{"Ip":"192.168.2.8","Mac":"00:E0:4C:68:0B:D4"}]
*/
getIpMacAddress(): Promise<array>
// 获取本机主机名
/**
* 获取本机主机名
*/
getHostName(): Promise<string>
// 获取操作系统描述
/**
* 获取操作系统描述
*/
GetOSDesc(): Promise<string>
// 获取操作系统版本
/**
* 获取操作系统版本
*/
GetOsVersion(): Promise<string>
// 重启操作系统
/**
* 重启操作系统
*/
RestartOS(): void
// 关闭操作系统
/**
* 关闭操作系统
*/
CloseOS(): void
/**
* 设置本地日期时间
* @param date 日期字符串
* 支持:
* yyyy-MM-dd HH:mm:ss
* yyyy.MM.dd HH:mm:ss
* yyyy/MM/dd HH:mm:ss
* @returns
*/
* 设置本地日期时间
* @param date 日期字符串
* 支持:
* yyyy-MM-dd HH:mm:ss
* yyyy.MM.dd HH:mm:ss
* yyyy/MM/dd HH:mm:ss
* @returns
*/
SetLocalTime(): Promise<string>

@@ -168,7 +293,33 @@ ```

```javascript
// 获取本地打印机列表
/**
* 获取本地打印机列表
*/
getPrinterList(): Promise<array>
// 获取本地打印机列表
/**
* 获取本地打印机对象列表
* Ex: [
{
"Name": "HP LaserJet Pro MFP M225-M226 PCL 6", //打印机名称
"IsDefault": false, //是否默认打印机
"IsDuplex": true //是否支持双面打印
}
{
"Name": "Microsoft Print to PDF",
"IsDefault": true,
"IsDuplex": false
}
]
*/
getPrinterListEx(): Promise<array>
/**
* 获取本地打印机列表
*/
getPrinterDefault(): Promise<string>
// 判断指定打印机名称是否存在
/**
* 判断指定打印机名称是否存在
*/
isPrinterExists(printerName: string): Promise<bool>

@@ -180,5 +331,10 @@ ```

// 获取指定的注册表键对应的值
/**
* 获取指定的注册表键对应的值
*/
getRegeditValue(key: string, name: string): Promise<string>
// 设置注册表键值
/**
* 设置注册表键值
*/
setRegeditValue(key: string, name: string, value: string): Promise<string>

@@ -190,8 +346,16 @@ ```

// 获取指定的配置键对应的值 多级可以使用:key1:key2:key3...
/**
* 获取指定的配置键对应的值 多级可以使用:key1:key2:key3...
*/
Get(key: string): Promise<string>
// 获取appsetting.json中的BaseUrl值
/**
* 获取appsetting.json中的BaseUrl值
*/
GetBaseUrl(): Promise<string>
// 获取调试信息
/
/**
* 获取调试信息
*/
GetDebug(): Promise<string>
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc