MISC: Remove fuzzy matching when checking params (#2091)

This commit is contained in:
catloversg
2025-05-19 06:08:19 +07:00
committed by GitHub
parent f4e70720a6
commit 24b31975e7
26 changed files with 281 additions and 395 deletions

View File

@@ -430,10 +430,9 @@ type OrderEnumType = {
type OrderType = _ValueOf<OrderEnumType>;
/**
* Value in map of {@link StockOrder}
* @public
*/
interface StockOrderObject {
interface StockOrder {
/** Number of shares */
shares: number;
/** Price per share */
@@ -444,16 +443,6 @@ interface StockOrderObject {
position: PositionType;
}
/**
* Return value of {@link TIX.getOrders | getOrders}
*
* Keys are stock symbols, properties are arrays of {@link StockOrderObject}
* @public
*/
interface StockOrder {
[key: string]: StockOrderObject[];
}
/** Constants used for the stock market game mechanic.
* @public */
interface StockMarketConstants {
@@ -1381,10 +1370,10 @@ export interface TIX {
*
* @param sym - Stock symbol.
* @param shares - Number of shares to purchase.
* @param posType - Specifies whether the order is a Long or Short position.
* @param positionType - Specifies whether the order is a Long ("L") or Short ("S") position.
* @returns Cost to buy a given number of shares of a stock.
*/
getPurchaseCost(sym: string, shares: number, posType: string): number;
getPurchaseCost(sym: string, shares: number, positionType: PositionType): number;
/**
* Calculate profit of selling stocks.
@@ -1395,10 +1384,10 @@ export interface TIX {
*
* @param sym - Stock symbol.
* @param shares - Number of shares to sell.
* @param posType - Specifies whether the order is a Long or Short position.
* @param positionType - Specifies whether the order is a Long ("L") or Short ("S") position.
* @returns Gain from selling a given number of shares of a stock.
*/
getSaleGain(sym: string, shares: number, posType: string): number;
getSaleGain(sym: string, shares: number, positionType: PositionType): number;
/**
* Buy stocks.
@@ -1501,11 +1490,11 @@ export interface TIX {
* @param sym - Stock symbol.
* @param shares - Number of shares for order. Must be positive. Will be rounded to the nearest integer.
* @param price - Execution price for the order.
* @param type - Type of order.
* @param pos - Specifies whether the order is a Long or Short position.
* @param orderType - Type of order.
* @param positionType - Specifies whether the order is a Long ("L") or Short ("S") position.
* @returns True if the order is successfully placed, and false otherwise.
*/
placeOrder(sym: string, shares: number, price: number, type: string, pos: string): boolean;
placeOrder(sym: string, shares: number, price: number, orderType: OrderType, positionType: PositionType): boolean;
/**
* Cancel order for stocks.
@@ -1519,10 +1508,10 @@ export interface TIX {
* @param sym - Stock symbol.
* @param shares - Number of shares for order. Must be positive. Will be rounded to the nearest integer.
* @param price - Execution price for the order.
* @param type - Type of order.
* @param pos - Specifies whether the order is a Long or Short position.
* @param orderType - Type of order.
* @param positionType - Specifies whether the order is a Long ("L") or Short ("S") position.
*/
cancelOrder(sym: string, shares: number, price: number, type: string, pos: string): void;
cancelOrder(sym: string, shares: number, price: number, orderType: OrderType, positionType: PositionType): void;
/**
* Returns your order book for the stock market.
@@ -1530,7 +1519,7 @@ export interface TIX {
* RAM cost: 2.5 GB
* This is an object containing information for all the Limit and Stop Orders you have in the stock market.
* For each symbol you have a position in, the returned object will have a key with that symbol's name.
* The object's properties are each an array of {@link StockOrderObject}
* The object's properties are each an array of {@link StockOrder}
* The object has the following structure:
*
* ```js
@@ -1585,9 +1574,10 @@ export interface TIX {
* ],
* }
* ```
* @returns Object containing information for all the Limit and Stop Orders you have in the stock market.
* @returns Object containing information for all the Limit and Stop Orders you have in the stock market. Keys are
* stock symbols, and properties are arrays of {@link StockOrder}
*/
getOrders(): StockOrder;
getOrders(): Record<string, StockOrder[]>;
/**
* Returns the volatility of the specified stock.