@ywbgn/bgl-package 1.1.1 → 1.2.1

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/dist/index.d.ts CHANGED
@@ -212,6 +212,14 @@ visible: boolean;
212
212
  }> | null;
213
213
  }, HTMLDivElement>;
214
214
 
215
+ declare const __VLS_component_2: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
216
+ close: () => any;
217
+ }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
218
+ onClose?: (() => any) | undefined;
219
+ }>, {
220
+ anchor: "center" | "start";
221
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
222
+
215
223
  /** 外层容器尺寸,支持像素数字或 CSS 字符串(如 100%、70vh) */
216
224
  declare type __VLS_Props = {
217
225
  width?: string | number;
@@ -282,6 +290,53 @@ declare type __VLS_Props_3 = {
282
290
  numericLabelColor?: string;
283
291
  };
284
292
 
293
+ declare type __VLS_Props_4 = {
294
+ /** 弹框标题 */
295
+ title: string;
296
+ /** 弹框宽度,默认 300px */
297
+ width?: number | string;
298
+ /**
299
+ * 水平锚点:center 配合工具栏居中弹框;
300
+ * start 配合左对齐弹框(如底图切换),拖动不带 -50% 偏移。
301
+ */
302
+ anchor?: 'center' | 'start';
303
+ };
304
+
305
+ declare type __VLS_Props_5 = {
306
+ map: default_2 | null;
307
+ view: default_3 | null;
308
+ systemCoordinateWkid?: number | null;
309
+ mapBounds?: MapBounds | null;
310
+ };
311
+
312
+ declare type __VLS_Props_6 = {
313
+ /** 双向绑定值 */
314
+ modelValue?: string | number;
315
+ /** 输入类型 */
316
+ type?: string;
317
+ /** 占位文案 */
318
+ placeholder?: string;
319
+ /** 是否禁用 */
320
+ disabled?: boolean;
321
+ /** 原生最小值 */
322
+ min?: string | number;
323
+ /** 原生最大值 */
324
+ max?: string | number;
325
+ };
326
+
327
+ declare type __VLS_Props_7 = {
328
+ /** 当前值 */
329
+ modelValue?: string;
330
+ /** 选项列表 */
331
+ options?: BglSelectOption[];
332
+ /** 无选中值时的占位文案 */
333
+ placeholder?: string;
334
+ /** 是否展开 */
335
+ open?: boolean;
336
+ /** 是否禁用 */
337
+ disabled?: boolean;
338
+ };
339
+
285
340
  declare function __VLS_template(): {
286
341
  attrs: Partial<{}>;
287
342
  slots: {
@@ -329,14 +384,31 @@ declare function __VLS_template(): {
329
384
  rootEl: HTMLDivElement;
330
385
  };
331
386
 
387
+ declare function __VLS_template_2(): {
388
+ attrs: Partial<{}>;
389
+ slots: {
390
+ default?(_: {}): any;
391
+ };
392
+ refs: {};
393
+ rootEl: any;
394
+ };
395
+
332
396
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
333
397
 
398
+ declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
399
+
334
400
  declare type __VLS_WithTemplateSlots<T, S> = T & {
335
401
  new (): {
336
402
  $slots: S;
337
403
  };
338
404
  };
339
405
 
406
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
407
+ new (): {
408
+ $slots: S;
409
+ };
410
+ };
411
+
340
412
  /**
341
413
  * 按配置给已上图的业务 FeatureLayer 设置 labelingInfo。
342
414
  * 仅 FeatureLayer 生效;找不到图层时跳过。
@@ -426,6 +498,44 @@ keys: BasemapKeys | null;
426
498
  basemapSelectRef: HTMLDivElement;
427
499
  }, HTMLDivElement>;
428
500
 
501
+ export declare const BglInput: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
502
+ "update:modelValue": (value: string) => any;
503
+ }, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{
504
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
505
+ }>, {
506
+ type: string;
507
+ placeholder: string;
508
+ disabled: boolean;
509
+ modelValue: string | number;
510
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
511
+
512
+ export declare const BglSelect: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
513
+ select: (value: string) => any;
514
+ "update:modelValue": (value: string) => any;
515
+ "update:open": (open: boolean) => any;
516
+ }, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{
517
+ onSelect?: ((value: string) => any) | undefined;
518
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
519
+ "onUpdate:open"?: ((open: boolean) => any) | undefined;
520
+ }>, {
521
+ placeholder: string;
522
+ disabled: boolean;
523
+ modelValue: string;
524
+ options: BglSelectOption[];
525
+ open: boolean;
526
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
527
+ rootRef: HTMLDivElement;
528
+ }, any>;
529
+
530
+ declare type BglSelectOption = {
531
+ /** 选项值 */
532
+ value: string;
533
+ /** 选项展示文案 */
534
+ label: string;
535
+ /** 是否禁用该选项 */
536
+ disabled?: boolean;
537
+ };
538
+
429
539
  /**
430
540
  * 由字段列表生成 Arcade 表达式(空格拼接)。
431
541
  */
@@ -560,6 +670,11 @@ export declare const getSpatialReferenceMismatches: () => SpatialReferenceMismat
560
670
  */
561
671
  export declare const goToFullExtent: (view: default_3, lonLatExtent: LonLatExtent) => Promise<void>;
562
672
 
673
+ /**
674
+ * 判断 goTo 是否被后续定位打断(可安全忽略,避免 Uncaught (in promise))。
675
+ */
676
+ export declare const isViewGotoInterrupted: (error: unknown) => boolean;
677
+
563
678
  declare type LayerProps = __esri.FeatureLayerProperties | __esri.MapImageLayerProperties;
564
679
 
565
680
  /** 图例停靠左右(避让业务侧栏) */
@@ -621,6 +736,13 @@ export declare type LonLatExtent = {
621
736
  ymax: number;
622
737
  };
623
738
 
739
+ export declare type MapBounds = {
740
+ jwXMin: number;
741
+ jwXMax: number;
742
+ jwYMin: number;
743
+ jwYMax: number;
744
+ };
745
+
624
746
  export declare const MapLegend: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {
625
747
  idPrefix: string;
626
748
  position: LegendDockPosition;
@@ -646,11 +768,13 @@ barStyle: ScaleBarStyle;
646
768
  showNumericScale: boolean;
647
769
  numericScaleUseGrouping: boolean;
648
770
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
649
- scaleBarContainerRef: HTMLDivElement;
771
+ rootRef: HTMLDivElement;
650
772
  }, HTMLDivElement>;
651
773
 
652
774
  export declare const MapToolbar: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
653
775
 
776
+ export declare const MapToolPanel: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
777
+
654
778
  /**
655
779
  * 将待创建图层真正加入地图并重排 z 序。
656
780
  * 成功后从登记表移除;失败返回 null。
@@ -660,6 +784,12 @@ export declare const materializePendingBusinessLayer: (map: default_2, layerId:
660
784
  /** 合并注记所需 outFields(默认注记与手动标注共用) */
661
785
  export declare const mergeOutFields: (layer: default_7, fields: string[]) => void;
662
786
 
787
+ /**
788
+ * 将 FeatureLayer 服务自带 labelingInfo 中的不可用字体改为 Web 安全字体,
789
+ * 避免 GET .../fonts/simsun-regular/*.pbf 404。
790
+ */
791
+ export declare const normalizeFeatureLayerLabelFonts: (layer: default_7) => void;
792
+
663
793
  /** 去空白并大写,便于 WKT 文本比较 */
664
794
  export declare const normalizeWkt: (wkt: string) => string;
665
795
 
@@ -671,6 +801,10 @@ export declare type PanConstraintHandle = {
671
801
  remove(): void;
672
802
  /** 包装 view.goTo,程序化定位期间临时放开边界约束 */
673
803
  wrapViewGoTo(view: default_3): void;
804
+ /** 长期暂停约束(如 TXT 画图面板打开) */
805
+ suspend(): void;
806
+ /** 恢复约束 */
807
+ resume(): void;
674
808
  };
675
809
 
676
810
  /** 待创建业务图层的创建参数(勾选显示时使用) */
@@ -696,6 +830,16 @@ export declare type PendingBusinessLayerItem = {
696
830
  declare const plugin: Plugin_2;
697
831
  export default plugin;
698
832
 
833
+ /** 后端代签 token 登记选项(不含账号密码) */
834
+ export declare type PortalAccessTokenOptions = {
835
+ /** Portal 根地址,如 https://map.baigeli.cn */
836
+ portalUrl: string;
837
+ /** 已签发的 Portal access token */
838
+ token: string;
839
+ /** 额外登记的 server 根路径(图层 host 与 portal 不一致时传入) */
840
+ extraServers?: string[];
841
+ };
842
+
699
843
  export declare type PortalAuthOptions = {
700
844
  /** Portal 根地址,如 https://map.baigeli.cn */
701
845
  portalUrl: string;
@@ -714,6 +858,25 @@ export declare type PortalAuthOptions = {
714
858
  referer?: string;
715
859
  };
716
860
 
861
+ /** 通过 fetchToken 回调续期的选项(生产推荐) */
862
+ export declare type PortalTokenFetcherRenewalOptions = {
863
+ portalUrl: string;
864
+ /** 首次与续期均调用;返回 null 表示跳过鉴权 */
865
+ fetchToken: () => Promise<PortalTokenFetchResult | string | null>;
866
+ /** fetch 未返回 expires 时的有效分钟数,默认 60 */
867
+ expirationMinutes?: number;
868
+ renewBeforeMinutes?: number;
869
+ extraServers?: string[];
870
+ onRenewError?: (error: unknown) => void;
871
+ };
872
+
873
+ /** 后端代签 fetch 返回值 */
874
+ export declare type PortalTokenFetchResult = {
875
+ token: string;
876
+ /** 过期时间戳(毫秒);有则按此调度续期 */
877
+ expires?: number;
878
+ };
879
+
717
880
  /** startPortalTokenRenewal 的返回值 */
718
881
  export declare type PortalTokenRenewalHandle = {
719
882
  /** 当前已登记的 token */
@@ -729,7 +892,10 @@ export declare type PortalTokenRenewalOptions = PortalAuthOptions & {
729
892
  * 例:120 分钟有效 → 默认约提前 20 分钟续期。
730
893
  */
731
894
  renewBeforeMinutes?: number;
732
- /** 续期失败回调(定时刷新失败时);首次注册失败仍会抛错 */
895
+ /**
896
+ * 续期失败回调(定时刷新失败时);首次注册失败仍会抛错。
897
+ * 连续失败时库内会节流:首次立即回调,之后同一失败串最多约每 15 分钟回调一次。
898
+ */
733
899
  onRenewError?: (error: unknown) => void;
734
900
  };
735
901
 
@@ -739,6 +905,11 @@ export declare type PortalTokenRenewalOptions = PortalAuthOptions & {
739
905
  */
740
906
  export declare const provideBasemapKeys: (keys: MaybeRef<BasemapKeys>) => void;
741
907
 
908
+ /**
909
+ * 登记后端代签的 Portal token(不调用 generateToken)。
910
+ */
911
+ export declare const registerPortalAccessToken: (options: PortalAccessTokenOptions) => string;
912
+
742
913
  /**
743
914
  * 向 IdentityManager 注册 Portal token,并挂请求拦截器保证首轮带 token。
744
915
  * 注意:前端持有账号密码仅适合内网联调;生产应由后端签发 token。
@@ -770,6 +941,14 @@ export declare const resolveLabelExpression: (config: BusinessLayerLabelConfig)
770
941
  */
771
942
  export declare const resolveLayerVisible: (value: unknown) => boolean;
772
943
 
944
+ /** 恢复指定视图的平移边界约束 */
945
+ export declare function resumePanBounds(view: default_3): void;
946
+
947
+ /**
948
+ * 包装 view.goTo:忽略打断类拒绝,其它错误继续抛出。
949
+ */
950
+ export declare const safeViewGoTo: (view: default_3, target: Parameters<default_3["goTo"]>[0], options?: Parameters<default_3["goTo"]>[1]) => Promise<void>;
951
+
773
952
  /** 比例尺样式 */
774
953
  declare type ScaleBarStyle = 'line' | 'ruler';
775
954
 
@@ -785,6 +964,16 @@ export declare const setPendingBusinessLayers: (layers: BusinessLayerConfig[], o
785
964
  /** 是否应按 MapImageLayer 加载(整幅 MapServer) */
786
965
  export declare const shouldUseMapImageLayer: (item: BusinessLayerConfig) => boolean;
787
966
 
967
+ export declare const SpatialAnalysisPanel: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {
968
+ systemCoordinateWkid: number | null;
969
+ mapBounds: MapBounds | null;
970
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
971
+ fileInputRef: HTMLInputElement;
972
+ tabsScrollRef: HTMLDivElement;
973
+ tableWrapRef: HTMLDivElement;
974
+ wordRef: HTMLDivElement;
975
+ }, HTMLDivElement>;
976
+
788
977
  /** 业务图层坐标系校验结果原因 */
789
978
  export declare type SpatialReferenceCheckReason = 'mismatch' | 'unreadable';
790
979
 
@@ -824,12 +1013,21 @@ export declare type SpatialReferenceMismatchInfo = {
824
1013
  */
825
1014
  export declare const startPortalTokenRenewal: (options: PortalTokenRenewalOptions) => Promise<PortalTokenRenewalHandle>;
826
1015
 
1016
+ /**
1017
+ * 通过 fetchToken 登记 Portal token 并自动续期(后端代签场景)。
1018
+ * fetchToken 应调用业务后端 /portalToken,不再持有 Portal 账号密码。
1019
+ */
1020
+ export declare const startPortalTokenRenewalWithFetcher: (options: PortalTokenFetcherRenewalOptions) => Promise<PortalTokenRenewalHandle>;
1021
+
827
1022
  /** 订阅待创建列表变化(返回取消订阅) */
828
1023
  export declare const subscribePendingBusinessLayers: (listener: () => void) => (() => void);
829
1024
 
830
1025
  /** 订阅不一致登记变化(返回取消订阅函数) */
831
1026
  export declare const subscribeSpatialReferenceMismatches: (listener: () => void) => (() => void);
832
1027
 
1028
+ /** 暂停指定视图的平移边界约束 */
1029
+ export declare function suspendPanBounds(view: default_3): void;
1030
+
833
1031
  export declare const SwipeCompare: DefineComponent<ExtractPropTypes< {
834
1032
  /** MapView 实例 */
835
1033
  view: {
@@ -879,7 +1077,7 @@ export declare const toFeatureLayerProps: (item: BusinessLayerConfig) => __esri.
879
1077
  export declare const toLayerProps: (item: BusinessLayerConfig, options?: Pick<LoadBusinessLayersOptions, "idPrefix" | "outFields" | "accessToken">) => LayerProps;
880
1078
 
881
1079
  /** 工具栏内置工具 id(不含坐标条,坐标条由 showCoordinate 控制) */
882
- export declare type ToolbarToolId = 'fullExtent' | 'fullscreen' | 'zoomIn' | 'zoomOut' | 'coordinateLocate' | 'distanceMeasure' | 'areaMeasure' | 'layerManage' | 'layerSwipe' | 'mapLabel' | 'conditionQuery';
1080
+ export declare type ToolbarToolId = 'fullExtent' | 'fullscreen' | 'zoomIn' | 'zoomOut' | 'prevExtent' | 'nextExtent' | 'coordinateLocate' | 'distanceMeasure' | 'areaMeasure' | 'layerManage' | 'layerSwipe' | 'mapLabel' | 'conditionQuery' | 'txtDraw';
883
1081
 
884
1082
  /**
885
1083
  * 解析底图密钥:显式 props.keys 优先,否则取 inject,再否则空对象。
@@ -887,4 +1085,7 @@ export declare type ToolbarToolId = 'fullExtent' | 'fullscreen' | 'zoomIn' | 'zo
887
1085
  */
888
1086
  export declare const useBasemapKeys: (propsKeys?: MaybeRefOrGetter<BasemapKeys | null | undefined>) => ComputedRef<BasemapKeys>;
889
1087
 
1088
+ /** 地图 Web 标注可用字体(Esri CDN 托管字形) */
1089
+ export declare const WEB_SAFE_LABEL_FONT = "Arial Unicode MS";
1090
+
890
1091
  export { }