Make enums action option enums const and fix linter issues.
This commit is contained in:
parent
c113bd4f5c
commit
dcdb2bad1a
@ -69,7 +69,8 @@ module.exports = {
|
|||||||
"no-return-assign": "error",
|
"no-return-assign": "error",
|
||||||
"no-script-url": "error",
|
"no-script-url": "error",
|
||||||
"no-sequences": "error",
|
"no-sequences": "error",
|
||||||
"no-shadow": "error",
|
"no-shadow": "off",
|
||||||
|
"@typescript-eslint/no-shadow": ["error"],
|
||||||
"no-throw-literal": "error",
|
"no-throw-literal": "error",
|
||||||
"no-undef-init": "error",
|
"no-undef-init": "error",
|
||||||
"no-undefined": "error",
|
"no-undefined": "error",
|
||||||
|
@ -51,7 +51,7 @@ export class AlpacaExchange implements Exchange {
|
|||||||
|
|
||||||
this.portfolioProvider = new AlpacaPortfolioProvider(this.alpaca);
|
this.portfolioProvider = new AlpacaPortfolioProvider(this.alpaca);
|
||||||
this.quoteProvider = new AlpacaQuoteProvider(this.alpaca);
|
this.quoteProvider = new AlpacaQuoteProvider(this.alpaca);
|
||||||
this.actionProvider = undefined!;
|
this.actionProvider = null!;
|
||||||
|
|
||||||
this.name = 'Alpaca';
|
this.name = 'Alpaca';
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Enum representing the possible sides of an action.
|
* Enum representing the possible sides of an action.
|
||||||
*/
|
*/
|
||||||
export enum ActionSide {
|
export const enum ActionSide {
|
||||||
Buy,
|
Buy,
|
||||||
Sell,
|
Sell,
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ export class Action {
|
|||||||
* The quantity of the asset being traded.
|
* The quantity of the asset being traded.
|
||||||
*/
|
*/
|
||||||
readonly quantity: number;
|
readonly quantity: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The side of the action, either "buy" or "sell".
|
* The side of the action, either "buy" or "sell".
|
||||||
*/
|
*/
|
||||||
@ -50,7 +50,7 @@ export class Action {
|
|||||||
* Enum representing the type of date filter used in an action fetch.
|
* Enum representing the type of date filter used in an action fetch.
|
||||||
* @enum {number}
|
* @enum {number}
|
||||||
*/
|
*/
|
||||||
export enum ActionDateType {
|
export const enum ActionDateType {
|
||||||
On,
|
On,
|
||||||
After,
|
After,
|
||||||
Before,
|
Before,
|
||||||
@ -89,7 +89,7 @@ export class ActionFetchOptions {
|
|||||||
* The number of items to fetch per page.
|
* The number of items to fetch per page.
|
||||||
*/
|
*/
|
||||||
readonly pageSize?: number;
|
readonly pageSize?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date options for filtering actions.
|
* The date options for filtering actions.
|
||||||
*/
|
*/
|
||||||
@ -100,6 +100,7 @@ export class ActionFetchOptions {
|
|||||||
* Represents the response of a fetch action request.
|
* Represents the response of a fetch action request.
|
||||||
*/
|
*/
|
||||||
export interface ActionFetchResponse {
|
export interface ActionFetchResponse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of `Action` objects.
|
* An array of `Action` objects.
|
||||||
*/
|
*/
|
||||||
@ -116,10 +117,11 @@ export interface ActionFetchResponse {
|
|||||||
* An interface representing an object that provides actions.
|
* An interface representing an object that provides actions.
|
||||||
*/
|
*/
|
||||||
export interface ActionProvider {
|
export interface ActionProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches actions based on the provided options.
|
* Fetches actions based on the provided options.
|
||||||
* @param options - The options to use when fetching actions.
|
* @param options - The options to use when fetching actions.
|
||||||
* @returns A promise that resolves to an object containing the fetched actions.
|
* @returns A promise that resolves to an object containing the fetched actions.
|
||||||
*/
|
*/
|
||||||
readonly fetchActions: (options: ActionFetchOptions) => Promise<ActionFetchResponse>;
|
readonly fetchActions: (options: ActionFetchOptions) => Promise<ActionFetchResponse>;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user