Make enums action option enums const and fix linter issues.

This commit is contained in:
Carter Bertolini 2023-10-27 16:21:52 -04:00
parent c113bd4f5c
commit dcdb2bad1a
3 changed files with 10 additions and 7 deletions

View File

@ -69,7 +69,8 @@ module.exports = {
"no-return-assign": "error",
"no-script-url": "error",
"no-sequences": "error",
"no-shadow": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-throw-literal": "error",
"no-undef-init": "error",
"no-undefined": "error",

View File

@ -51,7 +51,7 @@ export class AlpacaExchange implements Exchange {
this.portfolioProvider = new AlpacaPortfolioProvider(this.alpaca);
this.quoteProvider = new AlpacaQuoteProvider(this.alpaca);
this.actionProvider = undefined!;
this.actionProvider = null!;
this.name = 'Alpaca';
}

View File

@ -1,7 +1,7 @@
/**
* Enum representing the possible sides of an action.
*/
export enum ActionSide {
export const enum ActionSide {
Buy,
Sell,
}
@ -50,7 +50,7 @@ export class Action {
* Enum representing the type of date filter used in an action fetch.
* @enum {number}
*/
export enum ActionDateType {
export const enum ActionDateType {
On,
After,
Before,
@ -100,6 +100,7 @@ export class ActionFetchOptions {
* Represents the response of a fetch action request.
*/
export interface ActionFetchResponse {
/**
* An array of `Action` objects.
*/
@ -116,6 +117,7 @@ export interface ActionFetchResponse {
* An interface representing an object that provides actions.
*/
export interface ActionProvider {
/**
* Fetches actions based on the provided options.
* @param options - The options to use when fetching actions.