From 39742da43e6be61a066671a09d58b81210613c98 Mon Sep 17 00:00:00 2001 From: Carter Bertolini Date: Fri, 27 Oct 2023 16:13:53 -0400 Subject: [PATCH] Finish action interface documentation. --- src/interface/actions.ts | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/interface/actions.ts b/src/interface/actions.ts index 34b39d0..f42530a 100644 --- a/src/interface/actions.ts +++ b/src/interface/actions.ts @@ -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; }