Finish action interface documentation.

This commit is contained in:
Carter Bertolini 2023-10-27 16:13:53 -04:00
parent dd72d4a717
commit 39742da43e

View File

@ -31,7 +31,7 @@ export class Action {
readonly pricePerShare: number;
/**
* Creates an instance of an Action.
* Represents a user Action.
* @constructor
* @param {string} symbol - The symbol of the asset being traded.
* @param {number} quantity - The quantity of the asset being traded.
@ -46,30 +46,69 @@ export class Action {
}
}
/**
* Enum representing the type of date filter used in an action fetch.
* @enum {number}
*/
export enum ActionDateType {
On,
After,
Before,
}
/**
* Represents options for a date filter in an action fetch.
*/
export class ActionDateOptions {
/**
* The date to filter on.
*/
readonly date: Date;
/**
* The type of date filter to use.
*/
readonly dateType: ActionDateType;
/**
* Creates a new ActionDateOptions instance.
* @param date The date to filter on.
* @param dateType The type of date filter to use.
*/
constructor(date: Date, dateType: ActionDateType) {
this.date = date;
this.dateType = dateType;
}
}
/**
* Represents the options for fetching actions.
*/
export class ActionFetchOptions {
/**
* The number of items to fetch per page.
*/
readonly pageSize?: number;
/**
* The date options for filtering actions.
*/
readonly dateOptions?: ActionDateOptions;
}
/**
* Represents the response of a fetch action request.
*/
export interface ActionFetchResponse {
/**
* An array of `Action` objects.
*/
readonly actions: Action[];
/**
* A function that fetches the next page of actions, if available.
* Returns a promise that resolves to an `ActionFetchResponse` object.
*/
readonly fetchNextPage?: () => Promise<ActionFetchResponse>;
}