Skip to content

Commit 3352709

Browse files
committed
Fix RN API docs build
1 parent ca65906 commit 3352709

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
working-directory: ./trackers/react-native-tracker
8080
run: |
8181
api-extractor run
82-
api-documenter markdown --input-folder temp --output-folder ../../api-docs/docs/node-tracker/markdown
82+
api-documenter markdown --input-folder temp --output-folder ../../api-docs/docs/react-native-tracker/markdown
8383
8484
- name: Apply API documentation updates
8585
run: |

trackers/react-native-tracker/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export interface SessionConfiguration {
6161
sessionContext?: boolean;
6262
}
6363

64+
/**
65+
* A callback to be used for the `onMessage` prop of a `WebView` component.
66+
*/
67+
export type WebViewMessageHandler = (message: { nativeEvent: { data: string } }) => void;
68+
6469
/**
6570
* Configuration for app lifecycle tracking
6671
*/

trackers/react-native-tracker/src/web_view_interface.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type {
1010
TrackerCore,
1111
PayloadBuilder,
1212
Payload,
13+
WebViewMessageHandler,
1314
} from './types';
1415

1516
/**
@@ -115,8 +116,8 @@ function webViewPayloadBuilder(pb: PayloadBuilder): PayloadBuilder {
115116
*
116117
* @returns Callback to subscribe for events from Web views tracked using the Snowplow WebView tracker.
117118
*/
118-
export function getWebViewCallback() {
119-
return (message: { nativeEvent: { data: string } }): void => {
119+
export function getWebViewCallback(): WebViewMessageHandler {
120+
return (message) => {
120121
const data = JSON.parse(message.nativeEvent.data) as WebViewMessage;
121122
switch (data.command) {
122123
case 'trackSelfDescribingEvent':

0 commit comments

Comments
 (0)