UNPKG

lit-securities-utility

Version:

A utility package for securities applications

53 lines (52 loc) 2.64 kB
import { IScript, TScriptPopulate } from './TYPES/Script'; import { TScriptIdIndexValue } from './TYPES/Store'; /** * Memoized version of `_getScripByScripId` for optimized retrieval. */ export declare const getScripByScripId: (scriptId: IScript["scriptId"], populate?: TScriptPopulate) => IScript | undefined; /** * Retrieves multiple scripts by their `scriptId`s, optionally populating additional properties. * * @param scriptIds - An array of `scriptId`s to retrieve. * @param [populate] - An optional array of properties to include in the returned objects. * @returns An array of script objects. */ export declare const getScripsByScripIds: (scriptIds: IScript["scriptId"][], populate?: TScriptPopulate) => IScript[]; /** * Retrieves scripts by their ISIN code, optionally populating additional properties. * * @param isinCode - The ISIN code to search for. * @param [populate] - An optional array of properties to include in the returned objects. * @returns An array of script objects or an empty array if none are found. */ export declare const getScripsByIsinCode: (isinCode: IScript["isinCode"], populate?: TScriptPopulate) => IScript[] | undefined; /** * Retrieves derivative scripts associated with a specific `scriptId`, filtered by derivative type. * * @param scriptId - The unique identifier of the script to retrieve derivatives for. * @param [derivativeType="BOTH"] - The type of derivatives to retrieve: `FUTURES`, `OPTIONS`, or `BOTH`. * @param [populate] - An optional array of properties to include in the returned objects. * @returns An object containing arrays of derivative scripts by type, or an empty object if none are found. */ export declare const getDerivativeScripsByScripId: (scriptId: IScript["scriptId"], derivativeType?: "FUTURES" | "OPTIONS" | "BOTH", populate?: TScriptPopulate) => { FUTURES?: undefined; OPTIONS?: undefined; } | { FUTURES: IScript[]; OPTIONS: IScript[]; } | { FUTURES: IScript[]; OPTIONS?: undefined; } | { OPTIONS: IScript[]; FUTURES?: undefined; } | undefined; /** * Retrieves a script object by its index value, optionally populating additional properties. * * * @param scriptIdIndexValue - The index value associated with the script. * @param [populate=[]] - An optional array of properties to include in the returned object. * @returns The script object or a partial object with populated properties, or `undefined` if not found. */ export declare const getScriptByScriptIdIndexValue: (scriptIdIndexValue: TScriptIdIndexValue, populate?: TScriptPopulate) => IScript | undefined | Pick<IScript, TScriptPopulate[number]>;