@tarojs/plugin-platform-h5 3.8.0-canary.0 → 4.0.0-beta.0
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/build/utils/ast.ts +14 -5
- package/dist/definition.json +39 -9
- package/dist/dist/definition.json.d.ts +205 -163
- package/dist/dist/definition.json.js +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +142 -43
- package/dist/index.js.map +1 -1
- package/package.json +15 -14
package/build/utils/ast.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'path'
|
|
1
2
|
import ts from 'typescript'
|
|
2
3
|
|
|
3
4
|
export interface DocEntry {
|
|
@@ -16,6 +17,15 @@ export interface DocEntry {
|
|
|
16
17
|
symbol?: DocEntry
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
export function pathsAreEqual (path1: string, path2: string) {
|
|
21
|
+
path1 = path.resolve(path1)
|
|
22
|
+
path2 = path.resolve(path2)
|
|
23
|
+
if (process.platform === 'win32') {
|
|
24
|
+
return path1.toLowerCase() === path2.toLowerCase()
|
|
25
|
+
}
|
|
26
|
+
return path1 === path2
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
export function generateDocumentation (
|
|
20
30
|
filepaths: string[],
|
|
21
31
|
options: ts.CompilerOptions,
|
|
@@ -30,10 +40,9 @@ export function generateDocumentation (
|
|
|
30
40
|
|
|
31
41
|
for (const sourceFile of program.getSourceFiles()) {
|
|
32
42
|
if (param.withDeclaration !== false || !sourceFile.isDeclarationFile) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
) {
|
|
43
|
+
// Note: 规范化路径,修复window环境无法生成definition.json文件
|
|
44
|
+
const normalSrcFile = path.normalize(sourceFile.fileName)
|
|
45
|
+
if ((param.mapAll === true && filepaths.includes(normalSrcFile)) || normalSrcFile === path.normalize(filepaths[0])) {
|
|
37
46
|
ts.forEachChild(sourceFile, (n) => visitAST(n, output))
|
|
38
47
|
}
|
|
39
48
|
}
|
|
@@ -136,7 +145,7 @@ export function generateDocumentation (
|
|
|
136
145
|
}
|
|
137
146
|
|
|
138
147
|
/** Serialize a types (type or interface) symbol information */
|
|
139
|
-
function serializeType (symbol: ts.Symbol, name?: string, type?:
|
|
148
|
+
function serializeType (symbol: ts.Symbol, name?: string, type?: keyof typeof ts.SyntaxKind): DocEntry {
|
|
140
149
|
// console.log(type, Object.keys(symbol))
|
|
141
150
|
const doc: DocEntry = serializeSymbol(symbol, name, type)
|
|
142
151
|
symbol.exports && symbol.exports.forEach((value) => {
|
package/dist/definition.json
CHANGED
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
"callback": "Result"
|
|
350
350
|
},
|
|
351
351
|
"offAccelerometerChange": {
|
|
352
|
-
"callback": "
|
|
352
|
+
"callback": "Result"
|
|
353
353
|
},
|
|
354
354
|
"checkIsOpenAccessibility": {
|
|
355
355
|
"object": "*",
|
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
"callback": "OnCompassChangeCallbackResult"
|
|
561
561
|
},
|
|
562
562
|
"offCompassChange": {
|
|
563
|
-
"callback": "
|
|
563
|
+
"callback": "OnCompassChangeCallbackResult"
|
|
564
564
|
},
|
|
565
565
|
"chooseContact": {
|
|
566
566
|
"object": "*",
|
|
@@ -674,7 +674,7 @@
|
|
|
674
674
|
"callback": "CallbackResult"
|
|
675
675
|
},
|
|
676
676
|
"offDeviceMotionChange": {
|
|
677
|
-
"callback": "
|
|
677
|
+
"callback": "CallbackResult"
|
|
678
678
|
},
|
|
679
679
|
"getNetworkType": {
|
|
680
680
|
"object": "Option",
|
|
@@ -1511,11 +1511,6 @@
|
|
|
1511
1511
|
"success": "void",
|
|
1512
1512
|
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1513
1513
|
},
|
|
1514
|
-
"checkIsAddedToMyMiniProgram": {
|
|
1515
|
-
"object": "*",
|
|
1516
|
-
"success": "void",
|
|
1517
|
-
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1518
|
-
},
|
|
1519
1514
|
"getGroupEnterInfo": {
|
|
1520
1515
|
"object": "*",
|
|
1521
1516
|
"success": "void",
|
|
@@ -1551,6 +1546,31 @@
|
|
|
1551
1546
|
"success": "void",
|
|
1552
1547
|
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1553
1548
|
},
|
|
1549
|
+
"checkIsAddedToMyMiniProgram": {
|
|
1550
|
+
"object": "*",
|
|
1551
|
+
"success": "void",
|
|
1552
|
+
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1553
|
+
},
|
|
1554
|
+
"requirePrivacyAuthorize": {
|
|
1555
|
+
"object": "*",
|
|
1556
|
+
"success": "void",
|
|
1557
|
+
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1558
|
+
},
|
|
1559
|
+
"openPrivacyContract": {
|
|
1560
|
+
"object": "*",
|
|
1561
|
+
"success": "void",
|
|
1562
|
+
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1563
|
+
},
|
|
1564
|
+
"onNeedPrivacyAuthorization": {
|
|
1565
|
+
"object": "*",
|
|
1566
|
+
"success": "void",
|
|
1567
|
+
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1568
|
+
},
|
|
1569
|
+
"getPrivacySetting": {
|
|
1570
|
+
"object": "*",
|
|
1571
|
+
"success": "void",
|
|
1572
|
+
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
|
|
1573
|
+
},
|
|
1554
1574
|
"showRedPackage": {
|
|
1555
1575
|
"object": "*",
|
|
1556
1576
|
"success": "void",
|
|
@@ -2102,7 +2122,9 @@
|
|
|
2102
2122
|
"camera": {},
|
|
2103
2123
|
"canvas": {
|
|
2104
2124
|
"canvasId": "string",
|
|
2105
|
-
"
|
|
2125
|
+
"height": "string",
|
|
2126
|
+
"nativeProps": "*",
|
|
2127
|
+
"width": "string"
|
|
2106
2128
|
},
|
|
2107
2129
|
"channel-live": {},
|
|
2108
2130
|
"channel-video": {},
|
|
@@ -2243,6 +2265,12 @@
|
|
|
2243
2265
|
"showInfo": "boolean",
|
|
2244
2266
|
"strokeWidth": "string | number"
|
|
2245
2267
|
},
|
|
2268
|
+
"pull-to-refresh": {
|
|
2269
|
+
"damping": "number",
|
|
2270
|
+
"distanceToRefresh": "number",
|
|
2271
|
+
"indicator": "{ activate: string; deactivate: string; release: string; finish: string; }",
|
|
2272
|
+
"prefixCls": "string"
|
|
2273
|
+
},
|
|
2246
2274
|
"radio": {
|
|
2247
2275
|
"checked": "boolean",
|
|
2248
2276
|
"disabled": "boolean",
|
|
@@ -2291,6 +2319,7 @@
|
|
|
2291
2319
|
"value": "number"
|
|
2292
2320
|
},
|
|
2293
2321
|
"slot": {},
|
|
2322
|
+
"snapshot": {},
|
|
2294
2323
|
"sticky-header": {},
|
|
2295
2324
|
"sticky-section": {},
|
|
2296
2325
|
"swiper": {
|
|
@@ -2310,6 +2339,7 @@
|
|
|
2310
2339
|
"zoom": "boolean"
|
|
2311
2340
|
},
|
|
2312
2341
|
"swiper-item": {
|
|
2342
|
+
"deep": "boolean",
|
|
2313
2343
|
"itemId": "string"
|
|
2314
2344
|
},
|
|
2315
2345
|
"switch": {
|