@road-labs/map-sdk 0.0.28-rc.7 → 0.0.28-rc.9

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/types.d.ts CHANGED
@@ -12,6 +12,11 @@ export type FilterConfiguration = {
12
12
  showPaymentMethodFilter?: boolean;
13
13
  operators?: string[];
14
14
  showAnalytics?: boolean;
15
+ showPriceFilter?: boolean;
16
+ };
17
+ export type EnergyPrice = {
18
+ amount: number;
19
+ currency: string;
15
20
  };
16
21
  export type AnalyticsBucket = {
17
22
  name: string;
@@ -46,7 +51,8 @@ export type RoadMapOptions = {
46
51
  locationId?: string;
47
52
  locationBaseUrl?: string;
48
53
  locationUrlTemplate?: string;
49
- version?: "v1" | "v2";
54
+ version?: "v1" | "v2" | "v3";
55
+ currency?: string;
50
56
  authorization: string;
51
57
  language?: string;
52
58
  shadowRoot?: any;
@@ -105,6 +111,7 @@ export type GeohashItem = {
105
111
  count: number;
106
112
  }>;
107
113
  count: number;
114
+ energyPrice?: EnergyPrice;
108
115
  };
109
116
  export type OcpiPriceComponent = {
110
117
  type: "FLAT" | "TIME" | "ENERGY" | "PARKING_TIME" | "CONGESTION_TIME";
@@ -12,5 +12,6 @@ export declare const defaultFilter: {
12
12
  searchPhrase: string;
13
13
  excludeOperator: any[];
14
14
  authMethodCapabilities: any[];
15
+ maxEnergyPrice: any;
15
16
  };
16
17
  export declare function hasFilters(filter: any): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ import { EnergyPrice, GeohashItem, MapKind } from '../types';
2
+ export type PinTone = "available" | "inUse" | "offline" | "fault" | "planned" | "unknown";
3
+ export type PinGlyph = "bolt" | "ratio" | "dash" | "plus" | "alert";
4
+ export type PinColours = {
5
+ ring: string;
6
+ text: string;
7
+ };
8
+ export type PinSlice = {
9
+ tone: PinTone;
10
+ ring: string;
11
+ fraction: number;
12
+ };
13
+ export type PinState = {
14
+ tone: PinTone;
15
+ colours: PinColours;
16
+ glyph: PinGlyph;
17
+ free: number;
18
+ total: number;
19
+ split: PinSlice[];
20
+ };
21
+ export type UnitCounts = {
22
+ free: number;
23
+ busy: number;
24
+ fault: number;
25
+ planned: number;
26
+ unknown: number;
27
+ offline: number;
28
+ total: number;
29
+ };
30
+ export declare function countUnits(statuses?: Array<{
31
+ name: string;
32
+ count: number;
33
+ }>): UnitCounts;
34
+ export declare function pinTone(counts: UnitCounts, kind: MapKind, cluster: boolean): PinTone;
35
+ export declare function pinGlyph(counts: UnitCounts, tone: PinTone): PinGlyph;
36
+ export declare function pinColours(tone: PinTone, kind: MapKind): PinColours;
37
+ export declare function pinSplit(counts: UnitCounts, kind: MapKind): PinSlice[];
38
+ export declare function describePin(statuses: Array<{
39
+ name: string;
40
+ count: number;
41
+ }> | undefined, kind?: MapKind, cluster?: boolean): PinState;
42
+ export declare function isCluster(data: Pick<GeohashItem, "count" | "ids">): boolean;
43
+ export declare function pinPrice(data: GeohashItem): EnergyPrice | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { EnergyPrice } from '../types';
2
+ export declare function usablePrice(price?: EnergyPrice): price is EnergyPrice;
3
+ export declare function formatEnergyPrice(language: string, price?: EnergyPrice): string | undefined;
4
+ export type PriceTick = {
5
+ value: number | undefined;
6
+ label: string;
7
+ };
8
+ export declare function priceTicks(language: string, currency: string, anyLabel: string): PriceTick[];
@@ -0,0 +1 @@
1
+ export {};
@@ -14,6 +14,11 @@ export declare function buildSearchBody(limitToLocationIds: string[], props: Rec
14
14
  searchPhrase: any;
15
15
  excludeOperator: any;
16
16
  authMethodCapabilities: any;
17
+ currency: any;
18
+ maxEnergyPrice: {
19
+ amount: number;
20
+ currency: any;
21
+ };
17
22
  operator?: any[];
18
23
  locationIds: string[];
19
24
  };
@@ -1,9 +1,23 @@
1
1
  import { LabelsType } from '../i18n';
2
2
  import { MapKind } from '../types';
3
3
  export declare function normaliseStatus(status?: string): string;
4
- export declare function getStatusColor(status?: string, kind?: MapKind): string;
4
+ export type Palette = {
5
+ green: string;
6
+ blue: string;
7
+ red: string;
8
+ amber: string;
9
+ grey: string;
10
+ };
11
+ export declare const classicPalette: Palette;
12
+ export declare const modernPalette: Palette;
13
+ export declare function paletteFor(version?: string): Palette;
14
+ export declare const inSessionStatuses: Set<string>;
15
+ export type StatusTone = "available" | "inSession" | "fault" | "unavailable" | "unknown" | "offline";
16
+ export declare function statusTone(status?: string, kind?: MapKind): StatusTone;
17
+ export declare function toneColour(tone: StatusTone, kind?: MapKind, version?: string): string;
18
+ export declare function getStatusColor(status?: string, kind?: MapKind, version?: string): string;
5
19
  export declare function getStatusLabelKey(status?: string): keyof LabelsType;
6
20
  export declare function pickMarkerColor(statuses?: Array<{
7
21
  name: string;
8
22
  count: number;
9
- }>, kind?: MapKind): string;
23
+ }>, kind?: MapKind, version?: string): string;
@@ -6,7 +6,7 @@ export type StatusFilterOption = {
6
6
  values: string[];
7
7
  color: string;
8
8
  };
9
- export declare function getStatusFilterOptions(kind?: MapKind): StatusFilterOption[];
9
+ export declare function getStatusFilterOptions(kind?: MapKind, version?: string): StatusFilterOption[];
10
10
  export declare function toggleOption(action: "remove" | "add", existing: string[], values: string[]): string[];
11
11
  export declare function findStatusFilterOption(kind: MapKind | undefined, status: string): StatusFilterOption | undefined;
12
12
  export declare function isStatusFilterActive(kind: MapKind | undefined, selected: string[], status: string): boolean;
@@ -0,0 +1,3 @@
1
+ export type MapVersion = "v1" | "v2" | "v3";
2
+ export declare function versionRank(version?: string): number;
3
+ export declare function atLeast(version: string | undefined, min: MapVersion): boolean;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@road-labs/map-sdk",
3
- "version": "0.0.28-rc.7",
3
+ "version": "0.0.28-rc.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",