Skip to content

Commit

Permalink
docs: add @since tag
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz committed May 22, 2022
1 parent b7e1e6e commit 03a7809
Show file tree
Hide file tree
Showing 12 changed files with 693 additions and 179 deletions.
64 changes: 40 additions & 24 deletions packages/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ Sets the user ID property.
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#setuseridoptions">SetUserIdOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -156,6 +158,8 @@ Sets a custom user property to a given value.
| ------------- | ------------------------------------------------------------------------- |
| **`options`** | <code><a href="#setuserpropertyoptions">SetUserPropertyOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -171,6 +175,8 @@ Sets the current screen name.
| ------------- | --------------------------------------------------------------------------- |
| **`options`** | <code><a href="#setcurrentscreenoptions">SetCurrentScreenOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -186,6 +192,8 @@ Logs an app event.
| ------------- | ----------------------------------------------------------- |
| **`options`** | <code><a href="#logeventoptions">LogEventOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -203,6 +211,8 @@ Only available for Android and iOS.
| ------------- | --------------------------------------------------------------------------------------------- |
| **`options`** | <code><a href="#setsessiontimeoutdurationoptions">SetSessionTimeoutDurationOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -219,6 +229,8 @@ The value does not apply until the next run of the app.
| ------------- | --------------------------------------------------------------- |
| **`options`** | <code><a href="#setenabledoptions">SetEnabledOptions</a></code> |

**Since:** 0.1.0

--------------------


Expand All @@ -234,6 +246,8 @@ Only available for Web.

**Returns:** <code>Promise&lt;<a href="#isenabledresult">IsEnabledResult</a>&gt;</code>

**Since:** 0.1.0

--------------------


Expand All @@ -248,6 +262,8 @@ Resets the app instance id.

Only available for Android and iOS.

**Since:** 0.1.0

--------------------


Expand All @@ -256,54 +272,54 @@ Only available for Android and iOS.

#### SetUserIdOptions

| Prop | Type |
| ------------ | --------------------------- |
| **`userId`** | <code>string \| null</code> |
| Prop | Type | Since |
| ------------ | --------------------------- | ----- |
| **`userId`** | <code>string \| null</code> | 0.1.0 |


#### SetUserPropertyOptions

| Prop | Type |
| ----------- | --------------------------- |
| **`key`** | <code>string</code> |
| **`value`** | <code>string \| null</code> |
| Prop | Type | Since |
| ----------- | --------------------------- | ----- |
| **`key`** | <code>string</code> | 0.1.0 |
| **`value`** | <code>string \| null</code> | 0.1.0 |


#### SetCurrentScreenOptions

| Prop | Type | Description |
| ------------------------- | --------------------------- | --------------------------------------------------- |
| **`screenName`** | <code>string \| null</code> | |
| **`screenClassOverride`** | <code>string \| null</code> | Only available for Android and iOS. Default: `null` |
| Prop | Type | Description | Default | Since |
| ------------------------- | --------------------------- | ----------------------------------- | ----------------- | ----- |
| **`screenName`** | <code>string \| null</code> | | | 0.1.0 |
| **`screenClassOverride`** | <code>string \| null</code> | Only available for Android and iOS. | <code>null</code> | 0.1.0 |


#### LogEventOptions

| Prop | Type | Description |
| ------------ | ------------------------------------ | -------------------------- |
| **`name`** | <code>string</code> | The event name. |
| **`params`** | <code>{ [key: string]: any; }</code> | The optional event params. |
| Prop | Type | Description | Since |
| ------------ | ------------------------------------ | -------------------------- | ----- |
| **`name`** | <code>string</code> | The event name. | 0.1.0 |
| **`params`** | <code>{ [key: string]: any; }</code> | The optional event params. | 0.1.0 |


#### SetSessionTimeoutDurationOptions

| Prop | Type | Description |
| -------------- | ------------------- | ------------------------------------------------- |
| **`duration`** | <code>number</code> | Duration in seconds. Default: `1800` (30 minutes) |
| Prop | Type | Description | Default | Since |
| -------------- | ------------------- | -------------------- | ----------------- | ----- |
| **`duration`** | <code>number</code> | Duration in seconds. | <code>1800</code> | 0.1.0 |


#### SetEnabledOptions

| Prop | Type |
| ------------- | -------------------- |
| **`enabled`** | <code>boolean</code> |
| Prop | Type | Since |
| ------------- | -------------------- | ----- |
| **`enabled`** | <code>boolean</code> | 0.1.0 |


#### IsEnabledResult

| Prop | Type |
| ------------- | -------------------- |
| **`enabled`** | <code>boolean</code> |
| Prop | Type | Since |
| ------------- | -------------------- | ----- |
| **`enabled`** | <code>boolean</code> | 0.1.0 |

</docgen-api>

