import { CandleInterval, ISignalDto } from 'backtest-kit'; declare class Code { readonly source: string; private readonly __type__; private constructor(); static fromString: (source: string) => Code; static isCode: (value: unknown) => value is Code; } declare class File { readonly path: string; readonly baseDir: string; private readonly __type__; private constructor(); static fromPath: (path: string, baseDir?: string) => File; static isFile: (value: unknown) => value is File; } type PlotData = { time: number; value: number; }; type PlotEntry = { data: PlotData[]; }; type PlotModel = Record; type PlotRecord = { plots: PlotModel; }; type TIndicatorCtor = new (source: string, inputs?: Record) => IIndicator; interface IIndicator { source: string; inputs: Record; } interface IProvider { getMarketData(tickerId: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise; getSymbolInfo(tickerId: string): Promise; } type TPineCtor = new (source: IProvider, tickerId: string, timeframe: string, limit: number) => IPine; interface IPine { ready(): Promise; run(code: string | IIndicator): Promise; } declare function usePine(ctor: T): void; declare function useIndicator(ctor: T): void; type ExchangeName = string; interface IExchangeContext { exchangeName: ExchangeName; } interface IRunParams$1 { symbol: string; timeframe: CandleInterval; limit: number; inputs?: Record; } declare function run(source: File | Code, { symbol, timeframe, limit, inputs }: IRunParams$1, exchangeName?: ExchangeName, when?: Date): Promise; type PlotExtractConfig = { plot: string; barsBack?: number; transform?: (value: number) => T; }; type PlotMapping = { [key: string]: string | PlotExtractConfig; }; type ExtractedData = { [K in keyof M]: M[K] extends PlotExtractConfig ? R : M[K] extends string ? number : never; }; type ExtractedDataRow = { [K in keyof M]: M[K] extends PlotExtractConfig ? R | null : M[K] extends string ? number | null : never; } & { timestamp: string; }; declare class PineDataService { private readonly loggerService; extractRows(plots: PlotModel, mapping: M): ExtractedDataRow[]; extract(plots: PlotModel, mapping: M): ExtractedData; } declare function extractRows(plots: PlotModel, mapping: M): Promise[]>; declare function extract(plots: PlotModel, mapping: M): Promise>; interface ILogger { log(topic: string, ...args: any[]): void; debug(topic: string, ...args: any[]): void; info(topic: string, ...args: any[]): void; warn(topic: string, ...args: any[]): void; } declare function setLogger(logger: ILogger): void; interface IParams { symbol: string; timeframe: CandleInterval; limit: number; inputs?: Record; } declare function getSignal(source: File | Code, { symbol, timeframe, limit, inputs }: IParams): Promise; type ResultId$3 = string | number; declare function dumpPlotData(signalId: ResultId$3, plots: PlotModel, mapping: M, taName: string, outputDir?: string): Promise; type ResultId$2 = string | number; interface IRunParams { symbol: string; timeframe: CandleInterval; limit: number; inputs?: Record; } declare function toMarkdown(signalId: ResultId$2, plots: PlotModel, mapping: M, limit?: number): Promise; declare function markdown(signalId: ResultId$2, source: File | Code, { symbol, timeframe, limit, inputs }: IRunParams, mapping: M, exchangeName?: ExchangeName, when?: Date): Promise; type ResultId$1 = string | number; interface SignalData { position: number; priceOpen?: number; priceTakeProfit: number; priceStopLoss: number; minuteEstimatedTime: number; } interface Signal extends ISignalDto { id: string; } declare function toSignalDto(id: ResultId$1, data: SignalData, priceOpen?: number | null | undefined): Signal | null; interface CandleModel { openTime: number; open: number; high: number; low: number; close: number; volume: number; } interface SymbolInfoModel { ticker: string; tickerid: string; description: string; type: string; basecurrency: string; currency: string; timezone: string; } declare const AXIS_SYMBOL = "_AXIS"; declare class AxisProviderService implements IProvider { private readonly loggerService; getMarketData(_: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise; getSymbolInfo(): Promise; } declare class LoggerService implements ILogger { private _commonLogger; log: (topic: string, ...args: any[]) => Promise; debug: (topic: string, ...args: any[]) => Promise; info: (topic: string, ...args: any[]) => Promise; warn: (topic: string, ...args: any[]) => Promise; setLogger: (logger: ILogger) => void; } declare class CandleProviderService implements IProvider { readonly loggerService: LoggerService; readonly exchangeContextService: { readonly context: IExchangeContext; }; getMarketData(tickerId: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise; getSymbolInfo(tickerId: string): Promise; } declare class PineConnectionService { private readonly loggerService; private PineFactory; getInstance: (...args: ConstructorParameters) => Promise; usePine: (ctor: TPineCtor) => void; clear: () => void; } declare class IndicatorConnectionService { private readonly loggerService; private IndicatorFactory; getInstance: (...args: ConstructorParameters) => Promise; useIndicator: (ctor: TIndicatorCtor) => void; clear: () => void; } declare class PineJobService { readonly loggerService: LoggerService; readonly axisProviderService: AxisProviderService; readonly candleProviderService: CandleProviderService; readonly pineConnectionService: PineConnectionService; readonly indicatorConnectionService: IndicatorConnectionService; run: (code: Code, tickerId: string, timeframe?: CandleInterval, limit?: number, inputs?: Record) => Promise; } declare class PineCacheService { private readonly loggerService; readFile: (path: string, baseDir?: string) => Promise; clear: (path?: string, baseDir?: string) => Promise; } type ResultId = string | number; interface IPlotRow { time: number; [key: string]: number | null; } declare class PineMarkdownService { private readonly loggerService; getData: (plots: PlotModel, mapping: M, limit?: number) => IPlotRow[]; getReport: (signalId: ResultId, plots: PlotModel, mapping: M, limit?: number) => string; dump: (signalId: ResultId, plots: PlotModel, mapping: M, taName: string, outputDir?: string) => Promise; } declare const pine: { pineMarkdownService: PineMarkdownService; pineConnectionService: PineConnectionService; indicatorConnectionService: IndicatorConnectionService; pineCacheService: PineCacheService; pineDataService: PineDataService; pineJobService: PineJobService; axisProviderService: AxisProviderService; candleProviderService: CandleProviderService; loggerService: LoggerService; exchangeContextService: { readonly context: IExchangeContext; }; }; export { AXIS_SYMBOL, type CandleModel, Code, type ExtractedData, type ExtractedDataRow, File, type IIndicator, type ILogger, type IPine, type IProvider, type PlotExtractConfig, type PlotMapping, type PlotModel, type PlotRecord, type SymbolInfoModel, type TIndicatorCtor, type TPineCtor, dumpPlotData, extract, extractRows, getSignal, pine as lib, markdown, run, setLogger, toMarkdown, toSignalDto, useIndicator, usePine };