1
- import { NativeEventEmitter , NativeModules , Platform } from 'react-native' ;
1
+ import { NativeEventEmitter , NativeModule , NativeModules , Platform } from 'react-native' ;
2
2
import { ActionSheetTemplate } from './templates/ActionSheetTemplate' ;
3
3
import { AlertTemplate } from './templates/AlertTemplate' ;
4
4
import { ContactTemplate } from './templates/ContactTemplate' ;
@@ -11,8 +11,69 @@ import { SearchTemplate } from './templates/SearchTemplate';
11
11
import { TabBarTemplate } from './templates/TabBarTemplate' ;
12
12
import { VoiceControlTemplate } from './templates/VoiceControlTemplate' ;
13
13
import { NowPlayingTemplate } from './templates/NowPlayingTemplate' ;
14
+ import { Maneuver } from './interfaces/Maneuver' ;
15
+ import { TravelEstimates } from './interfaces/TravelEstimates' ;
16
+ import { PauseReason } from './interfaces/PauseReason' ;
17
+ import { TripConfig } from './navigation/Trip' ;
18
+ import { TimeRemainingColor } from './interfaces/TimeRemainingColor' ;
19
+ import { TextConfiguration } from './interfaces/TextConfiguration' ;
20
+
21
+ interface InternalCarPlay extends NativeModule {
22
+ checkForConnection ( ) : void ;
23
+ setRootTemplate ( templateId : string , animated : boolean ) : void ;
24
+ pushTemplate ( templateId : string , animated : boolean ) : void ;
25
+ popToTemplate ( templateId : string , animated : boolean ) : void ;
26
+ popToRootTemplate ( animated : boolean ) : void ;
27
+ popTemplate ( animated : boolean ) : void ;
28
+ presentTemplate ( templateId : string , animated : boolean ) : void ;
29
+ dismissTemplate ( animated : boolean ) : void ;
30
+ enableNowPlaying ( enabled : boolean ) : void ;
31
+ updateManeuversNavigationSession ( id : string , x : Maneuver [ ] ) : void ;
32
+ updateTravelEstimatesNavigationSession (
33
+ id : string ,
34
+ index : number ,
35
+ estimates : TravelEstimates ,
36
+ ) : void ;
37
+ cancelNavigationSession ( id : string ) : void ;
38
+ finishNavigationSession ( id : string ) : void ;
39
+ pauseNavigationSession ( id : string , reason : PauseReason , description ?: string ) : void ;
40
+ createTrip ( id : string , config : TripConfig ) : void ;
41
+ updateInformationTemplateItems ( id : string , config : unknown ) : void ;
42
+ updateInformationTemplateActions ( id : string , config : unknown ) : void ;
43
+ createTemplate ( id : string , config : unknown ) : void ;
44
+ startNavigationSession (
45
+ id : string ,
46
+ tripId : string ,
47
+ ) : Promise < {
48
+ tripId : string ;
49
+ navigationSessionId : string ;
50
+ } > ;
51
+ updateTravelEstimatesForTrip (
52
+ id : string ,
53
+ tripId : string ,
54
+ travelEstimates : TravelEstimates ,
55
+ timeRemainingColor : TimeRemainingColor ,
56
+ ) : void ;
57
+ updateMapTemplateConfig ( id : string , config : unknown ) : void ;
58
+ updateMapTemplateMapButtons ( id : string , config : unknown ) : void ;
59
+ hideTripPreviews ( id : string ) : void ;
60
+ showTripPreviews ( id : string , previews : string [ ] , config : TextConfiguration ) : void ;
61
+ showRouteChoicesPreviewForTrip ( id : string , tripId : string , config : TextConfiguration ) : void ;
62
+ presentNavigationAlert ( id : string , config : unknown , animated : boolean ) : void ;
63
+ dismissNavigationAlert ( id : string , animated : boolean ) : void ;
64
+ showPanningInterface ( id : string , animated : boolean ) : void ;
65
+ dismissPanningInterface ( id : string , animated : boolean ) : void ;
66
+ getMaximumListSectionCount ( id : string ) : Promise < number > ;
67
+ getMaximumListItemCount ( id : string ) : Promise < number > ;
68
+ reactToSelectedResult ( status : boolean ) : void ;
69
+ updateListTemplateSections ( id : string , config : unknown ) : void ;
70
+ updateListTemplateItem ( id : string , config : unknown ) : void ;
71
+ reactToUpdatedSearchText ( items : unknown ) : void ;
72
+ updateTabBarTemplates ( id : string , config : unknown ) : void ;
73
+ activateVoiceControlState ( id : string , identifier : string ) : void ;
74
+ }
14
75
15
- const { RNCarPlay } = NativeModules ;
76
+ const { RNCarPlay } = NativeModules as { RNCarPlay : InternalCarPlay } ;
16
77
17
78
type PushableTemplates =
18
79
| MapTemplate
0 commit comments