Expand Down
65 changes: 63 additions & 2 deletions packages/analytics/src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,91 +1,152 @@
export interface FirebaseAnalyticsPlugin {
/**
* Sets the user ID property.
*
* @since 0.1.0
*/
setUserId(options: SetUserIdOptions): Promise<void>;
/**
* Sets a custom user property to a given value.
*
* @since 0.1.0
*/
setUserProperty(options: SetUserPropertyOptions): Promise<void>;
/**
* Sets the current screen name.
*
* @since 0.1.0
*/
setCurrentScreen(options: SetCurrentScreenOptions): Promise<void>;
/**
* Logs an app event.
*
* @since 0.1.0
*/
logEvent(options: LogEventOptions): Promise<void>;
/**
* Sets the duration of inactivity that terminates the current session.
*
* Only available for Android and iOS.
*
* @since 0.1.0
*/
setSessionTimeoutDuration(
options: SetSessionTimeoutDurationOptions,
): Promise<void>;
/**
* Enables/disables automatic data collection.
* The value does not apply until the next run of the app.
*
* @since 0.1.0
*/
setEnabled(options: SetEnabledOptions): Promise<void>;
/**
* Returns whether or not automatic data collection is enabled.
*
* Only available for Web.
*
* @since 0.1.0
*/
isEnabled(): Promise<IsEnabledResult>;
/**
* Clears all analytics data for this app from the device.
* Resets the app instance id.
*
* Only available for Android and iOS.
*
* @since 0.1.0
*/
resetAnalyticsData(): Promise<void>;
}

/**
* @since 0.1.0
*/
export interface SetUserIdOptions {
/**
* @since 0.1.0
*/
userId: string | null;
}

/**
* @since 0.1.0
*/
export interface SetUserPropertyOptions {
/**
* @since 0.1.0
*/
key: string;
/**
* @since 0.1.0
*/
value: string | null;
}

/**
* @since 0.1.0
*/
export interface SetCurrentScreenOptions {
/**
* @since 0.1.0
*/
screenName: string | null;
/**
* Only available for Android and iOS.
*
* Default: `null`
* @default null
* @since 0.1.0
*/
screenClassOverride?: string | null;
}

/**
* @since 0.1.0
*/
export interface LogEventOptions {
/**
* The event name.
*
* @since 0.1.0
*/
name: string;
/**
* The optional event params.
*
* @since 0.1.0
*/
params?: { [key: string]: any };
}

/**
* @since 0.1.0
*/
export interface SetSessionTimeoutDurationOptions {
/**
* Duration in seconds.
*
* Default: `1800` (30 minutes)
* @default 1800
* @since 0.1.0
*/
duration: number;
}

/**
* @since 0.1.0
*/
export interface SetEnabledOptions {
/**
* @since 0.1.0
*/
enabled: boolean;
}

/**
* @since 0.1.0
*/
export interface IsEnabledResult {
/**
* @since 0.1.0
*/
enabled: boolean;
}
26 changes: 15 additions & 11 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Get the name for this app.

**Returns:** <code>Promise&lt;<a href="#getnameresult">GetNameResult</a>&gt;</code>

**Since:** 0.1.0

--------------------


Expand All @@ -69,6 +71,8 @@ Get the configuration options for this app.

**Returns:** <code>Promise&lt;<a href="#getoptionsresult">GetOptionsResult</a>&gt;</code>

**Since:** 0.1.0

--------------------


Expand All @@ -77,21 +81,21 @@ Get the configuration options for this app.

#### GetNameResult

| Prop | Type | Description |
| ---------- | ------------------- | ---------------------------- |
| **`name`** | <code>string</code> | The unique name of this app. |
| Prop | Type | Description | Since |
| ---------- | ------------------- | ---------------------------- | ----- |
| **`name`** | <code>string</code> | The unique name of this app. | 0.1.0 |


#### GetOptionsResult

| Prop | Type | Description |
| ------------------- | ------------------- | -------------------------------------------------------------- |
| **`apiKey`** | <code>string</code> | API key used for authenticating requests from your app. |
| **`applicationId`** | <code>string</code> | Google App ID used to uniquely identify an instance of an app. |
| **`databaseUrl`** | <code>string</code> | The database root URL. |
| **`gcmSenderId`** | <code>string</code> | The Project Number. |
| **`projectId`** | <code>string</code> | The Google Cloud project ID. |
| **`storageBucket`** | <code>string</code> | The Google Cloud Storage bucket name. |
| Prop | Type | Description | Since |
| ------------------- | ------------------- | -------------------------------------------------------------- | ----- |
| **`apiKey`** | <code>string</code> | API key used for authenticating requests from your app. | 0.1.0 |
| **`applicationId`** | <code>string</code> | Google App ID used to uniquely identify an instance of an app. | 0.1.0 |
| **`databaseUrl`** | <code>string</code> | The database root URL. | 0.1.0 |
| **`gcmSenderId`** | <code>string</code> | The Project Number. | 0.1.0 |
| **`projectId`** | <code>string</code> | The Google Cloud project ID. | 0.1.0 |
| **`storageBucket`** | <code>string</code> | The Google Cloud Storage bucket name. | 0.1.0 |

</docgen-api>

Expand Down
Loading

0 comments on commit 03a7809

Please sign in to comment.