tadcode-wpsjs 0.1.3 → 0.3.2

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.
package/types/index.d.ts CHANGED
@@ -2,85 +2,46 @@ import type { WithExecution } from './type-tools'
2
2
  import type DB_Application from './DB_Application'
3
3
  import type KSheet_Application from './KSheet_Application'
4
4
  import type KSDrive from './KSDrive'
5
+
5
6
  interface WpsjsGlobal {
6
- Date: typeof Date
7
- KSDrive: KSDrive
8
- Application: KSheet_Application & DB_Application
7
+ KSDrive: KSDrive
8
+ Application: KSheet_Application & DB_Application
9
9
  }
10
+
10
11
  type WithExecutionWpsjsGlobal = WithExecution<WpsjsGlobal>
12
+
11
13
  interface InfoItem {
12
- method: keyof typeof Reflect
13
- arguments: string[]
14
+ method: keyof typeof Reflect
15
+ arguments: string[]
14
16
  }
17
+
15
18
  interface RemoteCallWpsjsGlobalReturn {
16
- "data": {
17
- "logs": [
18
- {
19
- "filename": "<system>",
20
- "timestamp": string,
21
- "unix_time": number,
22
- "level": "info",
23
- "args": [
24
- "脚本环境(2.0)初始化..."
25
- ]
26
- },
27
- {
28
- "filename": "<system>",
29
- "timestamp": string,
30
- "unix_time": number,
31
- "level": "info",
32
- "args": [
33
- "已开始执行"
34
- ]
35
- },
36
- {
37
- "filename": "xxxx.js:row:column",
38
- "timestamp": string,
39
- "unix_time": number,
40
- "level": "error",
41
- "args": []
42
- },
43
- {
44
- "filename": "xxxx.js:row:column",
45
- "timestamp": string,
46
- "unix_time": number,
47
- "level": "warn",
48
- "args": []
49
- },
50
- {
51
- "filename": "xxxx.js:row:column",
52
- "timestamp": string,
53
- "unix_time": number,
54
- "level": "info",
55
- "args": []
56
- },
57
- {
58
- "filename": "<system>",
59
- "timestamp": string,
60
- "unix_time": number,
61
- "level": "info",
62
- "args": [
63
- "执行完毕"
64
- ]
65
- }
66
- ],
67
- "result": unknown,
68
- "task_id": string,
69
- },
70
- "error": string,
71
- "error_details": {
72
- "name": string,
73
- "msg": string,
74
- "stack": string[],
75
- "unix_time": number,
76
- },
77
- "status": "finished",
78
- "task_id": "GN/KU3B3BG84MdCjraN5mukx0Rt5Sp1eJ9k2qClmcaOkkF3PUVNDOYPY7Kz4aQMXSvXn9N08QabldRKjPfzii87fuGYydIuK2la2HMfcxmGK1Pf4WcPEflb5xOOkQQEo8fmEbzcobhurYg==",
79
- "task_type": "open_air_script",
19
+ "data": {
20
+ "logs": {
21
+ "filename": string
22
+ "timestamp": string
23
+ "unix_time": number
24
+ "level": 'info' | 'error' | 'warn'
25
+ "args": string[]
26
+ }[]
27
+ "result": unknown
28
+ "task_id": string
29
+ }
30
+ "error": string
31
+ "error_details": {
32
+ "name": string
33
+ "msg": string
34
+ "stack": string[]
35
+ "unix_time": number
36
+ }
37
+ "status": "finished"
38
+ "task_id": string
39
+ "task_type": string
80
40
  }
41
+
81
42
  export {
82
- WpsjsGlobal,
83
- WithExecutionWpsjsGlobal,
84
- InfoItem,
85
- RemoteCallWpsjsGlobalReturn,
43
+ WpsjsGlobal,
44
+ WithExecutionWpsjsGlobal,
45
+ InfoItem,
46
+ RemoteCallWpsjsGlobalReturn,
86
47
  }
@@ -1,13 +1,33 @@
1
- /* 根据给的对象,添加execution方法 */
1
+ /**根据给的对象,添加execution方法 */
2
2
  type WithExecution<T> = T extends (...args: infer A) => infer R
