@aibee/crc-bmap 0.14.37 → 0.14.38
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/lib/index.cjs +22 -22
- package/lib/index.esm.min.js +30 -30
- package/lib/meta.json +146 -21
- package/lib/src/bmap.d.ts +4 -0
- package/lib/src/elements/poi2.d.ts +26 -0
- package/lib/src/factory/img-texture.d.ts +2 -0
- package/lib/src/loader/AibeeLoader/index.d.ts +10 -1
- package/lib/src/utils/index-db.d.ts +20 -6
- package/lib/worker/loader.worker-XZ4WO3FM.js +3806 -0
- package/package.json +1 -1
- package/lib/worker/loader.worker-XXRNBKJA.js +0 -3806
package/lib/meta.json
CHANGED
|
@@ -1142,13 +1142,28 @@
|
|
|
1142
1142
|
"format": "esm"
|
|
1143
1143
|
},
|
|
1144
1144
|
"../lib/src/utils/index-db.js": {
|
|
1145
|
-
"bytes":
|
|
1145
|
+
"bytes": 9851,
|
|
1146
1146
|
"imports": [
|
|
1147
1147
|
{
|
|
1148
1148
|
"path": "core-js/modules/es.error.cause.js",
|
|
1149
1149
|
"kind": "import-statement",
|
|
1150
1150
|
"external": true
|
|
1151
1151
|
},
|
|
1152
|
+
{
|
|
1153
|
+
"path": "core-js/modules/web.dom-exception.constructor.js",
|
|
1154
|
+
"kind": "import-statement",
|
|
1155
|
+
"external": true
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"path": "core-js/modules/web.dom-exception.stack.js",
|
|
1159
|
+
"kind": "import-statement",
|
|
1160
|
+
"external": true
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"path": "core-js/modules/web.dom-exception.to-string-tag.js",
|
|
1164
|
+
"kind": "import-statement",
|
|
1165
|
+
"external": true
|
|
1166
|
+
},
|
|
1152
1167
|
{
|
|
1153
1168
|
"path": "<runtime>",
|
|
1154
1169
|
"kind": "import-statement",
|
|
@@ -1350,8 +1365,13 @@
|
|
|
1350
1365
|
"format": "esm"
|
|
1351
1366
|
},
|
|
1352
1367
|
"../lib/src/factory/img-texture.js": {
|
|
1353
|
-
"bytes":
|
|
1368
|
+
"bytes": 4061,
|
|
1354
1369
|
"imports": [
|
|
1370
|
+
{
|
|
1371
|
+
"path": "core-js/modules/es.error.cause.js",
|
|
1372
|
+
"kind": "import-statement",
|
|
1373
|
+
"external": true
|
|
1374
|
+
},
|
|
1355
1375
|
{
|
|
1356
1376
|
"path": "core-js/modules/web.dom-collections.iterator.js",
|
|
1357
1377
|
"kind": "import-statement",
|
|
@@ -2010,7 +2030,7 @@
|
|
|
2010
2030
|
"format": "esm"
|
|
2011
2031
|
},
|
|
2012
2032
|
"../lib/src/layer/poi-text-batch.js": {
|
|
2013
|
-
"bytes":
|
|
2033
|
+
"bytes": 13198,
|
|
2014
2034
|
"imports": [
|
|
2015
2035
|
{
|
|
2016
2036
|
"path": "core-js/modules/web.dom-collections.iterator.js",
|
|
@@ -2111,7 +2131,7 @@
|
|
|
2111
2131
|
"format": "esm"
|
|
2112
2132
|
},
|
|
2113
2133
|
"../lib/src/layer/poi-icon-batch.js": {
|
|
2114
|
-
"bytes":
|
|
2134
|
+
"bytes": 10820,
|
|
2115
2135
|
"imports": [
|
|
2116
2136
|
{
|
|
2117
2137
|
"path": "core-js/modules/web.dom-collections.iterator.js",
|
|
@@ -2399,7 +2419,7 @@
|
|
|
2399
2419
|
"format": "esm"
|
|
2400
2420
|
},
|
|
2401
2421
|
"../src/utils/index-db.ts": {
|
|
2402
|
-
"bytes":
|
|
2422
|
+
"bytes": 8563,
|
|
2403
2423
|
"imports": [
|
|
2404
2424
|
{
|
|
2405
2425
|
"path": "<runtime>",
|
|
@@ -2482,7 +2502,7 @@
|
|
|
2482
2502
|
"format": "esm"
|
|
2483
2503
|
},
|
|
2484
2504
|
"../src/factory/img-texture.ts": {
|
|
2485
|
-
"bytes":
|
|
2505
|
+
"bytes": 3732,
|
|
2486
2506
|
"imports": [
|
|
2487
2507
|
{
|
|
2488
2508
|
"path": "three",
|
|
@@ -3420,7 +3440,7 @@
|
|
|
3420
3440
|
"format": "esm"
|
|
3421
3441
|
},
|
|
3422
3442
|
"../lib/src/elements/poi2.js": {
|
|
3423
|
-
"bytes":
|
|
3443
|
+
"bytes": 41167,
|
|
3424
3444
|
"imports": [
|
|
3425
3445
|
{
|
|
3426
3446
|
"path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
|
|
@@ -3437,6 +3457,41 @@
|
|
|
3437
3457
|
"kind": "import-statement",
|
|
3438
3458
|
"external": true
|
|
3439
3459
|
},
|
|
3460
|
+
{
|
|
3461
|
+
"path": "core-js/modules/es.set.difference.v2.js",
|
|
3462
|
+
"kind": "import-statement",
|
|
3463
|
+
"external": true
|
|
3464
|
+
},
|
|
3465
|
+
{
|
|
3466
|
+
"path": "core-js/modules/es.set.intersection.v2.js",
|
|
3467
|
+
"kind": "import-statement",
|
|
3468
|
+
"external": true
|
|
3469
|
+
},
|
|
3470
|
+
{
|
|
3471
|
+
"path": "core-js/modules/es.set.is-disjoint-from.v2.js",
|
|
3472
|
+
"kind": "import-statement",
|
|
3473
|
+
"external": true
|
|
3474
|
+
},
|
|
3475
|
+
{
|
|
3476
|
+
"path": "core-js/modules/es.set.is-subset-of.v2.js",
|
|
3477
|
+
"kind": "import-statement",
|
|
3478
|
+
"external": true
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
"path": "core-js/modules/es.set.is-superset-of.v2.js",
|
|
3482
|
+
"kind": "import-statement",
|
|
3483
|
+
"external": true
|
|
3484
|
+
},
|
|
3485
|
+
{
|
|
3486
|
+
"path": "core-js/modules/es.set.symmetric-difference.v2.js",
|
|
3487
|
+
"kind": "import-statement",
|
|
3488
|
+
"external": true
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
"path": "core-js/modules/es.set.union.v2.js",
|
|
3492
|
+
"kind": "import-statement",
|
|
3493
|
+
"external": true
|
|
3494
|
+
},
|
|
3440
3495
|
{
|
|
3441
3496
|
"path": "core-js/modules/es.string.trim.js",
|
|
3442
3497
|
"kind": "import-statement",
|
|
@@ -3476,7 +3531,7 @@
|
|
|
3476
3531
|
"format": "esm"
|
|
3477
3532
|
},
|
|
3478
3533
|
"../lib/src/elements/floor.js": {
|
|
3479
|
-
"bytes":
|
|
3534
|
+
"bytes": 7765,
|
|
3480
3535
|
"imports": [
|
|
3481
3536
|
{
|
|
3482
3537
|
"path": "core-js/modules/web.dom-collections.iterator.js",
|
|
@@ -5022,7 +5077,7 @@
|
|
|
5022
5077
|
"format": "esm"
|
|
5023
5078
|
},
|
|
5024
5079
|
"../lib/src/context/collision-system.js": {
|
|
5025
|
-
"bytes":
|
|
5080
|
+
"bytes": 6772,
|
|
5026
5081
|
"imports": [
|
|
5027
5082
|
{
|
|
5028
5083
|
"path": "core-js/modules/es.array.unshift.js",
|
|
@@ -5182,7 +5237,7 @@
|
|
|
5182
5237
|
"format": "esm"
|
|
5183
5238
|
},
|
|
5184
5239
|
"../lib/src/loader/AibeeLoader/index.js": {
|
|
5185
|
-
"bytes":
|
|
5240
|
+
"bytes": 24793,
|
|
5186
5241
|
"imports": [
|
|
5187
5242
|
{
|
|
5188
5243
|
"path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
|
|
@@ -5199,6 +5254,11 @@
|
|
|
5199
5254
|
"kind": "import-statement",
|
|
5200
5255
|
"external": true
|
|
5201
5256
|
},
|
|
5257
|
+
{
|
|
5258
|
+
"path": "core-js/modules/es.error.cause.js",
|
|
5259
|
+
"kind": "import-statement",
|
|
5260
|
+
"external": true
|
|
5261
|
+
},
|
|
5202
5262
|
{
|
|
5203
5263
|
"path": "../lib/src/utils/index-db.js",
|
|
5204
5264
|
"kind": "import-statement",
|
|
@@ -5327,7 +5387,7 @@
|
|
|
5327
5387
|
"format": "esm"
|
|
5328
5388
|
},
|
|
5329
5389
|
"../lib/src/bmap.js": {
|
|
5330
|
-
"bytes":
|
|
5390
|
+
"bytes": 24399,
|
|
5331
5391
|
"imports": [
|
|
5332
5392
|
{
|
|
5333
5393
|
"path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
|
|
@@ -5399,6 +5459,11 @@
|
|
|
5399
5459
|
"kind": "import-statement",
|
|
5400
5460
|
"original": "./loader"
|
|
5401
5461
|
},
|
|
5462
|
+
{
|
|
5463
|
+
"path": "../lib/src/utils/index-db.js",
|
|
5464
|
+
"kind": "import-statement",
|
|
5465
|
+
"original": "./utils/index-db"
|
|
5466
|
+
},
|
|
5402
5467
|
{
|
|
5403
5468
|
"path": "<runtime>",
|
|
5404
5469
|
"kind": "import-statement",
|
|
@@ -8080,11 +8145,31 @@
|
|
|
8080
8145
|
"kind": "import-statement",
|
|
8081
8146
|
"external": true
|
|
8082
8147
|
},
|
|
8148
|
+
{
|
|
8149
|
+
"path": "core-js/modules/web.dom-exception.constructor.js",
|
|
8150
|
+
"kind": "import-statement",
|
|
8151
|
+
"external": true
|
|
8152
|
+
},
|
|
8153
|
+
{
|
|
8154
|
+
"path": "core-js/modules/web.dom-exception.stack.js",
|
|
8155
|
+
"kind": "import-statement",
|
|
8156
|
+
"external": true
|
|
8157
|
+
},
|
|
8158
|
+
{
|
|
8159
|
+
"path": "core-js/modules/web.dom-exception.to-string-tag.js",
|
|
8160
|
+
"kind": "import-statement",
|
|
8161
|
+
"external": true
|
|
8162
|
+
},
|
|
8083
8163
|
{
|
|
8084
8164
|
"path": "three",
|
|
8085
8165
|
"kind": "import-statement",
|
|
8086
8166
|
"external": true
|
|
8087
8167
|
},
|
|
8168
|
+
{
|
|
8169
|
+
"path": "core-js/modules/es.error.cause.js",
|
|
8170
|
+
"kind": "import-statement",
|
|
8171
|
+
"external": true
|
|
8172
|
+
},
|
|
8088
8173
|
{
|
|
8089
8174
|
"path": "core-js/modules/web.dom-collections.iterator.js",
|
|
8090
8175
|
"kind": "import-statement",
|
|
@@ -8690,6 +8775,41 @@
|
|
|
8690
8775
|
"kind": "import-statement",
|
|
8691
8776
|
"external": true
|
|
8692
8777
|
},
|
|
8778
|
+
{
|
|
8779
|
+
"path": "core-js/modules/es.set.difference.v2.js",
|
|
8780
|
+
"kind": "import-statement",
|
|
8781
|
+
"external": true
|
|
8782
|
+
},
|
|
8783
|
+
{
|
|
8784
|
+
"path": "core-js/modules/es.set.intersection.v2.js",
|
|
8785
|
+
"kind": "import-statement",
|
|
8786
|
+
"external": true
|
|
8787
|
+
},
|
|
8788
|
+
{
|
|
8789
|
+
"path": "core-js/modules/es.set.is-disjoint-from.v2.js",
|
|
8790
|
+
"kind": "import-statement",
|
|
8791
|
+
"external": true
|
|
8792
|
+
},
|
|
8793
|
+
{
|
|
8794
|
+
"path": "core-js/modules/es.set.is-subset-of.v2.js",
|
|
8795
|
+
"kind": "import-statement",
|
|
8796
|
+
"external": true
|
|
8797
|
+
},
|
|
8798
|
+
{
|
|
8799
|
+
"path": "core-js/modules/es.set.is-superset-of.v2.js",
|
|
8800
|
+
"kind": "import-statement",
|
|
8801
|
+
"external": true
|
|
8802
|
+
},
|
|
8803
|
+
{
|
|
8804
|
+
"path": "core-js/modules/es.set.symmetric-difference.v2.js",
|
|
8805
|
+
"kind": "import-statement",
|
|
8806
|
+
"external": true
|
|
8807
|
+
},
|
|
8808
|
+
{
|
|
8809
|
+
"path": "core-js/modules/es.set.union.v2.js",
|
|
8810
|
+
"kind": "import-statement",
|
|
8811
|
+
"external": true
|
|
8812
|
+
},
|
|
8693
8813
|
{
|
|
8694
8814
|
"path": "core-js/modules/es.string.trim.js",
|
|
8695
8815
|
"kind": "import-statement",
|
|
@@ -9410,6 +9530,11 @@
|
|
|
9410
9530
|
"kind": "import-statement",
|
|
9411
9531
|
"external": true
|
|
9412
9532
|
},
|
|
9533
|
+
{
|
|
9534
|
+
"path": "core-js/modules/es.error.cause.js",
|
|
9535
|
+
"kind": "import-statement",
|
|
9536
|
+
"external": true
|
|
9537
|
+
},
|
|
9413
9538
|
{
|
|
9414
9539
|
"path": "three",
|
|
9415
9540
|
"kind": "import-statement",
|
|
@@ -10266,7 +10391,7 @@
|
|
|
10266
10391
|
"bytesInOutput": 208
|
|
10267
10392
|
},
|
|
10268
10393
|
"../lib/src/bmap.js": {
|
|
10269
|
-
"bytesInOutput":
|
|
10394
|
+
"bytesInOutput": 11609
|
|
10270
10395
|
},
|
|
10271
10396
|
"../lib/src/context/context.js": {
|
|
10272
10397
|
"bytesInOutput": 9505
|
|
@@ -10386,7 +10511,7 @@
|
|
|
10386
10511
|
"bytesInOutput": 2371
|
|
10387
10512
|
},
|
|
10388
10513
|
"../lib/src/utils/index-db.js": {
|
|
10389
|
-
"bytesInOutput":
|
|
10514
|
+
"bytesInOutput": 2884
|
|
10390
10515
|
},
|
|
10391
10516
|
"../lib/src/factory/worker/sdf-text.worker.js": {
|
|
10392
10517
|
"bytesInOutput": 97
|
|
@@ -10395,7 +10520,7 @@
|
|
|
10395
10520
|
"bytesInOutput": 3816
|
|
10396
10521
|
},
|
|
10397
10522
|
"../lib/src/factory/img-texture.js": {
|
|
10398
|
-
"bytesInOutput":
|
|
10523
|
+
"bytesInOutput": 1890
|
|
10399
10524
|
},
|
|
10400
10525
|
"../lib/src/factory/model.js": {
|
|
10401
10526
|
"bytesInOutput": 898
|
|
@@ -10452,7 +10577,7 @@
|
|
|
10452
10577
|
"bytesInOutput": 4421
|
|
10453
10578
|
},
|
|
10454
10579
|
"../lib/src/elements/floor.js": {
|
|
10455
|
-
"bytesInOutput":
|
|
10580
|
+
"bytesInOutput": 4621
|
|
10456
10581
|
},
|
|
10457
10582
|
"../lib/src/elements/model.js": {
|
|
10458
10583
|
"bytesInOutput": 410
|
|
@@ -10470,10 +10595,10 @@
|
|
|
10470
10595
|
"bytesInOutput": 2126
|
|
10471
10596
|
},
|
|
10472
10597
|
"../lib/src/layer/poi-text-batch.js": {
|
|
10473
|
-
"bytesInOutput":
|
|
10598
|
+
"bytesInOutput": 6806
|
|
10474
10599
|
},
|
|
10475
10600
|
"../lib/src/layer/poi-icon-batch.js": {
|
|
10476
|
-
"bytesInOutput":
|
|
10601
|
+
"bytesInOutput": 5907
|
|
10477
10602
|
},
|
|
10478
10603
|
"../lib/src/layer/parking-layer.js": {
|
|
10479
10604
|
"bytesInOutput": 4035
|
|
@@ -10509,7 +10634,7 @@
|
|
|
10509
10634
|
"bytesInOutput": 1595
|
|
10510
10635
|
},
|
|
10511
10636
|
"../lib/src/elements/poi2.js": {
|
|
10512
|
-
"bytesInOutput":
|
|
10637
|
+
"bytesInOutput": 18439
|
|
10513
10638
|
},
|
|
10514
10639
|
"../lib/src/elements/heatmap.js": {
|
|
10515
10640
|
"bytesInOutput": 2123
|
|
@@ -10602,13 +10727,13 @@
|
|
|
10602
10727
|
"bytesInOutput": 186
|
|
10603
10728
|
},
|
|
10604
10729
|
"../lib/src/context/collision-system.js": {
|
|
10605
|
-
"bytesInOutput":
|
|
10730
|
+
"bytesInOutput": 2605
|
|
10606
10731
|
},
|
|
10607
10732
|
"../lib/src/config.js": {
|
|
10608
10733
|
"bytesInOutput": 1360
|
|
10609
10734
|
},
|
|
10610
10735
|
"../lib/src/loader/AibeeLoader/index.js": {
|
|
10611
|
-
"bytesInOutput":
|
|
10736
|
+
"bytesInOutput": 10701
|
|
10612
10737
|
},
|
|
10613
10738
|
"../lib/src/loader/AibeeLoader/layer.js": {
|
|
10614
10739
|
"bytesInOutput": 4435
|
|
@@ -10764,7 +10889,7 @@
|
|
|
10764
10889
|
"bytesInOutput": 0
|
|
10765
10890
|
}
|
|
10766
10891
|
},
|
|
10767
|
-
"bytes":
|
|
10892
|
+
"bytes": 477063
|
|
10768
10893
|
}
|
|
10769
10894
|
}
|
|
10770
10895
|
}
|
package/lib/src/bmap.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export declare enum MapTypePolar {
|
|
|
43
43
|
}
|
|
44
44
|
export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
45
45
|
private container;
|
|
46
|
+
/** 当前存活的 BMap 实例数;共享 db / factory 只在最后一个实例销毁时释放 */
|
|
47
|
+
private static liveCount;
|
|
48
|
+
/** dispose 幂等标记,避免同一个实例重复减少 liveCount */
|
|
49
|
+
private disposed;
|
|
46
50
|
config: Config;
|
|
47
51
|
context: Context;
|
|
48
52
|
polarKeys: string[];
|
|
@@ -64,6 +64,21 @@ export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
|
64
64
|
box: Box2;
|
|
65
65
|
boxHelper?: HTMLDivElement;
|
|
66
66
|
private _shouldShow;
|
|
67
|
+
/** 异步文字/图标初始化版本号;hide 或下一次重建会递增,旧请求据此失效 */
|
|
68
|
+
private textRevision;
|
|
69
|
+
/** show/hide 的版本号,避免旧的 show 在 await 之后继续操作新状态 */
|
|
70
|
+
private visibilityRevision;
|
|
71
|
+
/** 下一帧按最新 zoom/textHeight 再校准一次网格缩放 */
|
|
72
|
+
private scheduleScaleSync;
|
|
73
|
+
/** 图标初始化版本号,和 textRevision 同理 */
|
|
74
|
+
private iconRevision;
|
|
75
|
+
/** 下一帧的缩放校准任务,避免创建瞬间的 zoom/布局与渲染帧不一致 */
|
|
76
|
+
private scaleSyncRaf;
|
|
77
|
+
/** 只记录 SDK 自己创建的文字/背景网格,避免误销毁外部添加到 POI 的对象 */
|
|
78
|
+
private textObjects;
|
|
79
|
+
/** 只记录 SDK 自己创建的独立图标 sprite */
|
|
80
|
+
private iconSprites;
|
|
81
|
+
get shouldShow(): boolean;
|
|
67
82
|
/** 文字布局结果(按 textTextureKey 缓存) */
|
|
68
83
|
textLayoutMap: Record<string, TextLayoutResult>;
|
|
69
84
|
/** 所属 PoiLayer2 的文字合批器;为空时保持旧的逐 POI Mesh 渲染 */
|
|
@@ -120,6 +135,15 @@ export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
|
120
135
|
} | null;
|
|
121
136
|
get deltaZ(): number;
|
|
122
137
|
get canSelect(): boolean;
|
|
138
|
+
/** 释放单个文字/背景网格的几何与材质 */
|
|
139
|
+
private disposeTextMesh;
|
|
140
|
+
/**
|
|
141
|
+
* 清掉 SDK 自己创建的所有文字/背景网格。
|
|
142
|
+
* 用 Set 记录所有权,而不是扫描 children/userData,避免误销毁外部对象。
|
|
143
|
+
*/
|
|
144
|
+
private clearTextObjects;
|
|
145
|
+
/** 清掉 SDK 自己创建的所有独立图标 sprite */
|
|
146
|
+
private clearIconObjects;
|
|
123
147
|
show(): Promise<void>;
|
|
124
148
|
hide(): void;
|
|
125
149
|
registryEvent(): void;
|
|
@@ -127,6 +151,8 @@ export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
|
127
151
|
getPosition(): Vector3;
|
|
128
152
|
initIcon(): Promise<Sprite<Object3DEventMap> | undefined>;
|
|
129
153
|
get textTextureKey(): string;
|
|
154
|
+
/** 预生成当前文案的布局和包围盒,即使 POI 当前被碰撞隐藏也要做 */
|
|
155
|
+
private prepareTextLayout;
|
|
130
156
|
_initTextTexture: () => Promise<void>;
|
|
131
157
|
initTextTexture: () => Promise<void>;
|
|
132
158
|
/** 计算文字的 SDF 布局(含换行),度量来自共享字形图集;结果会缓存到 textLayoutMap */
|
|
@@ -5,6 +5,8 @@ export declare class ImgTextureFactory {
|
|
|
5
5
|
static borderUrlTextureMap: Map<string, Texture | Promise<Texture>>;
|
|
6
6
|
private static canvas;
|
|
7
7
|
private static ctx;
|
|
8
|
+
/** 懒创建离屏画布;dispose 后下一次使用时会重新创建 */
|
|
9
|
+
private static ensureCanvas;
|
|
8
10
|
static getTextureByUrl(url: string): Promise<Texture>;
|
|
9
11
|
static getUrlTextureBorder(url: string, size: number, border: {
|
|
10
12
|
width: number;
|
|
@@ -30,6 +30,13 @@ interface AibeeLoaderEventMap {
|
|
|
30
30
|
graphics: Graphic[];
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
+
/** 切楼层失败(数据不可用、缓存/网络异常等);调用方据此结束 loading */
|
|
34
|
+
'switch-floor-error': {
|
|
35
|
+
data: {
|
|
36
|
+
floor: string;
|
|
37
|
+
error: unknown;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
33
40
|
}
|
|
34
41
|
export interface AibeeFloorInfo {
|
|
35
42
|
floor_id: number;
|
|
@@ -60,6 +67,8 @@ export interface PlaceConfig {
|
|
|
60
67
|
}
|
|
61
68
|
export declare class AibeeLoader extends EventDispatcher<AibeeLoaderEventMap> {
|
|
62
69
|
bmap: BMap;
|
|
70
|
+
/** 防止 dispose 重复执行(BMap.dispose 和组件卸载可能都会调用) */
|
|
71
|
+
disposed: boolean;
|
|
63
72
|
floors: AibeeFloorInfo[];
|
|
64
73
|
initDbPromise: Promise<void>;
|
|
65
74
|
/** 全场预热的完成信号;需要确保缓存已就绪时可 await 它 */
|
|
@@ -76,7 +85,7 @@ export declare class AibeeLoader extends EventDispatcher<AibeeLoaderEventMap> {
|
|
|
76
85
|
initDb(): Promise<void>;
|
|
77
86
|
load(data: number | string | AibeeFloorInfo[], placeConfig?: Partial<PlaceConfig>): Promise<void>;
|
|
78
87
|
waitForPreload(): Promise<void>;
|
|
79
|
-
setCacheData(storeName: string, key: string | number, data: any): Promise<
|
|
88
|
+
setCacheData(storeName: string, key: string | number, data: any): Promise<any>;
|
|
80
89
|
getCacheData<T>(storeName: string, key: string | number): Promise<T>;
|
|
81
90
|
/**
|
|
82
91
|
* 刚写入 IndexedDB 的数据,在 Safari/WKWebView 下可能因为事务提交时序短暂读不到。
|
|
@@ -11,6 +11,20 @@ export declare enum MAP_DB_TABLES {
|
|
|
11
11
|
LAZY_POI = "lazy_poi",// 车位poi
|
|
12
12
|
SDF_GLYPH = "sdf_glyph_1"
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* 增加一个 db 持有者。由 BMap 在构造时调用,和 releaseDb 成对出现。
|
|
16
|
+
* 持有者存在期间,即使某个 AibeeLoader 被销毁,也不会关闭共享连接。
|
|
17
|
+
*/
|
|
18
|
+
export declare function retainDb(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 释放一个 db 持有者。只有最后一个持有者释放时才关闭连接。
|
|
21
|
+
*/
|
|
22
|
+
export declare function releaseDb(): void;
|
|
23
|
+
/**
|
|
24
|
+
* 获取 indexDb 连接。
|
|
25
|
+
* 连接不可用时会重新打开;worker 里没有 window,允许 worker 自己打开自己的连接。
|
|
26
|
+
*/
|
|
27
|
+
export declare function ensureDb(): Promise<IDBDatabase>;
|
|
14
28
|
/**
|
|
15
29
|
* 获取indexDb连接
|
|
16
30
|
* @param database
|
|
@@ -27,7 +41,7 @@ export declare function createDb(database?: string, version?: number): Promise<{
|
|
|
27
41
|
* @param db
|
|
28
42
|
* @returns
|
|
29
43
|
*/
|
|
30
|
-
export declare function get(storeName: string, key: string, db?: IDBDatabase): Promise<
|
|
44
|
+
export declare function get(storeName: string, key: string, db?: IDBDatabase | null): Promise<any>;
|
|
31
45
|
/**
|
|
32
46
|
* 添加数据
|
|
33
47
|
* @param storeName
|
|
@@ -36,14 +50,14 @@ export declare function get(storeName: string, key: string, db?: IDBDatabase): P
|
|
|
36
50
|
* @param db
|
|
37
51
|
* @returns
|
|
38
52
|
*/
|
|
39
|
-
export declare function set(storeName: string, key: string, value: any, db?: IDBDatabase, forceAdd?: boolean): Promise<
|
|
53
|
+
export declare function set(storeName: string, key: string, value: any, db?: IDBDatabase | null, forceAdd?: boolean): Promise<any>;
|
|
40
54
|
/**
|
|
41
55
|
* 创建数据表
|
|
42
56
|
* @param storeName
|
|
43
57
|
* @param db
|
|
44
58
|
* @returns
|
|
45
59
|
*/
|
|
46
|
-
export declare function createStore(storeName: string, db?: IDBDatabase): void;
|
|
60
|
+
export declare function createStore(storeName: string, db?: IDBDatabase | null): void;
|
|
47
61
|
/**
|
|
48
62
|
* 删除数据
|
|
49
63
|
* @param storeName
|
|
@@ -51,7 +65,7 @@ export declare function createStore(storeName: string, db?: IDBDatabase): void;
|
|
|
51
65
|
* @param db
|
|
52
66
|
* @returns
|
|
53
67
|
*/
|
|
54
|
-
export declare function remove(storeName: string, key: string, db?: IDBDatabase): Promise<
|
|
68
|
+
export declare function remove(storeName: string, key: string, db?: IDBDatabase | null): Promise<any>;
|
|
55
69
|
/**
|
|
56
70
|
* 更新数据
|
|
57
71
|
* @param storeName
|
|
@@ -60,5 +74,5 @@ export declare function remove(storeName: string, key: string, db?: IDBDatabase)
|
|
|
60
74
|
* @param db
|
|
61
75
|
* @returns
|
|
62
76
|
*/
|
|
63
|
-
export declare function update(storeName: string, key: string, value: any, db?: IDBDatabase): Promise<
|
|
64
|
-
export declare function closeDb(db?: IDBDatabase): void;
|
|
77
|
+
export declare function update(storeName: string, key: string, value: any, db?: IDBDatabase | null): Promise<any>;
|
|
78
|
+
export declare function closeDb(db?: IDBDatabase | null): void;
|