diff --git a/.eslintrc.js b/.eslintrc.js index cc54a78..f8e2339 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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", diff --git a/src/alpaca/exchange.ts b/src/alpaca/exchange.ts index 2d701d0..eceadd4 100644 --- a/src/alpaca/exchange.ts +++ b/src/alpaca/exchange.ts @@ -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'; } diff --git a/src/interface/actions.ts b/src/interface/actions.ts index f42530a..2fdad9c 100644 --- a/src/interface/actions.ts +++ b/src/interface/actions.ts @@ -1,7 +1,7 @@ /** * Enum representing the possible sides of an action. */ -export enum ActionSide { +export const enum ActionSide { Buy, Sell, } @@ -19,7 +19,7 @@ export class Action { * The quantity of the asset being traded. */ readonly quantity: number; - + /** * 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 {number} */ -export enum ActionDateType { +export const enum ActionDateType { On, After, Before, @@ -89,7 +89,7 @@ export class ActionFetchOptions { * The number of items to fetch per page. */ readonly pageSize?: number; - + /** * The date options for filtering actions. */ @@ -100,6 +100,7 @@ export class ActionFetchOptions { * Represents the response of a fetch action request. */ export interface ActionFetchResponse { + /** * An array of `Action` objects. */ @@ -116,10 +117,11 @@ 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. * @returns A promise that resolves to an object containing the fetched actions. */ readonly fetchActions: (options: ActionFetchOptions) => Promise; -} \ No newline at end of file +}