3
- ? ((...args: A) => WithExecution<R>) & { execution: () => Promise<R> }
4
- : T extends object
5
- ? { [K in keyof T]: WithExecution<T[K]> } & { execution: () => Promise<T> }
6
- : T & { execution: () => Promise<T> }
3
+ ? ((...args: A) => WithExecution<R>) & { execution: () => Promise<R> }
4
+ : T extends object
5
+ ? { [K in keyof T]: WithExecution<T[K]> } & { execution: () => Promise<T> }
6
+ : T & { execution: () => Promise<T> }
7
+
7
8
  /**部分可选 */
8
9
  type MakePropertyOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
9
- /* 选取修改类型 */
10
+
11
+ /**选取修改类型 */
10
12
  type PickModify<T, K extends keyof T, M> = {
11
- [P in K]: M
13
+ [P in K]: M
14
+ }
15
+
16
+ /**
17
+ * 深度可选工具类型
18
+ */
19
+ type DeepPartial<T> = T extends object
20
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
21
+ : T
22
+
23
+ /**去掉联合类型对象中的id */
24
+ type DistributiveOmit<T, K extends PropertyKey> =
25
+ T extends any ? Omit<T, K> : never
26
+
27
+ export type {
28
+ WithExecution,
29
+ MakePropertyOptional,
30
+ PickModify,
31
+ DeepPartial,
32
+ DistributiveOmit,
12
33
  }
13
- export type { WithExecution, MakePropertyOptional, PickModify }
package/.editorconfig DELETED
@@ -1,16 +0,0 @@
1
- # EditorConfig is awesome: https://editorconfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- [*]
7
- end_of_line = lf
8
- insert_final_newline = true
9
- charset = utf-8
10
- indent_style = tab
11
- tab_width = 2
12
- trim_trailing_whitespace = true
13
-
14
- [*.md]
15
- indent_style = tab
16
- trim_trailing_whitespace = false
@@ -1,44 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- /* 需要插件Bun for Visual Studio Code id:oven.bun-vscode */
6
- "type": "bun",
7
- "request": "launch",
8
- "name": "Debug Bun",
9
- // The path to a JavaScript or TypeScript file to run.
10
- "program": "${file}",
11
- // The arguments to pass to the program, if any.
12
- "args": [],
13
- // The working directory of the program.
14
- "cwd": "${workspaceFolder}",
15
- // The environment variables to pass to the program.
16
- "env": {},
17
- // If the environment variables should not be inherited from the parent process.
18
- "strictEnv": false,
19
- // If the program should be run in watch mode.
20
- // This is equivalent to passing `--watch` to the `bun` executable.
21
- // You can also set this to "hot" to enable hot reloading using `--hot`.
22
- "watchMode": true,
23
- // If the debugger should stop on the first line of the program.
24
- "stopOnEntry": false,
25
- // If the debugger should be disabled. (for example, breakpoints will not be hit)
26
- "noDebug": false,
27
- // The path to the `bun` executable, defaults to your `PATH` environment variable.
28
- "runtime": "bun",
29
- // The arguments to pass to the `bun` executable, if any.
30
- // Unlike `args`, these are passed to the executable itself, not the program.
31
- "runtimeArgs": [
32
- // "--hot"
33
- ],
34
- },
35
- {
36
- "type": "bun",
37
- "request": "attach",
38
- "name": "Attach to Bun",
39
- // The URL of the WebSocket inspector to attach to.
40
- // This value can be retrieved by using `bun --inspect`.
41
- "url": "ws://localhost:6499/",
42
- },
43
- ]
44
- }
@@ -1,26 +0,0 @@
1
- {
2
- "files.autoSave": "off",
3
- // The path to the `bun` executable.
4
- // "bun.runtime": "/path/to/bun",
5
- // If support for Bun should be added to the default "JavaScript Debug Terminal".
6
- "bun.debugTerminal.enabled": true,
7
- // If the debugger should stop on the first line of the program.
8
- "bun.debugTerminal.stopOnEntry": false,
9
- // Glob pattern to find test files. Defaults to the value shown below.
10
- "bun.test.filePattern": "**/*{.test.,.spec.,_test_,_spec_}{js,ts,tsx,jsx,mts,cts}",
11
- "search.exclude": {
12
- "**/node_modules": true,
13
- "**/bower_components": true,
14
- "**/*.code-search": true
15
- },
16
- "files.exclude": {
17
- "**/node_modules": true,
18
- "**/.git": true,
19
- "**/.svn": true,
20
- "**/.hg": true,
21
- "**/CVS": true,
22
- "**/.DS_Store": true,
23
- "**/Thumbs.db": true,
24
- "bun.lock": true,
25
- }
26
- }