-
Notifications
You must be signed in to change notification settings - Fork 40
[SDK-143] improve-docs #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0216fab
2170979
bef8d54
8d973f0
885deaa
522392c
464a845
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Validate Documentation | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| merge_group: | ||
| types: | ||
| - checks_requested | ||
|
|
||
| jobs: | ||
| validate-docs: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Fetch full history for proper git info | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Validate documentation | ||
| run: yarn docs --validation --treatWarningsAsErrors --json /dev/null |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| // Expand all navigation folders on page load | ||
| (function () { | ||
| 'use strict'; | ||
|
|
||
| function expandAllNavigation() { | ||
| // Find all details elements in various navigation contexts | ||
| const selectors = [ | ||
| '.tsd-navigation details', | ||
| '#tsd-nav-container details', | ||
| '.site-menu details', | ||
| '.tsd-accordion', | ||
| 'nav details', | ||
| ]; | ||
|
|
||
| let foundAny = false; | ||
| selectors.forEach((selector) => { | ||
| const elements = document.querySelectorAll(selector); | ||
| if (elements.length > 0) { | ||
| foundAny = true; | ||
| elements.forEach((el) => { | ||
| if (el.tagName === 'DETAILS') { | ||
| el.open = true; | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| return foundAny; | ||
| } | ||
|
|
||
| // Strategy 1: Try immediately | ||
| expandAllNavigation(); | ||
|
|
||
| // Strategy 2: Hook into TypeDoc's app if available | ||
| let checkCount = 0; | ||
| const maxChecks = 50; // Check for up to 5 seconds | ||
|
|
||
| function checkAndExpand() { | ||
| checkCount++; | ||
|
|
||
| if (expandAllNavigation()) { | ||
| // Keep expanding even if found, in case more navigation loads | ||
| if (checkCount < maxChecks) { | ||
| setTimeout(checkAndExpand, 100); | ||
| } | ||
| } else if (checkCount < maxChecks) { | ||
| setTimeout(checkAndExpand, 100); | ||
| } | ||
| } | ||
|
|
||
| // Strategy 3: MutationObserver for dynamic content | ||
| // eslint-disable-next-line no-undef | ||
| const observer = new MutationObserver(() => { | ||
| expandAllNavigation(); | ||
| }); | ||
|
|
||
| // Strategy 4: Multiple event listeners | ||
| window.addEventListener('load', () => { | ||
| expandAllNavigation(); | ||
| checkAndExpand(); | ||
|
|
||
| // Start observing after page load | ||
| const navContainer = document.querySelector( | ||
| '#tsd-nav-container, .site-menu' | ||
| ); | ||
| if (navContainer) { | ||
| observer.observe(navContainer, { | ||
| childList: true, | ||
| subtree: true, | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| // Strategy 5: Check for TypeDoc's app initialization | ||
| if (window.app) { | ||
| expandAllNavigation(); | ||
| } else { | ||
| Object.defineProperty(window, 'app', { | ||
| configurable: true, | ||
| set: function (value) { | ||
| delete window.app; | ||
| window.app = value; | ||
| setTimeout(expandAllNavigation, 100); | ||
| setTimeout(expandAllNavigation, 500); | ||
| }, | ||
| get: function () { | ||
| return window._app; | ||
| }, | ||
| }); | ||
| } | ||
| })(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,6 +291,8 @@ export class IterableConfig { | |
| /** | ||
| * Android only feature: This controls whether the SDK should enforce encryption for all PII stored on disk. | ||
| * By default, the SDK will not enforce encryption and may fallback to unencrypted storage in case the encryption fails. | ||
| * | ||
| * @group Android only. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsdoc-undefined-tag: The TSDoc tag "@group" is not defined in this configuration [eslint:tsdoc/syntax] |
||
| */ | ||
| encryptionEnforced = false; | ||
|
|
||
|
|
@@ -301,8 +303,11 @@ export class IterableConfig { | |
| */ | ||
| toDict() { | ||
| return { | ||
| /** The name of the Iterable push integration. */ | ||
| pushIntegrationName: this.pushIntegrationName, | ||
| /** Whether automatic push registration is enabled. */ | ||
| autoPushRegistration: this.autoPushRegistration, | ||
| /** The display interval between in-app messages (in seconds). */ | ||
| inAppDisplayInterval: this.inAppDisplayInterval, | ||
| /** | ||
| * A boolean indicating if a URL handler is present. | ||
|
|
@@ -334,13 +339,22 @@ export class IterableConfig { | |
| authHandlerPresent: this.authHandler != undefined, | ||
| /** The log level for the SDK. */ | ||
| logLevel: this.logLevel, | ||
| /** The number of seconds before JWT expiration to refresh the token. */ | ||
| expiringAuthTokenRefreshPeriod: this.expiringAuthTokenRefreshPeriod, | ||
| /** The array of allowed URL protocols that the SDK can handle. */ | ||
| allowedProtocols: this.allowedProtocols, | ||
| /** | ||
| * @deprecated Whether to use in-memory storage for in-app messages on Android. | ||
| */ | ||
| androidSdkUseInMemoryStorageForInApps: | ||
| this.androidSdkUseInMemoryStorageForInApps, | ||
| /** Whether to use in-memory storage for in-app messages. */ | ||
| useInMemoryStorageForInApps: this.useInMemoryStorageForInApps, | ||
| /** The data region determining the data center and endpoints. */ | ||
| dataRegion: this.dataRegion, | ||
| /** The push platform to use for push notifications. */ | ||
| pushPlatform: this.pushPlatform, | ||
| /** Whether encryption is enforced for PII stored on disk (Android only). */ | ||
| encryptionEnforced: this.encryptionEnforced, | ||
| }; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,9 @@ import { AppState } from 'react-native'; | |
| * | ||
| * @returns The current app state. | ||
| * | ||
| * @category Hooks | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsdoc-undefined-tag: The TSDoc tag "@category" is not defined in this configuration [eslint:tsdoc/syntax] |
||
| * @group Hooks | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsdoc-undefined-tag: The TSDoc tag "@group" is not defined in this configuration [eslint:tsdoc/syntax] |
||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const appState = useAppStateListener(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| import { useIsFocused } from '@react-navigation/native'; | ||
| import { useEffect, useState } from 'react'; | ||
| import { | ||
| useEffect, | ||
| useState, | ||
| type PropsWithChildren, | ||
| type ReactElement, | ||
| } from 'react'; | ||
| import { | ||
| Animated, | ||
| NativeEventEmitter, | ||
|
|
@@ -161,6 +166,9 @@ export interface IterableInboxProps | |
| * It handles fetching messages, displaying them in a list, and showing individual message details. | ||
| * It also manages the state of the inbox, including loading state, selected message, and visible message impressions. | ||
| * | ||
| * @category React Components | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsdoc-undefined-tag: The TSDoc tag "@category" is not defined in this configuration [eslint:tsdoc/syntax] |
||
| * @group React Components | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsdoc-undefined-tag: The TSDoc tag "@group" is not defined in this configuration [eslint:tsdoc/syntax] |
||
| * | ||
| * @example | ||
| * ```tsx | ||
| * const [visible, setVisible] = useState<boolean>(false); | ||
|
|
@@ -186,15 +194,18 @@ export interface IterableInboxProps | |
| * ) | ||
| * ``` | ||
| */ | ||
| export const IterableInbox = ({ | ||
| returnToInboxTrigger = true, | ||
| messageListItemLayout = () => null, | ||
| customizations = {} as IterableInboxCustomizations, | ||
| tabBarHeight = 80, | ||
| tabBarPadding = 20, | ||
| safeAreaMode = true, | ||
| showNavTitle = true, | ||
| }: IterableInboxProps) => { | ||
| export const IterableInbox = ( | ||
| params: PropsWithChildren<IterableInboxProps> | ||
| ): ReactElement => { | ||
| const { | ||
| returnToInboxTrigger = true, | ||
| messageListItemLayout = () => null, | ||
| customizations = {} as IterableInboxCustomizations, | ||
| tabBarHeight = 80, | ||
| tabBarPadding = 20, | ||
| safeAreaMode = true, | ||
| showNavTitle = true, | ||
| } = params; | ||
| const defaultInboxTitle = 'Inbox'; | ||
| const inboxDataModel = new IterableInboxDataModel(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json" | ||
| "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", | ||
| "extends": ["typedoc/tsdoc.json", "typedoc-plugin-mermaid/tsdoc.json"], | ||
| "noStandardTags": false | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsdoc-undefined-tag: The TSDoc tag "@group" is not defined in this configuration [eslint:tsdoc/syntax]