Finish action interface documentation.
This commit is contained in:
parent
dd72d4a717
commit
39742da43e
@ -31,7 +31,7 @@ export class Action {
|
|||||||
readonly pricePerShare: number;
|
readonly pricePerShare: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of an Action.
|
* Represents a user Action.
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {string} symbol - The symbol of the asset being traded.
|
* @param {string} symbol - The symbol of the asset being traded.
|
||||||
* @param {number} quantity - The quantity 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 {
|
export enum ActionDateType {
|
||||||
On,
|
On,
|
||||||
After,
|
After,
|
||||||
Before,
|
Before,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents options for a date filter in an action fetch.
|
||||||
|
*/
|
||||||
export class ActionDateOptions {
|
export class ActionDateOptions {
|
||||||
|
/**
|
||||||
|
* The date to filter on.
|
||||||
|
*/
|
||||||
readonly date: Date;
|
readonly date: Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of date filter to use.
|
||||||
|
*/
|
||||||
readonly dateType: ActionDateType;
|
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) {
|
constructor(date: Date, dateType: ActionDateType) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.dateType = dateType;
|
this.dateType = dateType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the options for fetching actions.
|
||||||
|
*/
|
||||||
export class ActionFetchOptions {
|
export class ActionFetchOptions {
|
||||||
|
/**
|
||||||
|
* The number of items to fetch per page.
|
||||||
|
*/
|
||||||
readonly pageSize?: number;
|
readonly pageSize?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The date options for filtering actions.
|
||||||
|
*/
|
||||||
readonly dateOptions?: ActionDateOptions;
|
readonly dateOptions?: ActionDateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the response of a fetch action request.
|
||||||
|
*/
|
||||||
export interface ActionFetchResponse {
|
export interface ActionFetchResponse {
|
||||||
|
/**
|
||||||
|
* An array of `Action` objects.
|
||||||
|
*/
|
||||||
readonly actions: Action[];
|
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>;
|
readonly fetchNextPage?: () => Promise<ActionFetchResponse>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user