oipage 0.3.1-alpha.0 → 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/CHANGELOG +61 -61
- package/README.md +122 -122
- package/bin/options.js +73 -73
- package/bin/run +208 -208
- package/browserjs/getStyle/index.d.ts +10 -10
- package/browserjs/getStyle/index.js +12 -12
- package/browserjs/index.d.ts +12 -12
- package/browserjs/index.js +8 -8
- package/browserjs/onReady/index.d.ts +7 -7
- package/browserjs/onReady/index.js +7 -7
- package/browserjs/setStyle/index.d.ts +9 -9
- package/browserjs/setStyle/index.js +4 -4
- package/corejs/animation/index.d.ts +11 -11
- package/corejs/animation/index.js +101 -101
- package/corejs/index.d.ts +9 -9
- package/corejs/index.js +6 -6
- package/corejs/throttle/index.d.ts +30 -30
- package/corejs/throttle/index.js +49 -49
- package/nodejs/core/file.js +162 -162
- package/nodejs/core/image.js +4 -4
- package/nodejs/core/log.js +89 -89
- package/nodejs/core/network.js +39 -39
- package/nodejs/core/options.js +48 -48
- package/nodejs/core/remote.js +60 -60
- package/nodejs/core/responseFileList.js +27 -27
- package/nodejs/core/server.js +198 -198
- package/nodejs/data/404.js +51 -51
- package/nodejs/data/mime.types.js +111 -111
- package/nodejs/form/common.js +2 -2
- package/nodejs/form/index.js +79 -79
- package/nodejs/form/select.js +9 -9
- package/nodejs/index.js +57 -57
- package/nodejs/loader/simpleScss.js +247 -247
- package/nodejs/loader/xhtml.js +520 -520
- package/nodejs/reader/plain.js +20 -20
- package/package.json +33 -33
- package/stylecss/index.css +3 -3
- package/stylecss/normalize.css +93 -93
- package/stylecss/rasterize.css +317 -317
- package/stylecss/skeleton.css +16 -16
- package/types/get-options.d.ts +5 -5
- package/types/index.d.ts +186 -186
package/types/index.d.ts
CHANGED
|
@@ -1,187 +1,187 @@
|
|
|
1
|
-
import getOptionsType from './get-options'
|
|
2
|
-
|
|
3
|
-
export default class OIPage {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 命令行参数解析
|
|
7
|
-
* @param shortHands
|
|
8
|
-
* @param argv
|
|
9
|
-
*/
|
|
10
|
-
static options(shortHands: any, argv: any): any
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 删除文件或文件夹
|
|
14
|
-
* @param target
|
|
15
|
-
*/
|
|
16
|
-
static deleteSync(target: string): void
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 复制文件或文件夹
|
|
20
|
-
* @param source
|
|
21
|
-
* @param target
|
|
22
|
-
*/
|
|
23
|
-
static copySync(source: string, target: string): void
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 移动文件或文件夹
|
|
27
|
-
* @param source
|
|
28
|
-
* @param target
|
|
29
|
-
*/
|
|
30
|
-
static moveSync(source: string, target: string): void
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 遍历当前文件或文件夹中所有文件
|
|
34
|
-
* @param source
|
|
35
|
-
* @param callback
|
|
36
|
-
*/
|
|
37
|
-
static listFileSync(source: string, callback: (fileInfo: {
|
|
38
|
-
name: string,
|
|
39
|
-
path: string,
|
|
40
|
-
folder: string
|
|
41
|
-
}) => void): void
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 获取文件或文件夹的全路径
|
|
45
|
-
* @param pathString 需要变成全路径的路径
|
|
46
|
-
* @param contextPath 拼接上下文路径,可选,默认当前命令行路径
|
|
47
|
-
* @returns {path} 返回拼接的全路径
|
|
48
|
-
*/
|
|
49
|
-
static fullPathSync(pathString: string, contextPath?: string): string
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 图片变成base64字符串
|
|
53
|
-
* @param filepath 图片地址
|
|
54
|
-
*/
|
|
55
|
-
static toBase64(filepath: string): string
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 日志打印
|
|
59
|
-
* @param txt
|
|
60
|
-
*/
|
|
61
|
-
static log(txt: string): void
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 提醒打印
|
|
65
|
-
* @param txt
|
|
66
|
-
*/
|
|
67
|
-
static warn(txt: string): void
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 警告打印
|
|
71
|
-
* @param txt
|
|
72
|
-
*/
|
|
73
|
-
static error(txt: string): void
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* 单行打印
|
|
77
|
-
* @param txt
|
|
78
|
-
*/
|
|
79
|
-
static linelog(txt: string): void
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 进度打印
|
|
83
|
-
* @param percentum
|
|
84
|
-
* @param txt
|
|
85
|
-
*/
|
|
86
|
-
static deeplog(percentum: number, txt?: string): void
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 进度打印(已废弃,请用deeplog代替)
|
|
90
|
-
* @param percentum
|
|
91
|
-
* @param txt
|
|
92
|
-
*/
|
|
93
|
-
static process(percentum: number, txt?: string): void
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get 请求
|
|
97
|
-
* @param url
|
|
98
|
-
* @param options
|
|
99
|
-
*/
|
|
100
|
-
static get(url: string, options?: getOptionsType): Promise<any>
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Post 请求
|
|
104
|
-
* @param url
|
|
105
|
-
* @param options
|
|
106
|
-
*/
|
|
107
|
-
static post(url: string, options?: getOptionsType): Promise<any>
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* 获取本机网络信息
|
|
111
|
-
*/
|
|
112
|
-
static network(): any
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* 文件类型
|
|
116
|
-
*/
|
|
117
|
-
static mimeTypes(): { [name: string]: string }
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 服务器
|
|
121
|
-
*/
|
|
122
|
-
static server(config: {
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 端口号
|
|
126
|
-
*
|
|
127
|
-
* 默认值:20000
|
|
128
|
-
*/
|
|
129
|
-
port?: number
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 服务器根地址
|
|
133
|
-
*
|
|
134
|
-
* 默认值:./
|
|
135
|
-
*/
|
|
136
|
-
basePath?:string
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 配置转发,可以任意多个
|
|
140
|
-
*/
|
|
141
|
-
proxy?: Array<any>
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* 自定义拦截,如果返回true表示此次请求自定义处理
|
|
145
|
-
*/
|
|
146
|
-
handler?: (request, response) => boolean
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 表示缺省后缀
|
|
150
|
-
*
|
|
151
|
-
* 默认值:[".html",".htm",".js",".json"]
|
|
152
|
-
*/
|
|
153
|
-
suffixs?: Array<string>
|
|
154
|
-
}): void
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* scss文件转css(只支持部分scss语法)
|
|
158
|
-
* @param source
|
|
159
|
-
*/
|
|
160
|
-
static simpleScss(source: string): string
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* xhtml文件解析成json对象
|
|
164
|
-
* @param source
|
|
165
|
-
*/
|
|
166
|
-
static xhtml(source: string): Array<{
|
|
167
|
-
type: string,
|
|
168
|
-
name: string,
|
|
169
|
-
attrs: {
|
|
170
|
-
[key: string]: string
|
|
171
|
-
},
|
|
172
|
-
__deep__: number,
|
|
173
|
-
__tagType__: string,
|
|
174
|
-
childNodes: Array<number>,
|
|
175
|
-
preNode: null | number,
|
|
176
|
-
nextNode: null | number,
|
|
177
|
-
parentNode: null | number
|
|
178
|
-
} | {
|
|
179
|
-
type: string,
|
|
180
|
-
content: string,
|
|
181
|
-
__deep__: number,
|
|
182
|
-
childNodes: Array<number>,
|
|
183
|
-
preNode: null | number,
|
|
184
|
-
nextNode: null | number,
|
|
185
|
-
parentNode: null | number
|
|
186
|
-
}>
|
|
1
|
+
import getOptionsType from './get-options'
|
|
2
|
+
|
|
3
|
+
export default class OIPage {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 命令行参数解析
|
|
7
|
+
* @param shortHands
|
|
8
|
+
* @param argv
|
|
9
|
+
*/
|
|
10
|
+
static options(shortHands: any, argv: any): any
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 删除文件或文件夹
|
|
14
|
+
* @param target
|
|
15
|
+
*/
|
|
16
|
+
static deleteSync(target: string): void
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 复制文件或文件夹
|
|
20
|
+
* @param source
|
|
21
|
+
* @param target
|
|
22
|
+
*/
|
|
23
|
+
static copySync(source: string, target: string): void
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 移动文件或文件夹
|
|
27
|
+
* @param source
|
|
28
|
+
* @param target
|
|
29
|
+
*/
|
|
30
|
+
static moveSync(source: string, target: string): void
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 遍历当前文件或文件夹中所有文件
|
|
34
|
+
* @param source
|
|
35
|
+
* @param callback
|
|
36
|
+
*/
|
|
37
|
+
static listFileSync(source: string, callback: (fileInfo: {
|
|
38
|
+
name: string,
|
|
39
|
+
path: string,
|
|
40
|
+
folder: string
|
|
41
|
+
}) => void): void
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 获取文件或文件夹的全路径
|
|
45
|
+
* @param pathString 需要变成全路径的路径
|
|
46
|
+
* @param contextPath 拼接上下文路径,可选,默认当前命令行路径
|
|
47
|
+
* @returns {path} 返回拼接的全路径
|
|
48
|
+
*/
|
|
49
|
+
static fullPathSync(pathString: string, contextPath?: string): string
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 图片变成base64字符串
|
|
53
|
+
* @param filepath 图片地址
|
|
54
|
+
*/
|
|
55
|
+
static toBase64(filepath: string): string
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 日志打印
|
|
59
|
+
* @param txt
|
|
60
|
+
*/
|
|
61
|
+
static log(txt: string): void
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 提醒打印
|
|
65
|
+
* @param txt
|
|
66
|
+
*/
|
|
67
|
+
static warn(txt: string): void
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 警告打印
|
|
71
|
+
* @param txt
|
|
72
|
+
*/
|
|
73
|
+
static error(txt: string): void
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 单行打印
|
|
77
|
+
* @param txt
|
|
78
|
+
*/
|
|
79
|
+
static linelog(txt: string): void
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 进度打印
|
|
83
|
+
* @param percentum
|
|
84
|
+
* @param txt
|
|
85
|
+
*/
|
|
86
|
+
static deeplog(percentum: number, txt?: string): void
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 进度打印(已废弃,请用deeplog代替)
|
|
90
|
+
* @param percentum
|
|
91
|
+
* @param txt
|
|
92
|
+
*/
|
|
93
|
+
static process(percentum: number, txt?: string): void
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get 请求
|
|
97
|
+
* @param url
|
|
98
|
+
* @param options
|
|
99
|
+
*/
|
|
100
|
+
static get(url: string, options?: getOptionsType): Promise<any>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Post 请求
|
|
104
|
+
* @param url
|
|
105
|
+
* @param options
|
|
106
|
+
*/
|
|
107
|
+
static post(url: string, options?: getOptionsType): Promise<any>
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 获取本机网络信息
|
|
111
|
+
*/
|
|
112
|
+
static network(): any
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 文件类型
|
|
116
|
+
*/
|
|
117
|
+
static mimeTypes(): { [name: string]: string }
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 服务器
|
|
121
|
+
*/
|
|
122
|
+
static server(config: {
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 端口号
|
|
126
|
+
*
|
|
127
|
+
* 默认值:20000
|
|
128
|
+
*/
|
|
129
|
+
port?: number
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 服务器根地址
|
|
133
|
+
*
|
|
134
|
+
* 默认值:./
|
|
135
|
+
*/
|
|
136
|
+
basePath?:string
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 配置转发,可以任意多个
|
|
140
|
+
*/
|
|
141
|
+
proxy?: Array<any>
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 自定义拦截,如果返回true表示此次请求自定义处理
|
|
145
|
+
*/
|
|
146
|
+
handler?: (request, response) => boolean
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 表示缺省后缀
|
|
150
|
+
*
|
|
151
|
+
* 默认值:[".html",".htm",".js",".json"]
|
|
152
|
+
*/
|
|
153
|
+
suffixs?: Array<string>
|
|
154
|
+
}): void
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* scss文件转css(只支持部分scss语法)
|
|
158
|
+
* @param source
|
|
159
|
+
*/
|
|
160
|
+
static simpleScss(source: string): string
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* xhtml文件解析成json对象
|
|
164
|
+
* @param source
|
|
165
|
+
*/
|
|
166
|
+
static xhtml(source: string): Array<{
|
|
167
|
+
type: string,
|
|
168
|
+
name: string,
|
|
169
|
+
attrs: {
|
|
170
|
+
[key: string]: string
|
|
171
|
+
},
|
|
172
|
+
__deep__: number,
|
|
173
|
+
__tagType__: string,
|
|
174
|
+
childNodes: Array<number>,
|
|
175
|
+
preNode: null | number,
|
|
176
|
+
nextNode: null | number,
|
|
177
|
+
parentNode: null | number
|
|
178
|
+
} | {
|
|
179
|
+
type: string,
|
|
180
|
+
content: string,
|
|
181
|
+
__deep__: number,
|
|
182
|
+
childNodes: Array<number>,
|
|
183
|
+
preNode: null | number,
|
|
184
|
+
nextNode: null | number,
|
|
185
|
+
parentNode: null | number
|
|
186
|
+
}>
|
|
187
187
|
}
|