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-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",

View File

@ -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';
} }

View File

@ -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,
} }
@ -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,
@ -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,6 +117,7 @@ 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.