epii-types-rpa 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +9 -9
  2. package/rpa.d.ts +190 -187
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
- {
2
- "name": "epii-types-rpa",
3
- "version": "1.2.6",
4
- "description": "rpa-types",
5
- "author": "MrRen",
6
- "license": "ISC",
7
- "types": "rpa.d.ts",
8
- "typings": "rpa.d.ts"
9
- }
1
+ {
2
+ "name": "epii-types-rpa",
3
+ "version": "1.2.7",
4
+ "description": "rpa-types",
5
+ "author": "MrRen",
6
+ "license": "ISC",
7
+ "types": "rpa.d.ts",
8
+ "typings": "rpa.d.ts"
9
+ }
package/rpa.d.ts CHANGED
@@ -1,187 +1,190 @@
1
- interface UploadFile {
2
- postname: String,
3
- path: String,
4
- filename: String
5
- }
6
- interface RequestHandler {
7
- reg: String,
8
- type: "file" | "content" | "abort",
9
- file?: String,
10
- content?: String
11
- }
12
-
13
- interface FormItem {
14
- key: String,
15
- title?: String,
16
- value?: any
17
- }
18
- type RunInPage = "activated" | "incognito" | "newPage" | "opened" | "";
19
-
20
- namespace rpa {
21
- function ready(isReady = 1);
22
-
23
- function args(key, dvalue);
24
- function args(key);
25
- function setArgs(key, value): Promise;
26
- function setPathAlias(key, value): Promise;
27
- function mergeArgs(map: Object): Promise;
28
- function require(path: String): Promise;
29
- function success(data: any, exit: boolean);
30
- function exec(script: String, params: Object = {},runInPage:RunInPage="");
31
- function execScript(script: String, params: Object = {},runInPage:RunInPage="");
32
-
33
- function execPuppeteer(script: String, params: Object = {});
34
- function error(msg: String, code: number = - 1);
35
- function exit();
36
- function restartAndExecRpa();
37
- function restartRpa();
38
-
39
- function onDialog(callback: Function);
40
- function waitForRpaReady():Promise;
41
- function run(func:Function,data:Object = {}):Promise;
42
- namespace http {
43
- function uploadFile(url: String, file: UploadFile, params: Object = {}): Promise;
44
- function get(url: String): Promise;
45
- function post(url: String, data: Object): Promise;
46
- function getBase64(url: String): Promise;
47
- namespace api {
48
- function post(url: String, data: Object): Promise;
49
- }
50
- }
51
-
52
- namespace ajax {
53
- function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
54
- function get(url: String, headers: Object = {}): Promise;
55
- function getBase64(url: String, headers: Object = {}): Promise;
56
- function download(url: String, path: String): Promise;
57
- function setApiBase(_url_pre:String);
58
- function setBaseData(data:Object);
59
- }
60
-
61
- namespace console {
62
- function log(object: any): Promise;
63
- function error(error): Promise;
64
- function readline(tip: String = "", dvalue = ""): Promise;
65
- }
66
- namespace thread {
67
- function lockThread(tag:String):Promise;
68
- function lock(tag:String = 'main'):Promise;
69
- function unlock(tag:String = 'main');
70
- function singleThread(tag:String):Promise;
71
- function singleTask(func:Function,waitTimeout:Number=10,tag:String='main'):Promise;
72
- function clearTask(tag:String = 'main');
73
- }
74
- namespace tools {
75
- function keep(maxTime:Number, promise:Promise, errorMsg:String = null):Promise<any>
76
- function getUrlHost(url:String):String;
77
- function addRequestHandler(r: RequestHandler): Promise
78
- function uploadFile(domOrSelector: | String | Element, path: String | Array<String>): Promise
79
- function log(object: any): Promise;
80
- function getAbsolutePath(path: String): Promise;
81
- function getHtml(url: String): Promise;
82
- function getResponseContentOnPage(pageUrl: String, urlOrurls: String | Array<String>): Promise;
83
- function waitForResponseContent(url: String): Promise;
84
- function execSystem(cmd: String): Promise;
85
- function fileGetContent(path: String): Promise;
86
- function fileGetContentBase64(path: String): Promise;
87
- function getScriptContent(path: String): Promise;
88
- function download(url: String, path: String): Promise;
89
- function sleep(time: Number): Promise;
90
- function setInterval(callback: Function, interval: Number): Promise;
91
- function writeFile(filePath: String, content: String, isBase64: boolean = false): Promise;
92
- function forEach(list: Array, callback: Function): Promise;
93
- function mkdir(path: String): Promise;
94
- function randomString(len: Number): Promise;
95
- function function2string(func:Function, data:Object):String;
96
- function waitForTrue(func: Function, interval = 500): Promise;
97
- function encodeURI(str: String, charset: String = "utf-8"): Promise;
98
- function decodeURI(str: String, charset: String = "utf-8"): Promise;
99
- function replace(str: String, regex: RegExp, asyncFn: Function): Promise;
100
- function arrayBufferToBase64(buffer:String):String;
101
- function waitForSelector(selectorOrFunction:String | Function):Promise<Element>;
102
- function waitForSelectors(selectorOrFunction:String | Function):Promise<Array<Element>>
103
- }
104
- namespace page {
105
-
106
- function screenshot(options: Object): Promise;
107
- function pdf(options):Promise;
108
-
109
- function waitForNavigation(options = {});
110
- function waitForSelector(selector, timeout = 30000);
111
- function waitForXPath(xpath);
112
- function waitForTimeout(timeout);
113
- function script(func, data = {});
114
- function newIframeAndEvaluate(url: String, func: Function): Promise;
115
- function newIframeAndEvaluate(iframeHandler: Function, func: Function): Promise;
116
-
117
- function download(url: String, path: String): Promise;
118
- function closeActivated():Promise;
119
- namespace stracing {
120
- function start(filePath:String):Promise;
121
- function stop():Promise;
122
- }
123
- }
124
- namespace browser {
125
- function newPageAndDownLoad(url: String,path: String):Promise;
126
- function newPageAndGetBase64(url: String):Promise;
127
- function newPageAndEvaluate(url: String, func: Function, data: Object = {}): Promise;
128
- function waitOpenedPageAndEvaluate(invokeFun: Function, func: Function, data: Object = {}): Promise;
129
- function waitOpenedPageAndExec(invokeFun: Function, script: String, params: Object = {}): Promise;
130
-
131
- function getNextWindowOpenUrl(beforFunc: Function, cancel: boolean): Promise;
132
- function getNextWindowOpenUrl(beforFunc: Function): Promise
133
-
134
- }
135
- namespace runtime {
136
- function get(key: String = null): Promise;
137
- function set(map: Object): Promise;
138
- }
139
- namespace frame {
140
- function newCrossIframeContext(host:String, func: Function, data:Object={}, removeOnFinish:Boolean = true):Promise;
141
- function newIframeAndevaluateCross(urlOrFunction, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
142
- function evaluateCross(name: String, func: Function, data = {}): Promise;
143
- function evaluate(name: String, func: Function): Promise;
144
- function evaluateOnNextFrame(invokeFun: Function, func: Function, remove: boolean): Promise;
145
- function evaluateOnNextFrame(invokeFun: Function, func: Function): Promise;
146
- function evaluateOnNextFrameCross(invokeFun: Function, func: Function, data:Object={}, remove:Boolean = false)
147
-
148
- }
149
- namespace localStorage {
150
- function setItem(key: String, value): Promise;
151
- function getItem(key: String): Promise;
152
- function clear(): Promise;
153
- function removeItem(key: String): Promise;
154
- }
155
- namespace view {
156
- function alert(message?: any): Promise;
157
- function confirm(message?: string): Promise;
158
- function getCustomValue(keysOrOptions: Array<String> | Array<FormItem>,autoNextCount:Number=5, title = ""): Promise<Object>;
159
- function showConsoleView(title: String = null,clearTime:Number=600000,zIndex:Number=10000,clearKeepNum:Number=50): Promise;
160
- function hideConsoleView();
161
- function console(msg: String, color: String = "#ffffff");
162
- function consoleClear();
163
- function showMaskView(title: String = "");
164
- function hideMaskView();
165
-
166
- }
167
- namespace process {
168
- function exit(): Promise;
169
- }
170
- namespace cross {
171
- function newIframeContextAndEvaluate(host: String, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
172
- function newIframeAndEvaluate(urlOrFunction: String | Function, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
173
- namespace ajax {
174
- function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
175
- function get(url: String, headers: Object = {}): Promise;
176
- function getBase64(url: String, headers: Object = {}): Promise;
177
- function download(url: String, path: String): Promise
178
- }
179
-
180
- }
181
- }
182
-
183
- declare function require(path: String,readCache:Boolean = true): Promise;
184
- // declare let args: Object;
185
- namespace args {
186
- function get(key: String, dvalue: any = null): any;
187
- }
1
+ interface UploadFile {
2
+ postname: String,
3
+ path: String,
4
+ filename: String
5
+ }
6
+ interface RequestHandler {
7
+ reg: String,
8
+ type: "file" | "content" | "abort" | "redirect",
9
+ file?: String,
10
+ content?: String,
11
+ getLocation?:(url:string)=>string
12
+ }
13
+
14
+ interface FormItem {
15
+ key: String,
16
+ title?: String,
17
+ value?: any
18
+ }
19
+ type RunInPage = "activated" | "incognito" | "newPage" | "opened" | "";
20
+
21
+ namespace rpa {
22
+ function ready(isReady = 1);
23
+
24
+ function args(key, dvalue);
25
+ function args(key);
26
+ function setArgs(key, value): Promise;
27
+ function setPathAlias(key, value): Promise;
28
+ function mergeArgs(map: Object): Promise;
29
+ function require(path: String): Promise;
30
+ function success(data: any, exit: boolean);
31
+ function exec(script: String, params: Object = {},runInPage:RunInPage="");
32
+ function execScript(script: String, params: Object = {},runInPage:RunInPage="");
33
+
34
+ function execPuppeteer(script: String, params: Object = {});
35
+ function error(msg: String, code: number = - 1);
36
+ function exit();
37
+ function restartAndExecRpa();
38
+ function restartRpa();
39
+
40
+ function onDialog(callback: Function);
41
+ function waitForRpaReady(): Promise;
42
+ function run(func: Function, data: Object = {}): Promise;
43
+ namespace http {
44
+ function uploadFile(url: String, file: UploadFile, params: Object = {}): Promise;
45
+ function get(url: String): Promise;
46
+ function post(url: String, data: Object): Promise;
47
+ function getBase64(url: String): Promise;
48
+ namespace api {
49
+ function post(url: String, data: Object): Promise;
50
+ }
51
+ }
52
+
53
+ namespace ajax {
54
+ function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
55
+ function get(url: String, headers: Object = {}): Promise;
56
+ function getBase64(url: String, headers: Object = {}): Promise;
57
+ function download(url: String, path: String): Promise;
58
+ function setApiBase(_url_pre: String);
59
+ function setBaseData(data: Object);
60
+ }
61
+
62
+ namespace console {
63
+ function log(object: any): Promise;
64
+ function error(error): Promise;
65
+ function readline(tip: String = "", dvalue = ""): Promise;
66
+ }
67
+ namespace thread {
68
+ function lockThread(tag: String): Promise;
69
+ function lock(tag: String = 'main'): Promise;
70
+ function unlock(tag: String = 'main');
71
+ function singleThread(tag: String): Promise;
72
+ function singleTask(func: Function, waitTimeout: Number = 10, tag: String = 'main'): Promise;
73
+ function clearTask(tag: String = 'main');
74
+ }
75
+ namespace tools {
76
+ function keep(maxTime: Number, promise: Promise, errorMsg: String = null): Promise<any>
77
+ function getUrlHost(url: String): String;
78
+ function addRequestHandler(r: RequestHandler): Promise
79
+ function uploadFile(domOrSelector: | String | Element, path: String | Array<String>): Promise
80
+ function log(object: any): Promise;
81
+ function getAbsolutePath(path: String): Promise;
82
+ function getHtml(url: String): Promise;
83
+ function getResponseContentOnPage(pageUrl: String, urlOrurls: String | Array<String>): Promise;
84
+ function waitForResponseContent(url: String): Promise;
85
+ function execSystem(cmd: String): Promise;
86
+ function fileGetContent(path: String): Promise;
87
+ function fileGetContentBase64(path: String): Promise;
88
+ function getScriptContent(path: String): Promise;
89
+ function download(url: String, path: String): Promise;
90
+ function sleep(time: Number): Promise;
91
+ function setInterval(callback: Function, interval: Number): Promise;
92
+ function writeFile(filePath: String, content: String, isBase64: boolean = false): Promise;
93
+ function forEach(list: Array, callback: Function): Promise;
94
+ function mkdir(path: String): Promise;
95
+ function randomString(len: Number): Promise;
96
+ function function2string(func: Function, data: Object): String;
97
+ function waitForTrue(func: Function, interval = 500): Promise;
98
+ function encodeURI(str: String, charset: String = "utf-8"): Promise;
99
+ function decodeURI(str: String, charset: String = "utf-8"): Promise;
100
+ function replace(str: String, regex: RegExp, asyncFn: Function): Promise;
101
+ function arrayBufferToBase64(buffer: String): String;
102
+ function waitForSelector(selectorOrFunction: String | Function): Promise<Element>;
103
+ function waitForSelectors(selectorOrFunction: String | Function): Promise<Array<Element>>
104
+ }
105
+ namespace page {
106
+
107
+ function screenshot(options: Object): Promise;
108
+ function pdf(options): Promise;
109
+
110
+ function waitForNavigation(options = {});
111
+ function waitForSelector(selector, timeout = 30000);
112
+ function waitForXPath(xpath);
113
+ function waitForTimeout(timeout);
114
+ function script(func, data = {});
115
+ function newIframeAndEvaluate(url: String, func: Function): Promise;
116
+ function newIframeAndEvaluate(iframeHandler: Function, func: Function): Promise;
117
+
118
+ function download(url: String, path: String): Promise;
119
+ function closeActivated(): Promise;
120
+ namespace stracing {
121
+ function start(filePath: String): Promise;
122
+ function stop(): Promise;
123
+ }
124
+
125
+ }
126
+ namespace browser {
127
+ function newPageAndDownLoad(url: String, path: String): Promise;
128
+ function newPageAndGetBase64(url: String): Promise;
129
+ function newPageAndEvaluate(url: String, func: Function, data: Object = {}): Promise;
130
+ function waitOpenedPageAndEvaluate(invokeFun: Function, func: Function, data: Object = {}): Promise;
131
+ function waitOpenedPageAndExec(invokeFun: Function, script: String, params: Object = {}): Promise;
132
+
133
+ function getNextWindowOpenUrl(beforFunc: Function, cancel: boolean): Promise;
134
+ function getNextWindowOpenUrl(beforFunc: Function): Promise;
135
+ function newIncognitoPageAndEvaluate(url: String, func: Function, data: Object = {}): Promise;
136
+
137
+ }
138
+ namespace runtime {
139
+ function get(key: String = null): Promise;
140
+ function set(map: Object): Promise;
141
+ }
142
+ namespace frame {
143
+ function newCrossIframeContext(host: String, func: Function, data: Object = {}, removeOnFinish: Boolean = true): Promise;
144
+ function newIframeAndevaluateCross(urlOrFunction, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
145
+ function evaluateCross(name: String, func: Function, data = {}): Promise;
146
+ function evaluate(name: String, func: Function): Promise;
147
+ function evaluateOnNextFrame(invokeFun: Function, func: Function, remove: boolean): Promise;
148
+ function evaluateOnNextFrame(invokeFun: Function, func: Function): Promise;
149
+ function evaluateOnNextFrameCross(invokeFun: Function, func: Function, data: Object = {}, remove: Boolean = false)
150
+
151
+ }
152
+ namespace localStorage {
153
+ function setItem(key: String, value): Promise;
154
+ function getItem(key: String): Promise;
155
+ function clear(): Promise;
156
+ function removeItem(key: String): Promise;
157
+ }
158
+ namespace view {
159
+ function alert(message?: any): Promise;
160
+ function confirm(message?: string): Promise;
161
+ function getCustomValue(keysOrOptions: Array<String> | Array<FormItem>, autoNextCount: Number = 5, title = ""): Promise<Object>;
162
+ function showConsoleView(title: String = null, clearTime: Number = 600000, zIndex: Number = 10000, clearKeepNum: Number = 50): Promise;
163
+ function hideConsoleView();
164
+ function console(msg: String, color: String = "#ffffff");
165
+ function consoleClear();
166
+ function showMaskView(title: String = "");
167
+ function hideMaskView();
168
+
169
+ }
170
+ namespace process {
171
+ function exit(): Promise;
172
+ }
173
+ namespace cross {
174
+ function newIframeContextAndEvaluate(host: String, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
175
+ function newIframeAndEvaluate(urlOrFunction: String | Function, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
176
+ namespace ajax {
177
+ function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
178
+ function get(url: String, headers: Object = {}): Promise;
179
+ function getBase64(url: String, headers: Object = {}): Promise;
180
+ function download(url: String, path: String): Promise
181
+ }
182
+
183
+ }
184
+ }
185
+
186
+ declare function require(path: String, readCache: Boolean = true): Promise;
187
+ // declare let args: Object;
188
+ namespace args {
189
+ function get(key: String, dvalue: any = null): any;
190
+ }