import { ModalFuncProps } from 'antd/lib/modal';
import React from 'react';
import { IObject, OType } from '../interface';
import { NGObserver } from '../util';
type Dispatch
void> = (action: {
type: string;
payload?: P;
callback?: C;
[key: string]: any;
}) => any;
/**
* 基础组件class库
*/
export declare class NGComponent
extends React.Component
{
_primaryKey: string;
state: S;
outRef: React.RefObject;
_compIns: any;
innerNotify(args: any[], type: string): Promise;
innerSubscribe(fn: Function, type: any, condition?: Function): () => void;
getId(autoCreate?: boolean): string;
static propsToState(nextProps: any, prevState: any, keys?: string[], options?: {
separator?: string;
propToState?: (propKey: string, propValue: any) => any;
}): any;
/**
* 默认浅比较,可以在继承类里面重写该方法
* @param nextProps
* @param nextState
* @param nextContext
*/
shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean;
}
interface BaseComponentLifecycle {
umiDispatch: Dispatch;
getDvaState: (ns?: string) => any;
getLang(): object;
componentAsyncMount?(): Promise;
componentAllReady?(...args: any[]): void;
closeCheck?(): Promise;
}
/**
* 基础页面class实例
*/
export declare class BaseComponent extends NGComponent
implements BaseComponentLifecycle {
private readonly _language;
private _observer;
private customHooks;
OType: typeof OType;
constructor(props: any);
createHooks: () => Promise;
get busType(): any;
get observer(): NGObserver;
componentWillUnmount(): void;
subscribe(fn: Function, type: any, condition?: Function): () => void;
umiDispatch: (action: {
type: string;
} & IObject) => any;
getDvaState: (ns?: string) => any;
getLayout: () => any;
/**
* 多语言
*/
getLang(key?: any, dv?: any): any;
componentAsyncMount(): Promise;
componentAllReady(...args: any[]): void;
/**
* 关闭时检查,返回false或者对象时,弹出关闭提示框
*/
closeCheck(): Promise;
}
export {};