import * as react from 'react';
import { ForwardedRef, FC } from 'react';
import { SharePnLConfig } from '@orderly.network/ui-share';
import * as _orderly_network_ui from '@orderly.network/ui';
import { Table } from '@orderly.network/ui';
import * as _orderly_network_types from '@orderly.network/types';
import { OrderStatus, API, OrderSide } from '@orderly.network/types';
import * as react_jsx_runtime from 'react/jsx-runtime';

type OrderListInstance = {
    download?: () => void;
};
type useOrderListScriptOptions = {
    type: TabType;
    ordersStatus?: OrderStatus;
    symbol?: string;
    enableLoadMore?: boolean;
    onSymbolChange?: (symbol: API.Symbol) => void;
    sharePnLConfig?: SharePnLConfig;
    filterConfig?: {
        side?: OrderSide | "all";
        range?: {
            from?: Date;
            to?: Date;
        };
    };
    pnlNotionalDecimalPrecision?: number;
    ref?: ForwardedRef<OrderListInstance>;
};
declare const useOrderListScript: (props: useOrderListScriptOptions) => {
    type: TabType;
    dataSource: any[] | undefined;
    isLoading: boolean;
    loadMore: () => void;
    cancelOrder: (orderId: number, symbol?: string) => Promise<any>;
    updateOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
    cancelAlgoOrder: (orderId: number, symbol?: string) => Promise<any>;
    updateAlgoOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
    pagination: _orderly_network_ui.PaginationMeta | {
        page: number;
        pageSize: number;
        onPageChange: react.Dispatch<react.SetStateAction<number>>;
        onPageSizeChange: (size: number) => void;
    };
    manualPagination: boolean;
    pnlNotionalDecimalPrecision: number | undefined;
    onFilter: (filter: {
        name: string;
        value: any;
    }) => void;
    filterItems: any[];
    onCancelAll: () => void;
    onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
    sharePnLConfig: SharePnLConfig | undefined;
    tableInstance: react.MutableRefObject<Table<any> | undefined>;
    symbolsInfo: {
        [x: string]: (key?: keyof API.SymbolExt | undefined, defaultValue?: (string | number) | undefined) => any;
    } & {
        isNil: boolean;
    };
};
type OrdersBuilderState$1 = ReturnType<typeof useOrderListScript>;

declare enum TabType {
    all = "all",
    pending = "pending",
    tp_sl = "tp_sl",
    filled = "filled",
    cancelled = "cancelled",
    rejected = "rejected",
    orderHistory = "orderHistory"
}
type OrdersWidgetProps = {
    current?: TabType;
    pnlNotionalDecimalPrecision?: number;
    sharePnLConfig?: SharePnLConfig;
};
declare const OrdersWidget: react.ForwardRefExoticComponent<OrdersWidgetProps & react.RefAttributes<OrderListInstance>>;

type UseOrdersScriptOptions = {
    current?: TabType;
    pnlNotionalDecimalPrecision?: number;
    ref: ForwardedRef<OrderListInstance>;
    sharePnLConfig?: SharePnLConfig;
};
declare const useOrdersScript: (props: UseOrdersScriptOptions) => {
    current: TabType | undefined;
    pnlNotionalDecimalPrecision: number | undefined;
    orderListRef: react.RefObject<OrderListInstance>;
    sharePnLConfig: SharePnLConfig | undefined;
};
type OrdersBuilderState = ReturnType<typeof useOrdersScript>;

declare const DesktopOrderList: FC<OrdersBuilderState$1 & {
    testIds?: {
        tableBody?: string;
    };
}>;
declare const MobileOrderList: FC<OrdersBuilderState$1 & {
    classNames?: {
        root?: string;
        cell?: string;
        content?: string;
    };
    showFilter?: boolean;
}>;

type DesktopOrderListWidgetProps = {
    type: TabType;
    ordersStatus?: OrderStatus;
    /** if has value, will be fetch current symbol orders*/
    symbol?: string;
    onSymbolChange?: (symbol: API.Symbol) => void;
    pnlNotionalDecimalPrecision?: number;
    sharePnLConfig?: SharePnLConfig;
    testIds?: {
        tableBody?: string;
    };
};
declare const DesktopOrderListWidget: react.ForwardRefExoticComponent<DesktopOrderListWidgetProps & react.RefAttributes<OrderListInstance>>;
declare const MobileOrderListWidget: (props: {
    type: TabType;
    ordersStatus?: OrderStatus;
    /** if has value, will be fetch current symbol orders*/
    symbol?: string;
    onSymbolChange?: (symbol: API.Symbol) => void;
    sharePnLConfig?: SharePnLConfig;
    classNames?: {
        root?: string;
        cell?: string;
        content?: string;
    };
    showFilter?: boolean;
    filterConfig?: {
        side?: OrderSide | "all";
        range?: {
            from?: Date;
            to?: Date;
        };
    };
}) => react_jsx_runtime.JSX.Element;

export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type OrderListInstance, type OrdersBuilderState, OrdersWidget, TabType, useOrderListScript, useOrdersScript };
