import React from 'react'; import type { ActionObject, IScopedContext } from 'jamis-core'; import { ScopedContext } from 'jamis-core'; import type { RenderSlotBodyType, TabSchema, TabSource, TabsProps } from '../types'; interface TabsState { activeKey: string | number; prevKey: any; localTabs: Array; /** * 是否从 source 数据中生成 */ isFromSource: boolean; } export declare class TabsRenderer extends React.Component { static defaultProps: Partial; static contextType: React.Context>>; context: React.ContextType; renderTab?: (tab: TabSchema, props: TabsProps, index: number) => JSX.Element; activeKey?: string | number; constructor(props: TabsProps, context: IScopedContext); componentWillUnmount(): void; /** * 根据当前地址栏的hash和qs来匹配activeKey */ getActiveKeyFromLocation: (location: any, tabs: TabsProps["tabs"]) => string | number | undefined; /** * 初始化 tabs 数组,当从 source 获取数据源时 */ initTabArray: (tabs: Array, source?: string, data?: any) => [Array, boolean]; componentDidMount(): void; componentDidUpdate(prevProps: TabsProps, prevState: TabsState): void; /** * 同步hash或者qs到地址栏 */ syncLocation: (activeKey: string | number | undefined, localTabs: TabsProps["tabs"]) => void; resolveTabByKey(key: string | number | undefined): TabSource | undefined; resolveKeyByValue(value: any): string | number | undefined; autoJumpToNeighbour: (key: string | number | undefined) => void; handleAdd: (tab?: TabSchema, switchTo?: boolean) => Promise; /** * 处理新增或者激活指定的tab, 当tabKey存在时激活, 不存在时新增tab */ handleAddOrActiveTab: (tab: TabSchema) => Promise; /** * 刷新tab */ handleRefreshTab: (index: number) => void; handleClose: (key: string | number, activeKeyAfterClose?: string | number) => Promise; handleEdit: (index: number, text: string) => void; handleDragChange: (e: any) => Promise; handleSelect: (key: number | string | undefined) => Promise; /** * 动作处理 */ doAction(action: ActionObject, args?: any): Promise; switchTo: (index: number) => void; currentIndex: () => number; renderToolbar(): JSX.Element | null; renderTabContent: (tab: TabSource, index: number) => JSX.Element; renderSlotBody: RenderSlotBodyType; renderTabs(): JSX.Element; render(): JSX.Element; } export {};