@javascriptcommon/react-native-carplay 2.3.11 → 2.4.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/android/build.gradle +110 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +20 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/AndroidManifest.xml +30 -0
- package/android/src/main/AndroidManifestNew.xml +30 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayModule.kt +321 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayPackage.kt +18 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayService.kt +35 -0
- package/android/src/main/java/org/birkir/carplay/CarPlaySession.kt +126 -0
- package/android/src/main/java/org/birkir/carplay/parser/Ext.kt +11 -0
- package/android/src/main/java/org/birkir/carplay/parser/Parser.kt +18 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTGridTemplate.kt +28 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTListTemplate.kt +64 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTMapTemplate.kt +128 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTMessageTemplate.kt +28 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTPaneTemplate.kt +24 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTSearchTemplate.kt +41 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTTabTemplate.kt +157 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTTemplate.kt +419 -0
- package/android/src/main/java/org/birkir/carplay/parser/TemplateParser.kt +35 -0
- package/android/src/main/java/org/birkir/carplay/screens/CarScreen.kt +76 -0
- package/android/src/main/java/org/birkir/carplay/screens/CarScreenContext.kt +10 -0
- package/android/src/main/java/org/birkir/carplay/utils/EventEmitter.kt +167 -0
- package/android/src/main/java/org/birkir/carplay/utils/VirtualRenderer.kt +75 -0
- package/ios/RCTConvert+RNCarPlay.h +7 -8
- package/ios/RCTConvert+RNCarPlay.m +4 -3
- package/ios/RNCarPlay.h +11 -14
- package/ios/RNCarPlay.m +749 -945
- package/ios/RNCarPlayViewController.h +10 -0
- package/ios/RNCarPlayViewController.m +50 -0
- package/lib/CarPlay.d.ts +183 -0
- package/lib/CarPlay.d.ts.map +1 -0
- package/lib/index.d.ts +44 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/interfaces/Action.d.ts +13 -0
- package/lib/interfaces/Action.d.ts.map +1 -0
- package/lib/interfaces/AlertAction.d.ts +6 -0
- package/lib/interfaces/AlertAction.d.ts.map +1 -0
- package/lib/interfaces/BarButton.d.ts +39 -0
- package/lib/interfaces/BarButton.d.ts.map +1 -0
- package/lib/interfaces/CarColor.d.ts +2 -0
- package/lib/interfaces/CarColor.d.ts.map +1 -0
- package/lib/interfaces/GridButton.d.ts +24 -0
- package/lib/interfaces/GridButton.d.ts.map +1 -0
- package/lib/interfaces/Header.d.ts +15 -0
- package/lib/interfaces/Header.d.ts.map +1 -0
- package/lib/interfaces/ListItem.d.ts +90 -0
- package/lib/interfaces/ListItem.d.ts.map +1 -0
- package/lib/interfaces/ListItemUpdate.d.ts +15 -0
- package/lib/interfaces/ListItemUpdate.d.ts.map +1 -0
- package/lib/interfaces/ListSection.d.ts +21 -0
- package/lib/interfaces/ListSection.d.ts.map +1 -0
- package/lib/interfaces/Maneuver.d.ts +31 -0
- package/lib/interfaces/Maneuver.d.ts.map +1 -0
- package/lib/interfaces/MapButton.d.ts +27 -0
- package/lib/interfaces/MapButton.d.ts.map +1 -0
- package/lib/interfaces/NavigationAlert.d.ts +44 -0
- package/lib/interfaces/NavigationAlert.d.ts.map +1 -0
- package/lib/interfaces/NavigationInfo.d.ts +17 -0
- package/lib/interfaces/NavigationInfo.d.ts.map +1 -0
- package/lib/interfaces/NavigationStep.d.ts +17 -0
- package/lib/interfaces/NavigationStep.d.ts.map +1 -0
- package/lib/interfaces/Pane.d.ts +29 -0
- package/lib/interfaces/Pane.d.ts.map +1 -0
- package/lib/interfaces/PauseReason.d.ts +8 -0
- package/lib/interfaces/PauseReason.d.ts.map +1 -0
- package/lib/interfaces/Place.d.ts +11 -0
- package/lib/interfaces/Place.d.ts.map +1 -0
- package/lib/interfaces/TextConfiguration.d.ts +6 -0
- package/lib/interfaces/TextConfiguration.d.ts.map +1 -0
- package/lib/interfaces/TimeRemainingColor.d.ts +2 -0
- package/lib/interfaces/TimeRemainingColor.d.ts.map +1 -0
- package/lib/interfaces/TravelEstimates.d.ts +37 -0
- package/lib/interfaces/TravelEstimates.d.ts.map +1 -0
- package/lib/interfaces/VoiceControlState.d.ts +8 -0
- package/lib/interfaces/VoiceControlState.d.ts.map +1 -0
- package/lib/navigation/NavigationSession.d.ts +18 -0
- package/lib/navigation/NavigationSession.d.ts.map +1 -0
- package/lib/navigation/Trip.d.ts +22 -0
- package/lib/navigation/Trip.d.ts.map +1 -0
- package/lib/templates/ActionSheetTemplate.d.ts +18 -0
- package/lib/templates/ActionSheetTemplate.d.ts.map +1 -0
- package/lib/templates/AlertTemplate.d.ts +17 -0
- package/lib/templates/AlertTemplate.d.ts.map +1 -0
- package/lib/templates/ContactTemplate.d.ts +36 -0
- package/lib/templates/ContactTemplate.d.ts.map +1 -0
- package/lib/templates/GridTemplate.d.ts +38 -0
- package/lib/templates/GridTemplate.d.ts.map +1 -0
- package/lib/templates/InformationTemplate.d.ts +28 -0
- package/lib/templates/InformationTemplate.d.ts.map +1 -0
- package/lib/templates/ListTemplate.d.ts +127 -0
- package/lib/templates/ListTemplate.d.ts.map +1 -0
- package/lib/templates/ListTemplate.js +24 -16
- package/lib/templates/MapTemplate.d.ts +171 -0
- package/lib/templates/MapTemplate.d.ts.map +1 -0
- package/lib/templates/NowPlayingTemplate.d.ts +31 -0
- package/lib/templates/NowPlayingTemplate.d.ts.map +1 -0
- package/lib/templates/PointOfInterestTemplate.d.ts +33 -0
- package/lib/templates/PointOfInterestTemplate.d.ts.map +1 -0
- package/lib/templates/SearchTemplate.d.ts +32 -0
- package/lib/templates/SearchTemplate.d.ts.map +1 -0
- package/lib/templates/SearchTemplate.js +2 -2
- package/lib/templates/TabBarTemplate.d.ts +27 -0
- package/lib/templates/TabBarTemplate.d.ts.map +1 -0
- package/lib/templates/Template.d.ts +82 -0
- package/lib/templates/Template.d.ts.map +1 -0
- package/lib/templates/Template.js +1 -1
- package/lib/templates/VoiceControlTemplate.d.ts +18 -0
- package/lib/templates/VoiceControlTemplate.d.ts.map +1 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.d.ts +19 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.d.ts.map +1 -0
- package/lib/templates/android/MessageTemplate.d.ts +16 -0
- package/lib/templates/android/MessageTemplate.d.ts.map +1 -0
- package/lib/templates/android/NavigationTemplate.d.ts +44 -0
- package/lib/templates/android/NavigationTemplate.d.ts.map +1 -0
- package/lib/templates/android/PaneTemplate.d.ts +13 -0
- package/lib/templates/android/PaneTemplate.d.ts.map +1 -0
- package/lib/templates/android/PlaceListMapTemplate.d.ts +58 -0
- package/lib/templates/android/PlaceListMapTemplate.d.ts.map +1 -0
- package/lib/templates/android/PlaceListNavigationTemplate.d.ts +51 -0
- package/lib/templates/android/PlaceListNavigationTemplate.d.ts.map +1 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.d.ts +60 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.d.ts.map +1 -0
- package/package.json +3 -3
- package/react-native-carplay.podspec +3 -3
- package/src/CarPlay.ts +28 -16
- package/src/interfaces/ListItem.ts +14 -8
- package/src/interfaces/ListSection.ts +1 -1
- package/src/templates/ListTemplate.ts +64 -44
- package/src/templates/NowPlayingTemplate.ts +10 -3
- package/src/templates/SearchTemplate.ts +2 -2
- package/src/templates/Template.ts +1 -1
- package/README.md +0 -633
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ListTemplate = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
4
5
|
const CarPlay_1 = require("../CarPlay");
|
|
5
6
|
const Template_1 = require("./Template");
|
|
6
7
|
/**
|
|
@@ -25,43 +26,50 @@ class ListTemplate extends Template_1.Template {
|
|
|
25
26
|
constructor(config) {
|
|
26
27
|
super(config);
|
|
27
28
|
this.config = config;
|
|
28
|
-
CarPlay_1.CarPlay.emitter.addListener('didSelectListItem', e => {
|
|
29
|
+
CarPlay_1.CarPlay.emitter.addListener('didSelectListItem', (e) => {
|
|
29
30
|
if (config.onItemSelect && e.templateId === this.id) {
|
|
30
31
|
void Promise.resolve(config.onItemSelect(e)).then(() => {
|
|
31
|
-
|
|
32
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
33
|
+
CarPlay_1.CarPlay.bridge.reactToSelectedResult(true);
|
|
34
|
+
}
|
|
32
35
|
});
|
|
33
36
|
}
|
|
34
37
|
});
|
|
35
|
-
CarPlay_1.CarPlay.emitter.addListener('
|
|
36
|
-
if (config.
|
|
37
|
-
void Promise.resolve(config.
|
|
38
|
-
|
|
38
|
+
CarPlay_1.CarPlay.emitter.addListener('didSelectListItemRowImage', (e) => {
|
|
39
|
+
if (config.onImageRowItemSelect && e.templateId === this.id) {
|
|
40
|
+
void Promise.resolve(config.onImageRowItemSelect(e)).then(() => {
|
|
41
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
42
|
+
CarPlay_1.CarPlay.bridge.reactToSelectedResult(true);
|
|
43
|
+
}
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
});
|
|
42
|
-
CarPlay_1.CarPlay.emitter.addListener('templateLoaded', e => {
|
|
43
|
-
if (config.onTemplateLoaded && e.templateId === this.id) {
|
|
44
|
-
void Promise.resolve(config.onTemplateLoaded());
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
47
|
}
|
|
48
48
|
updateSections = (sections) => {
|
|
49
|
+
this.config.sections = sections;
|
|
49
50
|
return CarPlay_1.CarPlay.bridge.updateListTemplateSections(this.id, this.parseConfig(sections));
|
|
50
51
|
};
|
|
51
52
|
updateListTemplateItem = (config) => {
|
|
53
|
+
const section = this.config.sections?.[config.sectionIndex];
|
|
54
|
+
if (section) {
|
|
55
|
+
section.items[config.itemIndex] = config;
|
|
56
|
+
}
|
|
52
57
|
return CarPlay_1.CarPlay.bridge.updateListTemplateItem(this.id, this.parseConfig(config));
|
|
53
58
|
};
|
|
54
|
-
updateListTemplateRowItems = (config) => {
|
|
55
|
-
return CarPlay_1.CarPlay.bridge.updateListTemplateRowItems(this.id, this.parseConfig(config));
|
|
56
|
-
};
|
|
57
59
|
getMaximumListItemCount() {
|
|
58
60
|
return CarPlay_1.CarPlay.bridge.getMaximumListItemCount(this.id);
|
|
59
61
|
}
|
|
60
62
|
getMaximumListSectionCount() {
|
|
61
63
|
return CarPlay_1.CarPlay.bridge.getMaximumListSectionCount(this.id);
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
return CarPlay_1.CarPlay.bridge.
|
|
65
|
+
getMaximumListItemImageSize() {
|
|
66
|
+
return CarPlay_1.CarPlay.bridge.getMaximumListItemImageSize(this.id);
|
|
67
|
+
}
|
|
68
|
+
getMaximumNumberOfGridImages() {
|
|
69
|
+
return CarPlay_1.CarPlay.bridge.getMaximumNumberOfGridImages(this.id);
|
|
70
|
+
}
|
|
71
|
+
getMaximumListImageRowItemImageSize() {
|
|
72
|
+
return CarPlay_1.CarPlay.bridge.getMaximumListImageRowItemImageSize(this.id);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
exports.ListTemplate = ListTemplate;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { MapButton } from '../interfaces/MapButton';
|
|
2
|
+
import { NavigationAlert } from '../interfaces/NavigationAlert';
|
|
3
|
+
import { TextConfiguration } from '../interfaces/TextConfiguration';
|
|
4
|
+
import { TimeRemainingColor } from '../interfaces/TimeRemainingColor';
|
|
5
|
+
import { TravelEstimates } from '../interfaces/TravelEstimates';
|
|
6
|
+
import { NavigationSession } from '../navigation/NavigationSession';
|
|
7
|
+
import { Trip } from '../navigation/Trip';
|
|
8
|
+
import { Template, TemplateConfig } from './Template';
|
|
9
|
+
import { ListItem } from '../interfaces/ListItem';
|
|
10
|
+
import { Action } from '../interfaces/Action';
|
|
11
|
+
import { Header } from '../interfaces/Header';
|
|
12
|
+
import { Pane } from '../interfaces/Pane';
|
|
13
|
+
export interface MapTemplateConfig extends TemplateConfig {
|
|
14
|
+
/**
|
|
15
|
+
* The background color the map template uses when displaying guidance.
|
|
16
|
+
* @namespace iOS
|
|
17
|
+
*/
|
|
18
|
+
guidanceBackgroundColor?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The style that the map template uses when displaying trip estimates during active nagivation.
|
|
21
|
+
* @default dark
|
|
22
|
+
* @namespace iOS
|
|
23
|
+
*/
|
|
24
|
+
tripEstimateStyle?: 'dark' | 'light';
|
|
25
|
+
/**
|
|
26
|
+
* Your component to render inside CarPlay/Android Auto
|
|
27
|
+
* Example `component: MyComponent`
|
|
28
|
+
*/
|
|
29
|
+
component: React.ComponentType<any>;
|
|
30
|
+
/**
|
|
31
|
+
* An array of map buttons displayed on the trailing bottom corner of the map template.
|
|
32
|
+
* If the array contains more than three buttons, the map template displays only the first three buttons, ignoring the remaining buttons.
|
|
33
|
+
* @namespace iOS
|
|
34
|
+
* @namespace Android
|
|
35
|
+
*/
|
|
36
|
+
mapButtons?: MapButton[];
|
|
37
|
+
/**
|
|
38
|
+
* A Boolean value that indicates whether the navigation bar hides automatically.
|
|
39
|
+
* @namespace iOS
|
|
40
|
+
*/
|
|
41
|
+
automaticallyHidesNavigationBar?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A Boolean value that tells the system to hide the map buttons when hiding the navigation bar.
|
|
44
|
+
* @namespace iOS
|
|
45
|
+
*/
|
|
46
|
+
hidesButtonsWithNavigationBar?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A component that holds onto data associated with a template's header.
|
|
49
|
+
* @namespace Android
|
|
50
|
+
*/
|
|
51
|
+
header?: Header;
|
|
52
|
+
/**
|
|
53
|
+
* Sets an ItemList to show in a list view along with the map.
|
|
54
|
+
* - To show a marker corresponding to a point of interest represented by a row, set the Place instance via setMetadata. The host will display the PlaceMarker in both the map and the list view as the row becomes visible.
|
|
55
|
+
* - Images of type IMAGE_TYPE_LARGE are not allowed in this template.
|
|
56
|
+
* - Rows are not allowed to have both an image and a place marker.
|
|
57
|
+
* @limit The number of items in the ItemList should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PLACE_LIST. The host will ignore any items over that limit. The list itself cannot be selectable as set via setOnSelectedListener. Each Row can add up to 2 lines of texts via addText and cannot contain a Toggle.
|
|
58
|
+
* @namespace Android
|
|
59
|
+
*/
|
|
60
|
+
items?: ListItem[];
|
|
61
|
+
/**
|
|
62
|
+
* Sets the ActionStrip for this template.
|
|
63
|
+
* Unless set with this method, the template will not have an action strip.
|
|
64
|
+
* The Action buttons in Map Based Template are automatically adjusted based on the screen size. On narrow width screen, icon Actions show by default. If no icon specify, showing title Actions instead. On wider width screen, title Actions show by default. If no title specify, showing icon Actions instead.
|
|
65
|
+
* @limit This template allows up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, it can either be a title Action as set via setTitle, or a icon Action as set via setIcon.
|
|
66
|
+
* @namespace Android
|
|
67
|
+
*/
|
|
68
|
+
actions?: Action[];
|
|
69
|
+
/**
|
|
70
|
+
* Sets the Pane for this template. getImage for pane will not be shown in MapTemplate.
|
|
71
|
+
* Unless set with this method, the template will not show a pane.
|
|
72
|
+
* @limit The number of items in the Pane should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PANE. The host via addText and cannot contain either a Toggle or a OnClickListener.
|
|
73
|
+
* Up to 2 Actions are allowed in the Pane. Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported.
|
|
74
|
+
* If none of the header Action, the header title or the action strip have been set on the template, the header is hidden.
|
|
75
|
+
*/
|
|
76
|
+
pane?: Pane;
|
|
77
|
+
/**
|
|
78
|
+
* Fired when Alert Action button is pressed
|
|
79
|
+
* @param e Event
|
|
80
|
+
*/
|
|
81
|
+
onAlertActionPressed?(e: {
|
|
82
|
+
secondary?: boolean;
|
|
83
|
+
primary?: boolean;
|
|
84
|
+
}): void;
|
|
85
|
+
onMapButtonPressed?(e: {
|
|
86
|
+
id: string;
|
|
87
|
+
template: string;
|
|
88
|
+
}): void;
|
|
89
|
+
onPanWithDirection?(e: {
|
|
90
|
+
direction: string;
|
|
91
|
+
}): void;
|
|
92
|
+
onPanBeganWithDirection?(e: {
|
|
93
|
+
direction: string;
|
|
94
|
+
}): void;
|
|
95
|
+
onPanEndedWithDirection?(e: {
|
|
96
|
+
direction: string;
|
|
97
|
+
}): void;
|
|
98
|
+
onSelectedPreviewForTrip?(e: {
|
|
99
|
+
tripId: string;
|
|
100
|
+
routeIndex: number;
|
|
101
|
+
}): void;
|
|
102
|
+
onDidCancelNavigation?(): void;
|
|
103
|
+
onStartedTrip?(e: {
|
|
104
|
+
tripId: string;
|
|
105
|
+
routeIndex: number;
|
|
106
|
+
}): void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The Map Template is a control layer that appears as an overlay over the base view and allows you to present user controls.
|
|
110
|
+
*
|
|
111
|
+
* The control layer consists of a navigation bar and map buttons. By default, the navigation bar appears when the user interacts with the app, and disappears after a period of inactivity.
|
|
112
|
+
*
|
|
113
|
+
* The navigation bar includes up to two leading buttons and two trailing buttons. You can customize the appearance of these buttons with icons or text.
|
|
114
|
+
*
|
|
115
|
+
* The control layer may also include up to four map buttons. The map buttons are always shown as icons.
|
|
116
|
+
*
|
|
117
|
+
* Navigation apps enter panning mode, zoom in or out, and perform other functions by responding to user actions on these buttons.
|
|
118
|
+
*/
|
|
119
|
+
export declare class MapTemplate extends Template<MapTemplateConfig> {
|
|
120
|
+
config: MapTemplateConfig;
|
|
121
|
+
get type(): string;
|
|
122
|
+
get eventMap(): {
|
|
123
|
+
alertActionPressed: string;
|
|
124
|
+
mapButtonPressed: string;
|
|
125
|
+
panWithDirection: string;
|
|
126
|
+
panBeganWithDirection: string;
|
|
127
|
+
panEndedWithDirection: string;
|
|
128
|
+
selectedPreviewForTrip: string;
|
|
129
|
+
didCancelNavigation: string;
|
|
130
|
+
startedTrip: string;
|
|
131
|
+
};
|
|
132
|
+
constructor(config: MapTemplateConfig);
|
|
133
|
+
/**
|
|
134
|
+
* Begins guidance for a trip.
|
|
135
|
+
*
|
|
136
|
+
* Keep a reference to the navigation session to perform guidance updates.
|
|
137
|
+
* @param trip Trip class instance
|
|
138
|
+
*/
|
|
139
|
+
startNavigationSession(trip: Trip): Promise<NavigationSession>;
|
|
140
|
+
updateTravelEstimates(trip: Trip, travelEstimates: TravelEstimates, timeRemainingColor?: TimeRemainingColor): void;
|
|
141
|
+
/**
|
|
142
|
+
* Update MapTemplate configuration
|
|
143
|
+
*/
|
|
144
|
+
updateConfig(config: MapTemplateConfig): void;
|
|
145
|
+
updateMapButtons(mapButtons: MapButton[]): void;
|
|
146
|
+
/**
|
|
147
|
+
* Hides the display of trip previews.
|
|
148
|
+
*/
|
|
149
|
+
hideTripPreviews(): void;
|
|
150
|
+
showTripPreviews(tripPreviews: Trip[], textConfiguration?: TextConfiguration): void;
|
|
151
|
+
showRouteChoicesPreviewForTrip(trip: Trip, textConfiguration?: TextConfiguration): void;
|
|
152
|
+
presentNavigationAlert(config: NavigationAlert, animated?: boolean): void;
|
|
153
|
+
dismissNavigationAlert(animated?: boolean): void;
|
|
154
|
+
/**
|
|
155
|
+
* Shows the panning interface over the map.
|
|
156
|
+
*
|
|
157
|
+
* Calling this method while displaying the panning interface has no effect.
|
|
158
|
+
*
|
|
159
|
+
* While showing the panning interface, the system hides all map buttons. The system doesn't provide a button to dismiss the panning interface. Instead, you must provide a map button in the navigation bar that the user taps to dismiss the panning interface.
|
|
160
|
+
* @param animated A Boolean value that determines whether to animate the panning interface.
|
|
161
|
+
*/
|
|
162
|
+
showPanningInterface(animated?: boolean): void;
|
|
163
|
+
/**
|
|
164
|
+
* Dismisses the panning interface.
|
|
165
|
+
*
|
|
166
|
+
* When dismissing the panning interface, the system shows the previously hidden map buttons.
|
|
167
|
+
* @param animated A Boolean value that determines whether to animate the dismissal of the panning interface.
|
|
168
|
+
*/
|
|
169
|
+
dismissPanningInterface(animated?: boolean): void;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=MapTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/MapTemplate.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { Template, TemplateConfig } from './Template';
|
|
3
|
+
export type NowPlayingButton = {
|
|
4
|
+
id: string;
|
|
5
|
+
} & ({
|
|
6
|
+
type: 'shuffle' | 'add-to-library' | 'more' | 'playback' | 'repeat';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'image';
|
|
9
|
+
image: ImageSourcePropType;
|
|
10
|
+
});
|
|
11
|
+
export interface NowPlayingTemplateConfig extends TemplateConfig {
|
|
12
|
+
albumArtistButtonEnabled?: boolean;
|
|
13
|
+
upNextButtonTitle?: string;
|
|
14
|
+
upNextButtonEnabled?: boolean;
|
|
15
|
+
onAlbumArtistButtonPressed?(): void;
|
|
16
|
+
onUpNextButtonPressed?(): void;
|
|
17
|
+
onButtonPressed?(e: {
|
|
18
|
+
id: string;
|
|
19
|
+
templateId: string;
|
|
20
|
+
}): void;
|
|
21
|
+
buttons?: NowPlayingButton[];
|
|
22
|
+
}
|
|
23
|
+
export declare class NowPlayingTemplate extends Template<NowPlayingTemplateConfig> {
|
|
24
|
+
get type(): string;
|
|
25
|
+
get eventMap(): {
|
|
26
|
+
albumArtistButtonPressed: string;
|
|
27
|
+
upNextButtonPressed: string;
|
|
28
|
+
buttonPressed: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=NowPlayingTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowPlayingTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/NowPlayingTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,CACA;IACE,IAAI,EAAE,SAAS,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;CACrE,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,mBAAmB,CAAC;CAC5B,CACJ,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0BAA0B,CAAC,IAAI,IAAI,CAAC;IACpC,qBAAqB,CAAC,IAAI,IAAI,CAAC;IAC/B,eAAe,CAAC,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,wBAAwB,CAAC;IACxE,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;;;MAMX;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Template, TemplateConfig } from './Template';
|
|
2
|
+
export interface PointOfInterestItem {
|
|
3
|
+
id: string;
|
|
4
|
+
location: {
|
|
5
|
+
latitude: number;
|
|
6
|
+
longitude: number;
|
|
7
|
+
};
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
summary?: string;
|
|
11
|
+
detailTitle?: string;
|
|
12
|
+
detailSubtitle?: string;
|
|
13
|
+
detailSummary?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PointOfInterestTemplateConfig extends TemplateConfig {
|
|
16
|
+
title: string;
|
|
17
|
+
items: PointOfInterestItem[];
|
|
18
|
+
onPointOfInterestSelect?(e: PointOfInterestItem): void;
|
|
19
|
+
onChangeMapRegion(e: {
|
|
20
|
+
latitude: number;
|
|
21
|
+
longitude: number;
|
|
22
|
+
latitudeDelta: number;
|
|
23
|
+
longitudeDelta: number;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class PointOfInterestTemplate extends Template<PointOfInterestTemplateConfig> {
|
|
27
|
+
get type(): string;
|
|
28
|
+
get eventMap(): {
|
|
29
|
+
didSelectPointOfInterest: string;
|
|
30
|
+
didChangeMapRegion: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=PointOfInterestTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointOfInterestTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/PointOfInterestTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,6BAA8B,SAAQ,cAAc;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvD,iBAAiB,CAAC,CAAC,EAAE;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI,CAAC;CACV;AAED,qBAAa,uBAAwB,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IAClF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;;MAKX;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ListItem } from '../interfaces/ListItem';
|
|
2
|
+
import { BaseEvent, Template, TemplateConfig } from './Template';
|
|
3
|
+
export interface SearchTemplateConfig extends TemplateConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Fired when search input is changed.
|
|
6
|
+
* Must return list of items to show.
|
|
7
|
+
* @param query Search query
|
|
8
|
+
*/
|
|
9
|
+
onSearch?(query: string): Promise<ListItem[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Fired when result item is selected.
|
|
12
|
+
* Spinner shows by default.
|
|
13
|
+
* When the returned promise is resolved the spinner will hide.
|
|
14
|
+
* @param item Object with the selected index
|
|
15
|
+
*/
|
|
16
|
+
onItemSelect?(item: {
|
|
17
|
+
index: number;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Fired when search button is pressed
|
|
21
|
+
*/
|
|
22
|
+
onSearchButtonPressed?(e: BaseEvent): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class SearchTemplate extends Template<SearchTemplateConfig> {
|
|
25
|
+
config: SearchTemplateConfig;
|
|
26
|
+
get type(): string;
|
|
27
|
+
get eventMap(): {
|
|
28
|
+
searchButtonPressed: string;
|
|
29
|
+
};
|
|
30
|
+
constructor(config: SearchTemplateConfig);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=SearchTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/SearchTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;;OAIG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;OAEG;IACH,qBAAqB,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAC5C;AAED,qBAAa,cAAe,SAAQ,QAAQ,CAAC,oBAAoB,CAAC;IAW7C,MAAM,EAAE,oBAAoB;IAV/C,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;MAIX;gBAEkB,MAAM,EAAE,oBAAoB;CAiChD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchTemplate = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
4
5
|
const CarPlay_1 = require("../CarPlay");
|
|
5
6
|
const Template_1 = require("./Template");
|
|
6
|
-
const react_native_1 = require("react-native");
|
|
7
7
|
class SearchTemplate extends Template_1.Template {
|
|
8
8
|
config;
|
|
9
9
|
get type() {
|
|
@@ -26,7 +26,7 @@ class SearchTemplate extends Template_1.Template {
|
|
|
26
26
|
...item,
|
|
27
27
|
image: item.image ? react_native_1.Image.resolveAssetSource(item.image) : undefined,
|
|
28
28
|
}));
|
|
29
|
-
CarPlay_1.CarPlay.bridge.reactToUpdatedSearchText(parsedResults);
|
|
29
|
+
CarPlay_1.CarPlay.bridge.reactToUpdatedSearchText(e.templateId, parsedResults);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GridTemplate } from './GridTemplate';
|
|
2
|
+
import { InformationTemplate } from './InformationTemplate';
|
|
3
|
+
import { ListTemplate } from './ListTemplate';
|
|
4
|
+
import { PointOfInterestTemplate } from './PointOfInterestTemplate';
|
|
5
|
+
import { Template, TemplateConfig } from './Template';
|
|
6
|
+
export type TabBarTemplates = ListTemplate | GridTemplate | InformationTemplate | PointOfInterestTemplate;
|
|
7
|
+
export interface TabBarTemplateConfig extends TemplateConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The title displayed in the navigation bar while the tab bar template is visible.
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The templates to show as tabs.
|
|
14
|
+
*/
|
|
15
|
+
templates: TabBarTemplates[];
|
|
16
|
+
onTemplateSelect(template: TabBarTemplates | undefined, e: {
|
|
17
|
+
templateId: string;
|
|
18
|
+
selectedTemplateId: string;
|
|
19
|
+
}): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class TabBarTemplate extends Template<TabBarTemplateConfig> {
|
|
22
|
+
config: TabBarTemplateConfig;
|
|
23
|
+
get type(): string;
|
|
24
|
+
constructor(config: TabBarTemplateConfig);
|
|
25
|
+
updateTemplates: (config: TabBarTemplateConfig) => void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=TabBarTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBarTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/TabBarTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,YAAY,GACZ,mBAAmB,GACnB,uBAAuB,CAAC;AAE5B,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,eAAe,EAAE,CAAC;IAE7B,gBAAgB,CACd,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,GACpD,IAAI,CAAC;CACT;AAGD,qBAAa,cAAe,SAAQ,QAAQ,CAAC,oBAAoB,CAAC;IAK7C,MAAM,EAAE,oBAAoB;IAJ/C,IAAW,IAAI,IAAI,MAAM,CAExB;gBAEkB,MAAM,EAAE,oBAAoB;IAgBxC,eAAe,WAAY,oBAAoB,UAGpD;CACH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { BarButton } from '../interfaces/BarButton';
|
|
3
|
+
export interface BaseEvent {
|
|
4
|
+
/**
|
|
5
|
+
* Template id that fired the event
|
|
6
|
+
*/
|
|
7
|
+
templateId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BarButtonEvent extends BaseEvent {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TemplateConfig {
|
|
13
|
+
/**
|
|
14
|
+
* Give the template your own ID. Must be unique.
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* An array of bar buttons to display on the leading side of the navigation bar.
|
|
19
|
+
*
|
|
20
|
+
* The navigation bar displays up to two buttons in the leading space. When including more than two buttons in the array, the system displays only the first two buttons.
|
|
21
|
+
* @namespace iOS
|
|
22
|
+
*/
|
|
23
|
+
leadingNavigationBarButtons?: BarButton[];
|
|
24
|
+
/**
|
|
25
|
+
* An array of bar buttons to display on the trailing side of the navigation bar.
|
|
26
|
+
*
|
|
27
|
+
* The navigation bar displays up to two buttons in the trailing space. When including more than two buttons in the array, the system displays only the first two buttons.
|
|
28
|
+
* @namespace iOS
|
|
29
|
+
*/
|
|
30
|
+
trailingNavigationBarButtons?: BarButton[];
|
|
31
|
+
/**
|
|
32
|
+
* UITabBarSystemItem
|
|
33
|
+
*/
|
|
34
|
+
tabSystemItem?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Name of system image for tab
|
|
37
|
+
*/
|
|
38
|
+
tabSystemImageName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Image source for tab
|
|
41
|
+
*/
|
|
42
|
+
tabImage?: ImageSourcePropType;
|
|
43
|
+
/**
|
|
44
|
+
* Set tab title
|
|
45
|
+
*/
|
|
46
|
+
tabTitle?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Fired before template appears
|
|
49
|
+
* @param e Event
|
|
50
|
+
*/
|
|
51
|
+
onWillAppear?(e: BaseEvent): void;
|
|
52
|
+
/**
|
|
53
|
+
* Fired before template disappears
|
|
54
|
+
* @param e Event
|
|
55
|
+
*/
|
|
56
|
+
onWillDisappear?(e: BaseEvent): void;
|
|
57
|
+
/**
|
|
58
|
+
* Fired after template appears
|
|
59
|
+
* @param e Event
|
|
60
|
+
*/
|
|
61
|
+
onDidAppear?(e: BaseEvent): void;
|
|
62
|
+
/**
|
|
63
|
+
* Fired after template disappears
|
|
64
|
+
* @param e Event
|
|
65
|
+
*/
|
|
66
|
+
onDidDisappear?(e: BaseEvent): void;
|
|
67
|
+
/**
|
|
68
|
+
* Fired when bar button is pressed
|
|
69
|
+
* @param e Event
|
|
70
|
+
*/
|
|
71
|
+
onBarButtonPressed?(e: BarButtonEvent): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class Template<P> {
|
|
74
|
+
config: TemplateConfig & P;
|
|
75
|
+
get type(): string;
|
|
76
|
+
id: string;
|
|
77
|
+
get eventMap(): {};
|
|
78
|
+
constructor(config: TemplateConfig & P);
|
|
79
|
+
updateTemplate: (config: P) => void;
|
|
80
|
+
parseConfig(config: any): any;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=Template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Template.d.ts","sourceRoot":"","sources":["../../src/templates/Template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,SAAS,EAAE,CAAC;IAC1C;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,eAAe,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAEpC;;;OAGG;IACH,kBAAkB,CAAC,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9C;AAED,qBAAa,QAAQ,CAAC,CAAC;IAUF,MAAM,EAAE,cAAc,GAAG,CAAC;IAT7C,IAAW,IAAI,IAAI,MAAM,CAExB;IACM,EAAE,EAAG,MAAM,CAAC;IAEnB,IAAW,QAAQ,OAElB;gBAEkB,MAAM,EAAE,cAAc,GAAG,CAAC;IAiD7C,cAAc,WAAY,CAAC,UAGzB;IAGK,WAAW,CAAC,MAAM,EAAE,GAAG;CAiB/B"}
|
|
@@ -4,7 +4,7 @@ exports.Template = void 0;
|
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
5
|
const CarPlay_1 = require("../CarPlay");
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
-
const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource');
|
|
7
|
+
const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource').default;
|
|
8
8
|
class Template {
|
|
9
9
|
config;
|
|
10
10
|
get type() {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VoiceControlState } from '../interfaces/VoiceControlState';
|
|
2
|
+
import { Template } from './Template';
|
|
3
|
+
export interface VoiceControlTemplateConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The array of voice control states that can be used by your voice control template.
|
|
6
|
+
*/
|
|
7
|
+
voiceControlStates: VoiceControlState[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Displays a voice control indicator on the CarPlay screen.
|
|
11
|
+
*
|
|
12
|
+
* CarPlay navigation apps must show the voice control template during audio input.
|
|
13
|
+
*/
|
|
14
|
+
export declare class VoiceControlTemplate extends Template<VoiceControlTemplateConfig> {
|
|
15
|
+
get type(): string;
|
|
16
|
+
activateVoiceControlState(identifier: string): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=VoiceControlTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceControlTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/VoiceControlTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ,CAAC,0BAA0B,CAAC;IAC5E,IAAW,IAAI,IAAI,MAAM,CAExB;IAEM,yBAAyB,CAAC,UAAU,EAAE,MAAM;CAGpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Template, TemplateConfig } from '../Template';
|
|
2
|
+
export interface AndroidNavigationBaseTemplateConfig extends TemplateConfig {
|
|
3
|
+
/**
|
|
4
|
+
* Your component to render inside Android Auto Map view
|
|
5
|
+
* Example `component: MyComponent`
|
|
6
|
+
*/
|
|
7
|
+
component: React.ComponentType<any>;
|
|
8
|
+
onDidShowPanningInterface?(): void;
|
|
9
|
+
onDidDismissPanningInterface?(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class AndroidNavigationBaseTemplate<T extends AndroidNavigationBaseTemplateConfig> extends Template<T> {
|
|
12
|
+
config: T;
|
|
13
|
+
get eventMap(): {
|
|
14
|
+
didShowPanningInterface: string;
|
|
15
|
+
didDismissPanningInterface: string;
|
|
16
|
+
};
|
|
17
|
+
constructor(config: T);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=AndroidNavigationBaseTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AndroidNavigationBaseTemplate.d.ts","sourceRoot":"","sources":["../../../src/templates/android/AndroidNavigationBaseTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,WAAW,mCAAoC,SAAQ,cAAc;IACzE;;;OAGG;IAEH,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEpC,yBAAyB,CAAC,IAAI,IAAI,CAAC;IACnC,4BAA4B,CAAC,IAAI,IAAI,CAAC;CACvC;AAED,qBAAa,6BAA6B,CACxC,CAAC,SAAS,mCAAmC,CAC7C,SAAQ,QAAQ,CAAC,CAAC,CAAC;IAQA,MAAM,EAAE,CAAC;IAP5B,IAAI,QAAQ;;;MAKX;gBAEkB,MAAM,EAAE,CAAC;CAmB7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action, HeaderAction } from '../../interfaces/Action';
|
|
2
|
+
import { Template, TemplateConfig } from '../Template';
|
|
3
|
+
import { ImageSourcePropType } from 'react-native';
|
|
4
|
+
export interface MessageTemplateConfig extends TemplateConfig {
|
|
5
|
+
message?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
headerAction?: HeaderAction;
|
|
8
|
+
actions?: Action[];
|
|
9
|
+
icon?: ImageSourcePropType;
|
|
10
|
+
title?: string;
|
|
11
|
+
debugMessage?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class MessageTemplate extends Template<MessageTemplateConfig> {
|
|
14
|
+
get type(): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=MessageTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageTemplate.d.ts","sourceRoot":"","sources":["../../../src/templates/android/MessageTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,qBAAqB,CAAC;IAClE,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Action } from '../../interfaces/Action';
|
|
2
|
+
import { CarColor } from '../../interfaces/CarColor';
|
|
3
|
+
import { NavigationInfo } from '../../interfaces/NavigationInfo';
|
|
4
|
+
import { TravelEstimates } from '../../interfaces/TravelEstimates';
|
|
5
|
+
import { AndroidNavigationBaseTemplate, AndroidNavigationBaseTemplateConfig } from './AndroidNavigationBaseTemplate';
|
|
6
|
+
export interface NavigationTemplateConfig extends AndroidNavigationBaseTemplateConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Sets an ActionStrip with a list of template-scoped actions for this template.
|
|
9
|
+
* The Action buttons in Map Based Template are automatically adjusted based on the screen size. On narrow width screen, icon Actions show by default. If no icon specify, showing title Actions instead. On wider width screen, title Actions show by default. If no title specify, showing icon Actions instead.
|
|
10
|
+
* Requirements This template allows up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, it can either be a title Action as set via setTitle, or a icon Action as set via setIcon.
|
|
11
|
+
*/
|
|
12
|
+
actions: Action[];
|
|
13
|
+
/**
|
|
14
|
+
* Sets the background color to use for the navigation information.
|
|
15
|
+
* Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.
|
|
16
|
+
*/
|
|
17
|
+
backgroundColor?: CarColor;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the TravelEstimate to the final destination.
|
|
20
|
+
*/
|
|
21
|
+
travelEstimate?: TravelEstimates;
|
|
22
|
+
/**
|
|
23
|
+
* Sets an ActionStrip with a list of map-control related actions for this template, such as pan or zoom.
|
|
24
|
+
* The host will draw the buttons in an area that is associated with map controls.
|
|
25
|
+
* If the app does not include the PAN button in this ActionStrip, the app will not receive the user input for panning gestures from SurfaceCallback methods, and the host will exit any previously activated pan mode.
|
|
26
|
+
* Requirements This template allows up to 4 Actions in its map ActionStrip. Only Actions with icons set via setIcon are allowed.
|
|
27
|
+
*/
|
|
28
|
+
mapButtons?: Action[];
|
|
29
|
+
/**
|
|
30
|
+
* Sets the navigation information to display on the template.
|
|
31
|
+
* Unless set with this method, navigation info won't be displayed on the template.
|
|
32
|
+
*/
|
|
33
|
+
navigationInfo?: NavigationInfo;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A template for showing navigation information.
|
|
37
|
+
* This template has two independent sections which can be updated:
|
|
38
|
+
* - Navigation information such as routing instructions or navigation-related messages.
|
|
39
|
+
* - Travel estimates to the destination.
|
|
40
|
+
*/
|
|
41
|
+
export declare class NavigationTemplate extends AndroidNavigationBaseTemplate<NavigationTemplateConfig> {
|
|
42
|
+
get type(): string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=NavigationTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationTemplate.d.ts","sourceRoot":"","sources":["../../../src/templates/android/NavigationTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EACL,6BAA6B,EAC7B,mCAAmC,EACpC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,wBAAyB,SAAQ,mCAAmC;IACnF;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,6BAA6B,CAAC,wBAAwB,CAAC;IAC7F,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action, HeaderAction } from '../../interfaces/Action';
|
|
2
|
+
import { Template, TemplateConfig } from '../Template';
|
|
3
|
+
import { Pane } from '../../interfaces/Pane';
|
|
4
|
+
export interface PaneTemplateConfig extends TemplateConfig {
|
|
5
|
+
pane: Pane;
|
|
6
|
+
headerAction?: HeaderAction;
|
|
7
|
+
actions?: Action[];
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class PaneTemplate extends Template<PaneTemplateConfig> {
|
|
11
|
+
get type(): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=PaneTemplate.d.ts.map
|