Skip to content
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

[MOB-9676] docs and doc generator #610

Merged
merged 28 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7db31cc
Update .gitignore to include docs directory; add typedoc command to p…
lposen Nov 16, 2024
26afd81
Add typedoc as a dependency in package.json for improved documentatio…
lposen Nov 16, 2024
bce5257
Add eslint-plugin-tsdoc for improved TypeScript documentation linting…
lposen Nov 16, 2024
ffc4467
Update ESLint ignore file to exclude docs directory; add typedoc comm…
lposen Nov 16, 2024
9e9f171
Fixed issues identified by tsdoc/syntax
lposen Nov 16, 2024
7524885
Add typedoc-plugin-coverage for improved documentation coverage track…
lposen Nov 16, 2024
c7725b5
Refactor TypeDoc configuration: remove old typedoc.json, add typedoc.…
lposen Nov 16, 2024
07ffa32
Enhance Iterable class documentation with examples for key methods to…
lposen Nov 16, 2024
25915cf
Enhance documentation for Iterable inbox components: add detailed pro…
lposen Nov 16, 2024
17004be
Enhance documentation for useAppStateListener and useDeviceOrientatio…
lposen Nov 16, 2024
d4b68fb
Enhance documentation for Iterable inbox types: add detailed descript…
lposen Nov 16, 2024
e70277e
Enhance documentation for IterableAction and IterableAttributionInfo …
lposen Nov 16, 2024
de0e2b4
Enhance documentation for IterableCommerceItem, IterableConfig, Itera…
lposen Nov 16, 2024
4a07e91
Enhance documentation for IterableInApp enums and IterableInAppMessag…
lposen Nov 16, 2024
bbbf7f4
Add code block example to IterableInAppManager documentation for show…
lposen Nov 16, 2024
8dbad2c
Updated inbox documentation with info found in docs
lposen Nov 16, 2024
28e66de
Enhance documentation for handleAppLink method: clarify usage, add de…
lposen Nov 16, 2024
56f89b4
Add typedoc-plugin-mermaid for enhanced documentation capabilities an…
lposen Nov 17, 2024
630338a
Enhance documentation across multiple classes and enums: add detailed…
lposen Nov 17, 2024
cbd9583
Enhance documentation for Iterable SDK components: add descriptions f…
lposen Nov 17, 2024
a3e725b
Fix typo in IterableEventName enum: correct "failse" to "fails" in ha…
lposen Nov 21, 2024
5a29d1f
Enhance documentation across multiple files: clarify descriptions, im…
lposen Nov 21, 2024
d06c597
Update typedoc configuration to enforce documentation requirements: s…
lposen Nov 21, 2024
533df62
Merge branch '2.0.0-alpha/MOB-10141-make-lint-rules-stricter' into 2.…
lposen Nov 25, 2024
f6bff5a
Merge branch '2.0.0-alpha/MOB-10141-make-lint-rules-stricter' into 2.…
evantk91 Dec 7, 2024
7f3df5d
Merge branch '2.0.0-alpha/MOB-10141-make-lint-rules-stricter' into 2.…
lposen Dec 11, 2024
dc0f02a
Merge branch '2.0.0-alpha/master' into 2.0.0-alpha/MOB-9676-new-doc-g…
lposen Dec 13, 2024
fb179a5
refactor: named type as `IterableInAppMessageRaw`
lposen Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions example/src/hooks/useIterableApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ interface IterableAppProps {
loginInProgress?: boolean;
/** Logs the user out */
logout: () => void;
// eslint-disable-next-line tsdoc/syntax
/** TODO: Ask @evantk91 or @Ayyanchira what this is for */
/** Should the iterable inbox return to the list of messages? */
returnToInboxTrigger: boolean;
lposen marked this conversation as resolved.
Show resolved Hide resolved
/** Sets the API key for the user */
setApiKey: (value: string) => void;
/** Sets whether the tab in focus is the `Inbox` tab */
setIsInboxTab: (value: boolean) => void;
/** Sets whether the login is in progress */
setLoginInProgress: (value: boolean) => void;
// eslint-disable-next-line tsdoc/syntax
/** TODO: Ask @evantk91 or @Ayyanchira what this is for */
/** Sets whether the iterable inbox should return to the list of messages */
lposen marked this conversation as resolved.
Show resolved Hide resolved
setReturnToInboxTrigger: (value: boolean) => void;
/** Sets the user ID for the user */
setUserId: (value: string) => void;
Expand Down
9 changes: 5 additions & 4 deletions src/core/classes/IterableAction.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/**
* IterableAction represents an action defined as a response to user events.
*
* It is currently used in push notification actions (open push & action buttons).
*/
export class IterableAction {
/** The type of iterable action. */
type: string;
/** Optional string data associated with the IterableAction. */
/**
* Determines the action. EG: "open_url", "open_in_app", "deep_link", "join" etc.
lposen marked this conversation as resolved.
Show resolved Hide resolved
*/
data?: string;
/**
* TODO: Review
* Optional user input string.
* This property can be used to store input provided by the user.
* Additional info related to the action.
*/
userInput?: string;

Expand Down
16 changes: 15 additions & 1 deletion src/core/classes/IterableActionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@ import type { IterableActionSource } from '../enums';
import { IterableAction } from './IterableAction';

/**
* TODO: Add description
* Information related to an Iterable action.
*/
export class IterableActionContext {
/**
* The action associated with the context.
*/
action: IterableAction;
/**
* The origin of the action. In other words, where was the action triggered?
*/
source: IterableActionSource;

/**
* Creates an instance of IterableActionContext.
*/
constructor(action: IterableAction, source: IterableActionSource) {
this.action = action;
this.source = source;
}

/**
* Creates an instance of `IterableActionContext` from a dictionary object.
*
* @returns A new instance of `IterableActionContext` with the provided properties.
*/
static fromDict(dict: IterableActionContext): IterableActionContext {
const action = IterableAction.fromDict(dict.action);
const source = dict.source;
Expand Down
24 changes: 22 additions & 2 deletions src/core/classes/IterableEdgeInsets.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
import type { IterableEdgeInsetDetails } from '../types';

// TODO: Add description
export class IterableEdgeInsets {
/**
* Space around the html content
*/
export class IterableEdgeInsets implements IterableEdgeInsetDetails {
top: number;
left: number;
bottom: number;
right: number;

/**
* Creates an instance of IterableEdgeInsets.
*
* @param top - The top edge inset.
* @param left - The left edge inset.
* @param bottom - The bottom edge inset.
* @param right - The right edge inset.
*/
constructor(top: number, left: number, bottom: number, right: number) {
this.top = top;
this.left = left;
this.bottom = bottom;
this.right = right;
}

/**
* Creates an instance of `IterableEdgeInsets` from a dictionary object.
*
* @param dict - An object containing the edge inset details with properties:
* - `top`: The top edge inset.
* - `left`: The left edge inset.
* - `bottom`: The bottom edge inset.
* - `right`: The right edge inset.
* @returns A new instance of `IterableEdgeInsets` initialized with the provided edge inset values.
*/
static fromDict(dict: IterableEdgeInsetDetails): IterableEdgeInsets {
return new IterableEdgeInsets(dict.top, dict.left, dict.bottom, dict.right);
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/enums/IterableEventName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export enum IterableEventName {
/** Event that fires when a custom action is called */
handleCustomActionCalled = 'handleCustomActionCalled',
/**
* TODO: Review
* Event that fires when an in-app message is shown?
* TODO: Rename at some point
* Event that fires when an in-app message is shown
*/
handleInAppCalled = 'handleInAppCalled',
/** Event that fires when a user attempts to authenticate */
Expand Down
9 changes: 6 additions & 3 deletions src/core/enums/IterableLogLevel.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/**
* Enum representing what level of logs will Android and iOS project be printing
* on their consoles respectively.
* Enum representing the level of logs will Android and iOS projects be using.
*
* TODO: Go over what they correspond to in ios/Android with Evan/Akshay
* @see [Android Log Levels](https://source.android.com/docs/core/tests/debug/understanding-logging)
* @see [iOS Log Levels](https://apple.github.io/swift-log/docs/current/Logging/Structs/Logger/Level.html#/s:7Logging6LoggerV5LevelO4infoyA2EmF)
*/
export enum IterableLogLevel {
/** Appropriate for messages that contain information normally of use only when debugging a program. */
debug = 1,
/** Appropriate for informational messages. */
info = 2,
/** Appropriate for error conditions. */
error = 3,
}
8 changes: 7 additions & 1 deletion src/core/types/IterableEdgeInsetDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/** TODO: document */
/**
* Space around the html content.
*/
export interface IterableEdgeInsetDetails {
/** Space at the top of the html content. */
top: number;
/** Space to the left of the html content. */
left: number;
/** Space at the bottom of the html content. */
bottom: number;
/** Space to the right of the html content. */
right: number;
}
19 changes: 18 additions & 1 deletion src/inApp/classes/IterableHtmlInAppContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,34 @@ import type {
IterableInAppContent,
} from '../types';

// TODO: Add description
/**
* Information about the display of an HTML in-app message.
*/
export class IterableHtmlInAppContent implements IterableInAppContent {
/** The type of in-app content. */
type: IterableInAppContentType = IterableInAppContentType.html;
/** The space around the in-app content. */
edgeInsets: IterableEdgeInsets;
/** The raw HTML content of the in-app message. */
html: string;

/**
* Constructs an `IterableHtmlInAppContent` instance with the provided `edgeInsets` and `html`.
*
* @param edgeInsets The space around the in-app content.
* @param html The raw HTML content of the in-app message.
*/
constructor(edgeInsets: IterableEdgeInsets, html: string) {
this.edgeInsets = edgeInsets;
this.html = html;
}

/**
* Creates a new `IterableHtmlInAppContent` instance from a raw dictionary representation.
*
* @param dict The raw dictionary representation of the HTML in-app content.
* @returns A new `IterableHtmlInAppContent` instance with the values from the provided dictionary.
*/
static fromDict(dict: IterableHtmlInAppContentRaw): IterableHtmlInAppContent {
return new IterableHtmlInAppContent(
IterableEdgeInsets.fromDict(dict.edgeInsets),
Expand Down
4 changes: 1 addition & 3 deletions src/inApp/classes/IterableInAppMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ export class IterableInAppMessage {
}

/**
* Determines if the in-app message should be silently saved to the inbox.
*
* TODO: Double check the definition
* Do you want the in-app message to be saved to the inbox without triggering a notification?
*
* @returns `true` if the message should be saved to the inbox without triggering a notification; otherwise, `false`.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/inApp/types/IterableHtmlInAppContentRaw.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { IterableEdgeInsetDetails } from '../../core';

/** The raw in-App content details returned from the server */
/**
* The raw in-App content details returned from the server.
*/
export interface IterableHtmlInAppContentRaw {
/** The HTML content of the in-App message. */
lposen marked this conversation as resolved.
Show resolved Hide resolved
edgeInsets: IterableEdgeInsetDetails;
/** The HTML content of the in-App message. */
html: string;
}
8 changes: 2 additions & 6 deletions src/inbox/types/IterableInboxImpressionRowInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
* Interface representing the information of an impression row in the Iterable inbox.
*/
export interface IterableInboxImpressionRowInfo {
/**
* The message ID of the impression row.
*/
/** The message ID of the impression row. */
messageId: string;
/**
* TODO: Ask about this field
*/
/** Do you want the message to show in the inbox list but not as a notification? */
silentInbox: boolean;
}
Loading