@feltmaps/js-sdk 1.5.0-next.0 → 1.5.0-next.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/dist/client.cjs +1 -1
- package/dist/client.d.cts +119 -4
- package/dist/client.d.ts +119 -4
- package/dist/client.js +1 -1
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +401 -6
- package/dist/handler.d.ts +401 -6
- package/dist/handler.js +1 -1
- package/dist/{types-BDviYZ-T.d.cts → types-BLsf5GHN.d.cts} +228 -3
- package/dist/{types-BDviYZ-T.d.ts → types-BLsf5GHN.d.ts} +228 -3
- package/handler.d.ts +401 -6
- package/handler.js +1 -1
- package/package.json +5 -5
- package/{types-BDviYZ-T.d.ts → types-BLsf5GHN.d.ts} +228 -3
package/handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams,
|
|
3
|
+
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams, H as FilterTernary, r as EntityNode, T as ToolType, t as ToolSettingsMap, u as ToolSettingsChangeEvent, V as ViewportState, w as ViewportConstraints, ac as UnionToIntersection, ad as PromiseOrNot } from './types-BLsf5GHN.js';
|
|
4
4
|
|
|
5
5
|
type Method<TRequest extends {
|
|
6
6
|
type: string;
|
|
@@ -825,6 +825,353 @@ type SelectionSchema = {
|
|
|
825
825
|
};
|
|
826
826
|
};
|
|
827
827
|
|
|
828
|
+
declare const SetToolMessage: z.ZodObject<{
|
|
829
|
+
type: z.ZodLiteral<"setTool">;
|
|
830
|
+
params: z.ZodNullable<z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note", "link"]>>;
|
|
831
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
832
|
+
params: "link" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "text" | null;
|
|
833
|
+
type: "setTool";
|
|
834
|
+
}, {
|
|
835
|
+
params: "link" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "text" | null;
|
|
836
|
+
type: "setTool";
|
|
837
|
+
}>;
|
|
838
|
+
declare const GetToolMessage: z.ZodObject<{
|
|
839
|
+
type: z.ZodLiteral<"getTool">;
|
|
840
|
+
params: z.ZodUndefined;
|
|
841
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
842
|
+
type: "getTool";
|
|
843
|
+
params?: undefined;
|
|
844
|
+
}, {
|
|
845
|
+
type: "getTool";
|
|
846
|
+
params?: undefined;
|
|
847
|
+
}>;
|
|
848
|
+
declare const SetToolSettingsMessage: z.ZodObject<{
|
|
849
|
+
type: z.ZodLiteral<"setToolSettings">;
|
|
850
|
+
params: z.ZodDiscriminatedUnion<"tool", [z.ZodObject<z.objectUtil.extendShape<{
|
|
851
|
+
color: z.ZodOptional<z.ZodString>;
|
|
852
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
853
|
+
frame: z.ZodOptional<z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>>;
|
|
854
|
+
}, {
|
|
855
|
+
tool: z.ZodLiteral<"pin">;
|
|
856
|
+
}>, "strip", z.ZodTypeAny, {
|
|
857
|
+
tool: "pin";
|
|
858
|
+
symbol?: string | undefined;
|
|
859
|
+
color?: string | undefined;
|
|
860
|
+
frame?: "frame-circle" | "frame-square" | null | undefined;
|
|
861
|
+
}, {
|
|
862
|
+
tool: "pin";
|
|
863
|
+
symbol?: string | undefined;
|
|
864
|
+
color?: string | undefined;
|
|
865
|
+
frame?: "frame-circle" | "frame-square" | null | undefined;
|
|
866
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
867
|
+
color: z.ZodOptional<z.ZodString>;
|
|
868
|
+
strokeOpacity: z.ZodOptional<z.ZodNumber>;
|
|
869
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
870
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<["solid", "dashed", "dotted"]>>;
|
|
871
|
+
distanceMarker: z.ZodOptional<z.ZodBoolean>;
|
|
872
|
+
}, {
|
|
873
|
+
tool: z.ZodLiteral<"line">;
|
|
874
|
+
}>, "strip", z.ZodTypeAny, {
|
|
875
|
+
tool: "line";
|
|
876
|
+
color?: string | undefined;
|
|
877
|
+
strokeOpacity?: number | undefined;
|
|
878
|
+
strokeWidth?: number | undefined;
|
|
879
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
880
|
+
distanceMarker?: boolean | undefined;
|
|
881
|
+
}, {
|
|
882
|
+
tool: "line";
|
|
883
|
+
color?: string | undefined;
|
|
884
|
+
strokeOpacity?: number | undefined;
|
|
885
|
+
strokeWidth?: number | undefined;
|
|
886
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
887
|
+
distanceMarker?: boolean | undefined;
|
|
888
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
889
|
+
color: z.ZodOptional<z.ZodString>;
|
|
890
|
+
routingMode: z.ZodOptional<z.ZodEnum<["driving", "cycling", "walking", "flying"]>>;
|
|
891
|
+
strokeOpacity: z.ZodOptional<z.ZodNumber>;
|
|
892
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
893
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<["solid", "dashed", "dotted"]>>;
|
|
894
|
+
distanceMarker: z.ZodOptional<z.ZodBoolean>;
|
|
895
|
+
endCaps: z.ZodOptional<z.ZodBoolean>;
|
|
896
|
+
}, {
|
|
897
|
+
tool: z.ZodLiteral<"route">;
|
|
898
|
+
}>, "strip", z.ZodTypeAny, {
|
|
899
|
+
tool: "route";
|
|
900
|
+
color?: string | undefined;
|
|
901
|
+
strokeOpacity?: number | undefined;
|
|
902
|
+
strokeWidth?: number | undefined;
|
|
903
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
904
|
+
distanceMarker?: boolean | undefined;
|
|
905
|
+
routingMode?: "driving" | "cycling" | "walking" | "flying" | undefined;
|
|
906
|
+
endCaps?: boolean | undefined;
|
|
907
|
+
}, {
|
|
908
|
+
tool: "route";
|
|
909
|
+
color?: string | undefined;
|
|
910
|
+
strokeOpacity?: number | undefined;
|
|
911
|
+
strokeWidth?: number | undefined;
|
|
912
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
913
|
+
distanceMarker?: boolean | undefined;
|
|
914
|
+
routingMode?: "driving" | "cycling" | "walking" | "flying" | undefined;
|
|
915
|
+
endCaps?: boolean | undefined;
|
|
916
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
917
|
+
color: z.ZodOptional<z.ZodString>;
|
|
918
|
+
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
919
|
+
strokeOpacity: z.ZodOptional<z.ZodNumber>;
|
|
920
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
921
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<["solid", "dashed", "dotted"]>>;
|
|
922
|
+
areaMarker: z.ZodOptional<z.ZodBoolean>;
|
|
923
|
+
}, {
|
|
924
|
+
tool: z.ZodLiteral<"polygon">;
|
|
925
|
+
}>, "strip", z.ZodTypeAny, {
|
|
926
|
+
tool: "polygon";
|
|
927
|
+
color?: string | undefined;
|
|
928
|
+
strokeOpacity?: number | undefined;
|
|
929
|
+
strokeWidth?: number | undefined;
|
|
930
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
931
|
+
fillOpacity?: number | undefined;
|
|
932
|
+
areaMarker?: boolean | undefined;
|
|
933
|
+
}, {
|
|
934
|
+
tool: "polygon";
|
|
935
|
+
color?: string | undefined;
|
|
936
|
+
strokeOpacity?: number | undefined;
|
|
937
|
+
strokeWidth?: number | undefined;
|
|
938
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
939
|
+
fillOpacity?: number | undefined;
|
|
940
|
+
areaMarker?: boolean | undefined;
|
|
941
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
942
|
+
color: z.ZodOptional<z.ZodString>;
|
|
943
|
+
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
944
|
+
strokeOpacity: z.ZodOptional<z.ZodNumber>;
|
|
945
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
946
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<["solid", "dashed", "dotted"]>>;
|
|
947
|
+
radiusMarker: z.ZodOptional<z.ZodBoolean>;
|
|
948
|
+
}, {
|
|
949
|
+
tool: z.ZodLiteral<"circle">;
|
|
950
|
+
}>, "strip", z.ZodTypeAny, {
|
|
951
|
+
tool: "circle";
|
|
952
|
+
color?: string | undefined;
|
|
953
|
+
strokeOpacity?: number | undefined;
|
|
954
|
+
strokeWidth?: number | undefined;
|
|
955
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
956
|
+
fillOpacity?: number | undefined;
|
|
957
|
+
radiusMarker?: boolean | undefined;
|
|
958
|
+
}, {
|
|
959
|
+
tool: "circle";
|
|
960
|
+
color?: string | undefined;
|
|
961
|
+
strokeOpacity?: number | undefined;
|
|
962
|
+
strokeWidth?: number | undefined;
|
|
963
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
964
|
+
fillOpacity?: number | undefined;
|
|
965
|
+
radiusMarker?: boolean | undefined;
|
|
966
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
967
|
+
color: z.ZodOptional<z.ZodString>;
|
|
968
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
969
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
970
|
+
}, {
|
|
971
|
+
tool: z.ZodLiteral<"marker">;
|
|
972
|
+
}>, "strip", z.ZodTypeAny, {
|
|
973
|
+
tool: "marker";
|
|
974
|
+
color?: string | undefined;
|
|
975
|
+
opacity?: number | undefined;
|
|
976
|
+
size?: number | undefined;
|
|
977
|
+
}, {
|
|
978
|
+
tool: "marker";
|
|
979
|
+
color?: string | undefined;
|
|
980
|
+
opacity?: number | undefined;
|
|
981
|
+
size?: number | undefined;
|
|
982
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
983
|
+
color: z.ZodOptional<z.ZodString>;
|
|
984
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
985
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
}, {
|
|
987
|
+
tool: z.ZodLiteral<"highlighter">;
|
|
988
|
+
}>, "strip", z.ZodTypeAny, {
|
|
989
|
+
tool: "highlighter";
|
|
990
|
+
color?: string | undefined;
|
|
991
|
+
opacity?: number | undefined;
|
|
992
|
+
size?: number | undefined;
|
|
993
|
+
}, {
|
|
994
|
+
tool: "highlighter";
|
|
995
|
+
color?: string | undefined;
|
|
996
|
+
opacity?: number | undefined;
|
|
997
|
+
size?: number | undefined;
|
|
998
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
999
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1000
|
+
align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
|
|
1001
|
+
style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
|
|
1002
|
+
}, {
|
|
1003
|
+
tool: z.ZodLiteral<"text">;
|
|
1004
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1005
|
+
tool: "text";
|
|
1006
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1007
|
+
color?: string | undefined;
|
|
1008
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1009
|
+
}, {
|
|
1010
|
+
tool: "text";
|
|
1011
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1012
|
+
color?: string | undefined;
|
|
1013
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1014
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
1015
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1016
|
+
align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
|
|
1017
|
+
style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
|
|
1018
|
+
}, {
|
|
1019
|
+
tool: z.ZodLiteral<"note">;
|
|
1020
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1021
|
+
tool: "note";
|
|
1022
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1023
|
+
color?: string | undefined;
|
|
1024
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1025
|
+
}, {
|
|
1026
|
+
tool: "note";
|
|
1027
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1028
|
+
color?: string | undefined;
|
|
1029
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1030
|
+
}>]>;
|
|
1031
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1032
|
+
params: {
|
|
1033
|
+
tool: "pin";
|
|
1034
|
+
symbol?: string | undefined;
|
|
1035
|
+
color?: string | undefined;
|
|
1036
|
+
frame?: "frame-circle" | "frame-square" | null | undefined;
|
|
1037
|
+
} | {
|
|
1038
|
+
tool: "line";
|
|
1039
|
+
color?: string | undefined;
|
|
1040
|
+
strokeOpacity?: number | undefined;
|
|
1041
|
+
strokeWidth?: number | undefined;
|
|
1042
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1043
|
+
distanceMarker?: boolean | undefined;
|
|
1044
|
+
} | {
|
|
1045
|
+
tool: "route";
|
|
1046
|
+
color?: string | undefined;
|
|
1047
|
+
strokeOpacity?: number | undefined;
|
|
1048
|
+
strokeWidth?: number | undefined;
|
|
1049
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1050
|
+
distanceMarker?: boolean | undefined;
|
|
1051
|
+
routingMode?: "driving" | "cycling" | "walking" | "flying" | undefined;
|
|
1052
|
+
endCaps?: boolean | undefined;
|
|
1053
|
+
} | {
|
|
1054
|
+
tool: "polygon";
|
|
1055
|
+
color?: string | undefined;
|
|
1056
|
+
strokeOpacity?: number | undefined;
|
|
1057
|
+
strokeWidth?: number | undefined;
|
|
1058
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1059
|
+
fillOpacity?: number | undefined;
|
|
1060
|
+
areaMarker?: boolean | undefined;
|
|
1061
|
+
} | {
|
|
1062
|
+
tool: "circle";
|
|
1063
|
+
color?: string | undefined;
|
|
1064
|
+
strokeOpacity?: number | undefined;
|
|
1065
|
+
strokeWidth?: number | undefined;
|
|
1066
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1067
|
+
fillOpacity?: number | undefined;
|
|
1068
|
+
radiusMarker?: boolean | undefined;
|
|
1069
|
+
} | {
|
|
1070
|
+
tool: "marker";
|
|
1071
|
+
color?: string | undefined;
|
|
1072
|
+
opacity?: number | undefined;
|
|
1073
|
+
size?: number | undefined;
|
|
1074
|
+
} | {
|
|
1075
|
+
tool: "highlighter";
|
|
1076
|
+
color?: string | undefined;
|
|
1077
|
+
opacity?: number | undefined;
|
|
1078
|
+
size?: number | undefined;
|
|
1079
|
+
} | {
|
|
1080
|
+
tool: "text";
|
|
1081
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1082
|
+
color?: string | undefined;
|
|
1083
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1084
|
+
} | {
|
|
1085
|
+
tool: "note";
|
|
1086
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1087
|
+
color?: string | undefined;
|
|
1088
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1089
|
+
};
|
|
1090
|
+
type: "setToolSettings";
|
|
1091
|
+
}, {
|
|
1092
|
+
params: {
|
|
1093
|
+
tool: "pin";
|
|
1094
|
+
symbol?: string | undefined;
|
|
1095
|
+
color?: string | undefined;
|
|
1096
|
+
frame?: "frame-circle" | "frame-square" | null | undefined;
|
|
1097
|
+
} | {
|
|
1098
|
+
tool: "line";
|
|
1099
|
+
color?: string | undefined;
|
|
1100
|
+
strokeOpacity?: number | undefined;
|
|
1101
|
+
strokeWidth?: number | undefined;
|
|
1102
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1103
|
+
distanceMarker?: boolean | undefined;
|
|
1104
|
+
} | {
|
|
1105
|
+
tool: "route";
|
|
1106
|
+
color?: string | undefined;
|
|
1107
|
+
strokeOpacity?: number | undefined;
|
|
1108
|
+
strokeWidth?: number | undefined;
|
|
1109
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1110
|
+
distanceMarker?: boolean | undefined;
|
|
1111
|
+
routingMode?: "driving" | "cycling" | "walking" | "flying" | undefined;
|
|
1112
|
+
endCaps?: boolean | undefined;
|
|
1113
|
+
} | {
|
|
1114
|
+
tool: "polygon";
|
|
1115
|
+
color?: string | undefined;
|
|
1116
|
+
strokeOpacity?: number | undefined;
|
|
1117
|
+
strokeWidth?: number | undefined;
|
|
1118
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1119
|
+
fillOpacity?: number | undefined;
|
|
1120
|
+
areaMarker?: boolean | undefined;
|
|
1121
|
+
} | {
|
|
1122
|
+
tool: "circle";
|
|
1123
|
+
color?: string | undefined;
|
|
1124
|
+
strokeOpacity?: number | undefined;
|
|
1125
|
+
strokeWidth?: number | undefined;
|
|
1126
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
1127
|
+
fillOpacity?: number | undefined;
|
|
1128
|
+
radiusMarker?: boolean | undefined;
|
|
1129
|
+
} | {
|
|
1130
|
+
tool: "marker";
|
|
1131
|
+
color?: string | undefined;
|
|
1132
|
+
opacity?: number | undefined;
|
|
1133
|
+
size?: number | undefined;
|
|
1134
|
+
} | {
|
|
1135
|
+
tool: "highlighter";
|
|
1136
|
+
color?: string | undefined;
|
|
1137
|
+
opacity?: number | undefined;
|
|
1138
|
+
size?: number | undefined;
|
|
1139
|
+
} | {
|
|
1140
|
+
tool: "text";
|
|
1141
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1142
|
+
color?: string | undefined;
|
|
1143
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1144
|
+
} | {
|
|
1145
|
+
tool: "note";
|
|
1146
|
+
style?: "italic" | "light" | "regular" | "caps" | undefined;
|
|
1147
|
+
color?: string | undefined;
|
|
1148
|
+
align?: "center" | "left" | "right" | undefined;
|
|
1149
|
+
};
|
|
1150
|
+
type: "setToolSettings";
|
|
1151
|
+
}>;
|
|
1152
|
+
declare const GetToolSettingsMessage: z.ZodObject<{
|
|
1153
|
+
type: z.ZodLiteral<"getToolSettings">;
|
|
1154
|
+
params: z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note"]>;
|
|
1155
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1156
|
+
params: "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "text";
|
|
1157
|
+
type: "getToolSettings";
|
|
1158
|
+
}, {
|
|
1159
|
+
params: "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "text";
|
|
1160
|
+
type: "getToolSettings";
|
|
1161
|
+
}>;
|
|
1162
|
+
type ToolsSchema = {
|
|
1163
|
+
methods: {
|
|
1164
|
+
setTool: Method<zInfer<typeof SetToolMessage>, void>;
|
|
1165
|
+
getTool: Method<zInfer<typeof GetToolMessage>, ToolType | null>;
|
|
1166
|
+
setToolSettings: Method<zInfer<typeof SetToolSettingsMessage>, void>;
|
|
1167
|
+
getToolSettings: Method<zInfer<typeof GetToolSettingsMessage>, ToolSettingsMap[keyof ToolSettingsMap]>;
|
|
1168
|
+
};
|
|
1169
|
+
listeners: {
|
|
1170
|
+
onToolChange: Listener<void, ToolType | null>;
|
|
1171
|
+
onToolSettingsChange: Listener<void, ToolSettingsChangeEvent>;
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
|
|
828
1175
|
declare const UiControlsMessage: zod.ZodObject<{
|
|
829
1176
|
type: zod.ZodLiteral<"updateUiControls">;
|
|
830
1177
|
params: zod.ZodObject<{
|
|
@@ -974,6 +1321,46 @@ declare const GotoViewportMessage: z.ZodObject<{
|
|
|
974
1321
|
};
|
|
975
1322
|
type: "setViewport";
|
|
976
1323
|
}>;
|
|
1324
|
+
declare const GetViewportConstraintsMessage: z.ZodObject<{
|
|
1325
|
+
type: z.ZodLiteral<"getViewportConstraints">;
|
|
1326
|
+
params: z.ZodUndefined;
|
|
1327
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1328
|
+
type: "getViewportConstraints";
|
|
1329
|
+
params?: undefined;
|
|
1330
|
+
}, {
|
|
1331
|
+
type: "getViewportConstraints";
|
|
1332
|
+
params?: undefined;
|
|
1333
|
+
}>;
|
|
1334
|
+
declare const SetViewportConstraintsMessage: z.ZodObject<{
|
|
1335
|
+
type: z.ZodLiteral<"setViewportConstraints">;
|
|
1336
|
+
params: z.ZodNullable<z.ZodObject<{
|
|
1337
|
+
minZoom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1338
|
+
maxZoom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1339
|
+
bounds: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>>;
|
|
1340
|
+
}, "strip", z.ZodTypeAny, {
|
|
1341
|
+
minZoom?: number | null | undefined;
|
|
1342
|
+
maxZoom?: number | null | undefined;
|
|
1343
|
+
bounds?: [number, number, number, number] | null | undefined;
|
|
1344
|
+
}, {
|
|
1345
|
+
minZoom?: number | null | undefined;
|
|
1346
|
+
maxZoom?: number | null | undefined;
|
|
1347
|
+
bounds?: [number, number, number, number] | null | undefined;
|
|
1348
|
+
}>>;
|
|
1349
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1350
|
+
params: {
|
|
1351
|
+
minZoom?: number | null | undefined;
|
|
1352
|
+
maxZoom?: number | null | undefined;
|
|
1353
|
+
bounds?: [number, number, number, number] | null | undefined;
|
|
1354
|
+
} | null;
|
|
1355
|
+
type: "setViewportConstraints";
|
|
1356
|
+
}, {
|
|
1357
|
+
params: {
|
|
1358
|
+
minZoom?: number | null | undefined;
|
|
1359
|
+
maxZoom?: number | null | undefined;
|
|
1360
|
+
bounds?: [number, number, number, number] | null | undefined;
|
|
1361
|
+
} | null;
|
|
1362
|
+
type: "setViewportConstraints";
|
|
1363
|
+
}>;
|
|
977
1364
|
declare const ViewportFitBoundsMessage: z.ZodObject<{
|
|
978
1365
|
type: z.ZodLiteral<"fitViewportToBounds">;
|
|
979
1366
|
params: z.ZodObject<{
|
|
@@ -998,6 +1385,8 @@ type ViewportSchema = {
|
|
|
998
1385
|
methods: {
|
|
999
1386
|
getViewport: Method<zInfer<typeof GetViewportMessage>, ViewportState>;
|
|
1000
1387
|
setViewport: Method<zInfer<typeof GotoViewportMessage>, void>;
|
|
1388
|
+
getViewportConstraints: Method<zInfer<typeof GetViewportConstraintsMessage>, ViewportConstraints | null>;
|
|
1389
|
+
setViewportConstraints: Method<zInfer<typeof SetViewportConstraintsMessage>, void>;
|
|
1001
1390
|
fitViewportToBounds: Method<zInfer<typeof ViewportFitBoundsMessage>, void>;
|
|
1002
1391
|
};
|
|
1003
1392
|
listeners: {
|
|
@@ -1007,7 +1396,7 @@ type ViewportSchema = {
|
|
|
1007
1396
|
};
|
|
1008
1397
|
};
|
|
1009
1398
|
|
|
1010
|
-
type AllModules = UiSchema | ViewportSchema | LayersSchema | ElementsSchema | SelectionSchema | InteractionsSchema;
|
|
1399
|
+
type AllModules = UiSchema | ViewportSchema | LayersSchema | ElementsSchema | SelectionSchema | InteractionsSchema | ToolsSchema;
|
|
1011
1400
|
|
|
1012
1401
|
type FeltHandlers = {
|
|
1013
1402
|
methods: FeltMethodHandlers;
|
|
@@ -1015,16 +1404,21 @@ type FeltHandlers = {
|
|
|
1015
1404
|
};
|
|
1016
1405
|
type MethodSpec = UnionToIntersection<AllModules["methods"]>;
|
|
1017
1406
|
type ListenerSpec = UnionToIntersection<AllModules["listeners"]>;
|
|
1018
|
-
type ExtractMethodParams<T extends Record<string, {
|
|
1407
|
+
type ExtractMethodParams<T extends Record<string, AnyFunction | {
|
|
1019
1408
|
request: {
|
|
1020
1409
|
params?: any;
|
|
1021
1410
|
};
|
|
1022
1411
|
response: any;
|
|
1023
1412
|
}>> = {
|
|
1024
|
-
[K in keyof T]: {
|
|
1413
|
+
[K in keyof T]: T[K] extends {
|
|
1414
|
+
request: {
|
|
1415
|
+
params?: any;
|
|
1416
|
+
};
|
|
1417
|
+
response: any;
|
|
1418
|
+
} ? {
|
|
1025
1419
|
request: T[K]["request"]["params"];
|
|
1026
1420
|
response: T[K]["response"];
|
|
1027
|
-
};
|
|
1421
|
+
} : T[K];
|
|
1028
1422
|
};
|
|
1029
1423
|
type ExtractListenerParams<T extends Record<string, {
|
|
1030
1424
|
options: any;
|
|
@@ -1035,8 +1429,9 @@ type ExtractListenerParams<T extends Record<string, {
|
|
|
1035
1429
|
eventParams: T[K]["eventParams"];
|
|
1036
1430
|
};
|
|
1037
1431
|
};
|
|
1432
|
+
type AnyFunction = (...args: any[]) => any;
|
|
1038
1433
|
type MethodHandlers<T> = {
|
|
1039
|
-
[K in keyof T]: (request: T[K] extends {
|
|
1434
|
+
[K in keyof T]: T[K] extends AnyFunction ? T[K] : (request: T[K] extends {
|
|
1040
1435
|
request: any;
|
|
1041
1436
|
} ? T[K]["request"] : never) => PromiseOrNot<T[K] extends {
|
|
1042
1437
|
response: any;
|
package/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var Se=(o,s)=>{for(var h in s)v(o,h,{get:s[h],enumerable:!0})},be=(o,s,h,L)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of fe(s))!he.call(o,u)&&u!==h&&v(o,u,{get:()=>s[u],enumerable:!(L=ue(s,u))||L.enumerable});return o};var Me=o=>be(v({},"__esModule",{value:!0}),o);var Ot={};Se(Ot,{createMessageHandler:()=>Ft});module.exports=Me(Ot);var l=require("zod");var f=require("zod");var g=require("zod");function t(o,s){return g.z.strictObject({type:g.z.literal(o),params:s})}function S(o,s){return g.z.strictObject({eventName:g.z.literal(o),id:g.z.string(),options:s})}function m(o){return g.z.strictObject({eventName:g.z.literal(o),id:g.z.string()})}var c=require("zod"),V=c.z.number(),P=c.z.number(),z=c.z.object({latitude:P,longitude:V}),Z=c.z.number().min(1).max(23),I=c.z.tuple([V,P,V,P]),b=c.z.object({show:c.z.array(c.z.string()).optional(),hide:c.z.array(c.z.string()).optional()});var M=require("zod"),U=M.z.object({ids:M.z.array(M.z.string()).optional()}),B=M.z.object({ids:M.z.array(M.z.string()).optional()});var Le=t("getElement",f.z.string()),xe=t("getElementGeometry",f.z.string()),Ge=t("getElements",U.optional()),Ie=t("getElementGroup",f.z.string()),Te=t("getElementGroups",B.optional()),Ce=t("setElementGroupVisibility",b),ze=S("onElementChange",f.z.object({id:f.z.string()})),Fe=S("onElementGroupChange",f.z.object({id:f.z.string()})),A={methods:[Le,xe,Ge,Ie,Te,Ce],listeners:[ze,Fe]};var Ee=m("onPointerClick"),we=m("onPointerMove"),q={methods:null,listeners:[Ee,we]};var i=require("zod");var n=require("zod"),ve=n.z.enum(["in","ni"]),Ve=n.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),_t=n.z.enum(["and","or"]),H=n.z.union([n.z.number(),n.z.string(),n.z.boolean(),n.z.null()]),W=n.z.string().or(n.z.null()),Pe=n.z.tuple([W,ve,n.z.array(H).or(n.z.null())]),ke=n.z.tuple([W,Ve,H]),k=n.z.union([Pe,ke]),O=n.z.tuple([n.z.lazy(()=>n.z.union([O,k,n.z.null(),n.z.boolean()])),n.z.enum(["and","or"]),n.z.lazy(()=>n.z.union([O,k,n.z.null(),n.z.boolean()]))]),K=n.z.union([O,k,n.z.null(),n.z.boolean()]);var r=require("zod");var $t=r.z.enum(["processing","completed","failed","incomplete"]),_=r.z.object({ids:r.z.array(r.z.string()).optional()}),Q=r.z.object({ids:r.z.array(r.z.string()).optional()}),x=r.z.object({id:r.z.string(),layerId:r.z.string()}),D=r.z.object({ids:x.array().optional(),layerIds:r.z.string().array().optional()}),$=r.z.object({layerIds:r.z.array(r.z.string()).optional(),areaQuery:r.z.union([r.z.object({coordinates:z}),r.z.object({boundary:I})]).optional()});var Oe=t("getLayer",i.z.string()),je=t("getLayers",_.optional()),Ne=t("setLayerVisibility",b),Re=S("onLayerChange",i.z.object({id:i.z.string()})),Ze=t("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),Ue=t("setLayerLegendVisibility",b),Be=t("getLayerGroup",i.z.string()),Ae=t("getLayerGroups",Q.optional()),qe=t("setLayerGroupVisibility",b),He=t("setLayerGroupLegendVisibility",b),We=S("onLayerGroupChange",i.z.object({id:i.z.string()})),Ke=t("getLegendItem",x),_e=t("getLegendItems",D.optional()),Qe=S("onLegendItemChange",x),De=t("setLegendItemVisibility",i.z.object({show:x.array().optional(),hide:x.array().optional()})),$e=t("getLayerFilters",i.z.string()),Je=t("setLayerFilters",i.z.object({layerId:i.z.string(),filters:K,note:i.z.string().optional()})),Xe=t("getRenderedFeatures",$.optional()),J={methods:[Oe,je,Ne,Ze,Ue,Be,Ae,qe,He,Ke,_e,De,$e,Je,Xe],listeners:[Re,We,Qe]};var T=require("zod");var d=require("zod"),X=d.z.object({id:d.z.string().or(d.z.number()),layerId:d.z.string(),showPopup:d.z.boolean().optional(),fitViewport:d.z.boolean().or(d.z.object({maxZoom:d.z.number()})).optional()});var Ye=t("getSelection",T.z.undefined()),et=m("onSelectionChange"),tt=t("selectFeature",X),ot=t("clearSelection",T.z.object({features:T.z.boolean().optional(),elements:T.z.boolean().optional()}).optional()),Y={methods:[Ye,tt,ot],listeners:[et]};var re=require("zod");var e=require("zod"),ee=["pin","line","route","polygon","circle","marker","highlighter","text","note"],te=e.z.enum([...ee,"link"]),oe=e.z.enum(ee),nt=e.z.object({color:e.z.string(),symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable()}),rt=e.z.object({color:e.z.string(),strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"]),distanceMarker:e.z.boolean()}),st=e.z.object({color:e.z.string(),routingMode:e.z.enum(["driving","cycling","walking","flying"]),strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"]),distanceMarker:e.z.boolean(),endCaps:e.z.boolean()}),it=e.z.object({color:e.z.string(),fillOpacity:e.z.number().min(0).max(1),strokeOpacity:e.z.number().min(0).max(1),strokeWidth:e.z.number().min(0),strokeStyle:e.z.enum(["solid","dashed","dotted"]),areaMarker:e.z.boolean()}),at=e.z.object({color:e.z.string(),fillOpacity:e.z.number().min(0).max(1),strokeOpacity:e.z.number().min(0).max(1),strokeWidth:e.z.number().min(0),strokeStyle:e.z.enum(["solid","dashed","dotted"]),radiusMarker:e.z.boolean()}),lt=e.z.object({color:e.z.string(),opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100)}),pt=e.z.object({color:e.z.string(),opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(200)}),mt=e.z.object({color:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"])}),ct=e.z.object({color:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"])}),ne=e.z.discriminatedUnion("tool",[nt.partial().extend({tool:e.z.literal("pin")}),rt.partial().extend({tool:e.z.literal("line")}),st.partial().extend({tool:e.z.literal("route")}),it.partial().extend({tool:e.z.literal("polygon")}),at.partial().extend({tool:e.z.literal("circle")}),lt.partial().extend({tool:e.z.literal("marker")}),pt.partial().extend({tool:e.z.literal("highlighter")}),mt.partial().extend({tool:e.z.literal("text")}),ct.partial().extend({tool:e.z.literal("note")})]);var yt=t("setTool",te.nullable()),gt=t("getTool",re.z.undefined()),dt=m("onToolChange"),ut=t("setToolSettings",ne),ft=t("getToolSettings",oe),ht=m("onToolSettingsChange"),se={methods:[yt,gt,ut,ft],listeners:[dt,ht]};var a=require("zod"),ie=a.z.object({showLegend:a.z.boolean().optional(),cooperativeGestures:a.z.boolean().optional(),fullScreenButton:a.z.boolean().optional(),geolocation:a.z.boolean().optional(),zoomControls:a.z.boolean().optional(),scaleBar:a.z.boolean().optional()}),ae=a.z.object({featureSelectPanel:a.z.boolean().optional(),featureHoverPanel:a.z.boolean().optional(),elementSelectPanel:a.z.boolean().optional(),linkClickOpen:a.z.boolean().optional(),imageLightboxOpen:a.z.boolean().optional()});var St=t("updateUiControls",ie),bt=t("setOnMapInteractionsUi",ae),le={methods:[St,bt],listeners:null};var j=require("zod");var C=require("zod");var F=C.z.object({center:z,zoom:Z}),pe=C.z.object({center:F.shape.center.optional(),zoom:F.shape.zoom.optional()}),me=C.z.object({minZoom:F.shape.zoom.nullish(),maxZoom:F.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),ce=C.z.object({bounds:I});var Mt=t("getViewport",j.z.undefined()),Lt=t("setViewport",pe),xt=t("getViewportConstraints",j.z.undefined()),Gt=t("setViewportConstraints",me),It=t("fitViewportToBounds",ce),Tt=m("onViewportMove"),Ct=m("onViewportMoveEnd"),zt=m("onMapIdle"),ye={methods:[Lt,Mt,xt,Gt,It],listeners:[Tt,Ct,zt]};var N=[le,ye,J,A,Y,q,se];function Ft(o,s,h){let L=new Map;async function u(y){if(!kt.safeParse(y.data).success){h?.onUnknownMessage?.(y.data);return}let R=de.safeParse(y.data);if(!R.success){h?.onInvalidMessage?.(y.data);return}let{data:p}=R;if(p.type==="felt.ready")y.ports[0]?.postMessage(!0);else if(p.type==="felt.addListener"){if(p.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let G="options"in p.event?{options:"options"in p.event?p.event.options:void 0,handler:w=>{y.ports[0]?.postMessage(w)}}:{handler:w=>{y.ports[0]?.postMessage(w)}},E=s.listeners[p.event.eventName](G);L.set(p.event.id,E)}else if(p.type==="felt.removeListener")L.get(p.id)?.(),L.delete(p.id);else try{let G=s.methods[p.type],E=await G(p.params);y.ports[0]?.postMessage(E)}catch(G){y.ports[0]?.postMessage({__error__:Et(G)})}}return o.addEventListener("message",u),()=>{o.removeEventListener("message",u)}}function Et(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}var ge={methods:N.map(o=>o.methods??[]).flat(),listeners:N.map(o=>o.listeners??[]).flat()},wt=l.z.discriminatedUnion("eventName",[l.z.strictObject({eventName:l.z.literal("")}),...ge.listeners]),vt=l.z.strictObject({type:l.z.literal("felt.addListener"),event:wt}),Vt=l.z.strictObject({type:l.z.literal("felt.removeListener"),id:l.z.string()}),Pt=l.z.strictObject({type:l.z.literal("felt.ready")}),de=l.z.discriminatedUnion("type",[Pt,vt,Vt,...ge.methods]),kt=l.z.object({type:l.z.enum(de.options.map(o=>o.shape.type.value))});0&&(module.exports={createMessageHandler});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feltmaps/js-sdk",
|
|
3
|
-
"version": "1.5.0-next.
|
|
3
|
+
"version": "1.5.0-next.2",
|
|
4
4
|
"description": "An SDK for Felt maps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"felt",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"prettier": "^3.3.3",
|
|
46
46
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
47
47
|
"tsup": "^8.3.0",
|
|
48
|
-
"typedoc": "^0.
|
|
49
|
-
"typedoc-plugin-markdown": "^4.
|
|
50
|
-
"typedoc-plugin-remark": "^1.
|
|
51
|
-
"typedoc-plugin-zod": "^1.
|
|
48
|
+
"typedoc": "^0.27.6",
|
|
49
|
+
"typedoc-plugin-markdown": "^4.4.1",
|
|
50
|
+
"typedoc-plugin-remark": "^1.2.4",
|
|
51
|
+
"typedoc-plugin-zod": "^1.3.1",
|
|
52
52
|
"typescript": "^5.6.2",
|
|
53
53
|
"vite-tsconfig-paths": "^5.0.1",
|
|
54
54
|
"vitest": "^2.1.2",
|