Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Nov 21, 2024
1 parent d7a4fc5 commit 5dd7058
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
| [PayloadBuilder](./react-native-tracker.payloadbuilder.md) | Interface for mutable object encapsulating tracker payload |
| [RuleSet](./react-native-tracker.ruleset.md) | A ruleset has accept or reject properties that contain rules for matching Iglu schema URIs |
| [SessionConfiguration](./react-native-tracker.sessionconfiguration.md) | Configuration for session tracking |
| [SessionState](./react-native-tracker.sessionstate.md) | Current session state that is tracked in events. |
| [StructuredEvent](./react-native-tracker.structuredevent.md) | A Structured Event A classic style of event tracking, allows for easier movement between analytics systems. A loosely typed event, creating a Self Describing event is preferred, but useful for interoperability. |
| [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md) | Configuration of subject properties tracked with events |
| [TrackerConfiguration](./react-native-tracker.trackerconfiguration.md) | The configuration object for initialising the tracker |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export declare type ReactNativeTracker = {
readonly setScreenViewport: (newView: ScreenSize) => void;
readonly setColorDepth: (newLang: number) => void;
readonly setSubjectData: (config: SubjectConfiguration) => void;
readonly getSessionUserId: () => Promise<string | undefined>;
readonly getSessionId: () => Promise<string | undefined>;
readonly getSessionIndex: () => Promise<number | undefined>;
readonly getSessionState: () => Promise<SessionState | undefined>;
};
```
<b>References:</b> [EventContext](./react-native-tracker.eventcontext.md)<!-- -->, [TimingProps](./react-native-tracker.timingprops.md)<!-- -->, [MessageNotificationProps](./react-native-tracker.messagenotificationprops.md)<!-- -->, [ScreenSize](./react-native-tracker.screensize.md)<!-- -->, [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md)
<b>References:</b> [EventContext](./react-native-tracker.eventcontext.md)<!-- -->, [TimingProps](./react-native-tracker.timingprops.md)<!-- -->, [MessageNotificationProps](./react-native-tracker.messagenotificationprops.md)<!-- -->, [ScreenSize](./react-native-tracker.screensize.md)<!-- -->, [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md)<!-- -->, [SessionState](./react-native-tracker.sessionstate.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [eventIndex](./react-native-tracker.sessionstate.eventindex.md)

## SessionState.eventIndex property

Optional index of the current event in the session

<b>Signature:</b>

```typescript
eventIndex?: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [firstEventId](./react-native-tracker.sessionstate.firsteventid.md)

## SessionState.firstEventId property

The optional identifier of the first event for this session

<b>Signature:</b>

```typescript
firstEventId?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [firstEventTimestamp](./react-native-tracker.sessionstate.firsteventtimestamp.md)

## SessionState.firstEventTimestamp property

Optional date-time timestamp of when the first event in the session was tracked

<b>Signature:</b>

```typescript
firstEventTimestamp?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md)

## SessionState interface

Current session state that is tracked in events.

<b>Signature:</b>

```typescript
export interface SessionState
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [eventIndex?](./react-native-tracker.sessionstate.eventindex.md) | number | <i>(Optional)</i> Optional index of the current event in the session |
| [firstEventId?](./react-native-tracker.sessionstate.firsteventid.md) | string | <i>(Optional)</i> The optional identifier of the first event for this session |
| [firstEventTimestamp?](./react-native-tracker.sessionstate.firsteventtimestamp.md) | string | <i>(Optional)</i> Optional date-time timestamp of when the first event in the session was tracked |
| [previousSessionId?](./react-native-tracker.sessionstate.previoussessionid.md) | string | <i>(Optional)</i> The previous session identifier for this user |
| [sessionId](./react-native-tracker.sessionstate.sessionid.md) | string | An identifier for the session |
| [sessionIndex](./react-native-tracker.sessionstate.sessionindex.md) | number | The index of the current session for this user |
| [storageMechanism](./react-native-tracker.sessionstate.storagemechanism.md) | string | The mechanism that the session information has been stored on the device |
| [userId](./react-native-tracker.sessionstate.userid.md) | string | An identifier for the user of the session |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [previousSessionId](./react-native-tracker.sessionstate.previoussessionid.md)

## SessionState.previousSessionId property

The previous session identifier for this user

<b>Signature:</b>

```typescript
previousSessionId?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [sessionId](./react-native-tracker.sessionstate.sessionid.md)

## SessionState.sessionId property

An identifier for the session

<b>Signature:</b>

```typescript
sessionId: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [sessionIndex](./react-native-tracker.sessionstate.sessionindex.md)

## SessionState.sessionIndex property

The index of the current session for this user

<b>Signature:</b>

```typescript
sessionIndex: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [storageMechanism](./react-native-tracker.sessionstate.storagemechanism.md)

## SessionState.storageMechanism property

The mechanism that the session information has been stored on the device

<b>Signature:</b>

```typescript
storageMechanism: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/react-native-tracker](./react-native-tracker.md) &gt; [SessionState](./react-native-tracker.sessionstate.md) &gt; [userId](./react-native-tracker.sessionstate.userid.md)

## SessionState.userId property

An identifier for the user of the session

<b>Signature:</b>

```typescript
userId: string;
```
16 changes: 16 additions & 0 deletions api-docs/docs/react-native-tracker/react-native-tracker.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ export type ReactNativeTracker = {
readonly setScreenViewport: (newView: ScreenSize) => void;
readonly setColorDepth: (newLang: number) => void;
readonly setSubjectData: (config: SubjectConfiguration) => void;
readonly getSessionUserId: () => Promise<string | undefined>;
readonly getSessionId: () => Promise<string | undefined>;
readonly getSessionIndex: () => Promise<number | undefined>;
readonly getSessionState: () => Promise<SessionState | undefined>;
};

// @public
Expand Down Expand Up @@ -366,6 +370,18 @@ export interface SessionConfiguration {
foregroundSessionTimeout?: number;
}

// @public
export interface SessionState {
eventIndex?: number;
firstEventId?: string;
firstEventTimestamp?: string;
previousSessionId?: string;
sessionId: string;
sessionIndex: number;
storageMechanism: string;
userId: string;
}

// @public
export interface StructuredEvent {
// (undocumented)
Expand Down
6 changes: 0 additions & 6 deletions trackers/react-native-tracker/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,22 +582,16 @@ export type ReactNativeTracker = {

/**
* Gets the identifier for the user of the session
*
* @returns {Promise<string | undefined>}
*/
readonly getSessionUserId: () => Promise<string | undefined>;

/**
* Gets the identifier for the session
*
* @returns {Promise<string | undefined>}
*/
readonly getSessionId: () => Promise<string | undefined>;

/**
* Gets the index of the current session for this user
*
* @returns {Promise<number | undefined>}
*/
readonly getSessionIndex: () => Promise<number | undefined>;

Expand Down

0 comments on commit 5dd7058

Please sign in to comment.