import { KisAccountNumber } from "./account-number.js"; import { KisAuth, KisKey } from "./auth.js"; import { KisCacheStorage } from "./cache.js"; import { type KisConfigOptions } from "./config.js"; import { AccountScope, StockScope } from "./scopes.js"; import { KisAccessToken } from "./token.js"; import { type ChartPeriod, type DomainType, type KisCurrencyChart, type KisRanking, type KisRankingMarketCode } from "./types.js"; import { type AnyRecord } from "./utils.js"; import { KisWebsocketClient } from "./websocket.js"; export interface FormLike { build(target?: Record): Record; } export interface PyKisOptions { auth?: string | KisAuth; virtualAuth?: string | KisAuth; id?: string; account?: string | KisAccountNumber; appkey?: string | KisKey; secretkey?: string; token?: KisAccessToken | string; virtualId?: string; virtualAppkey?: string | KisKey; virtualSecretkey?: string; virtualToken?: KisAccessToken | string; keepToken?: boolean | string; virtual?: boolean; useWebsocket?: boolean; fetcher?: typeof fetch; userAgent?: string; custType?: string; realDomain?: string; virtualDomain?: string; realWebsocketDomain?: string; virtualWebsocketDomain?: string; } export interface RequestOptions { method?: "GET" | "POST"; params?: Record; body?: Record; form?: Array; headers?: Record; domain?: DomainType; appkeyLocation?: "header" | "body" | null; formLocation?: "header" | "params" | "body" | null; auth?: boolean; hashkey?: boolean | "auto"; } export interface FetchOptions extends RequestOptions { api?: string; continuous?: boolean; mapper?: (data: AnyRecord, response: Response) => T | Promise; } export declare class PyKis { #private; primaryAccount?: KisAccountNumber; readonly cache: KisCacheStorage; readonly fetcher: typeof fetch; readonly websocket?: KisWebsocketClient; readonly defaultDomain: DomainType; readonly userAgent: string; readonly custType: string; readonly domains: Record; readonly websocketDomains: Record; constructor(options: PyKisOptions); static create(options: PyKisOptions): Promise; static fromConfig(path?: string, options?: KisConfigOptions): Promise; get virtual(): boolean; get primary(): KisAccountNumber; account(account?: string | KisAccountNumber, primary?: boolean): AccountScope; stock(symbol: string, market?: Parameters[0], account?: string | KisAccountNumber): StockScope; currencyDailyChart(symbol?: string, options?: { start?: Date | string; end?: Date | string; period?: ChartPeriod; }): Promise; rankingMarketCap(options?: { market?: KisRankingMarketCode; targetClassCode?: string; excludeClassCode?: string; }): Promise; rankingVolume(options?: { market?: KisRankingMarketCode; targetClassCode?: string; excludeClassCode?: string; }): Promise; rankingFluctuation(options?: { market?: KisRankingMarketCode; targetClassCode?: string; excludeClassCode?: string; }): Promise; request(path: string, options?: RequestOptions): Promise; fetch(path: string, options?: FetchOptions): Promise; discard(domain?: DomainType): Promise; close(): Promise; private keyFor; apiDomain(domain: DomainType): string; websocketDomain(domain: DomainType): string; private loadCachedTokens; private saveCachedToken; private tokenFileName; private revokeTokenFromAccessToken; }