/**
 * Created by rburson on 2/10/16.
 */
import * as React from 'react';
import { CvState, CvProps, CvContext, CvEvent, CvEventRegistry, CvNavigationResult, CvActionFiredResult, CvValueProvider, CvResultCallback, CvStateChangeResult } from './catreact-core';
import { PaneContext, MenuDef } from 'catavolt-sdk';
import { CvValueListener } from "./CvReact";
export interface CvActionBaseProps extends CvProps {
    /**
     * The actionId of this action
     */
    actionId?: string;
    /**
     * Array of {@link CvListener}s that will be notified of any actions fired
     */
    actionListeners?: Array<(event: CvEvent<CvActionFiredResult>) => void>;
    /**
     * The sdk {MenuDef} that points to this action. If not specified the containing sdk {PaneContext} will
     * be searched for the matching MenuDef
     */
    menuDef?: MenuDef;
    /**
     * Register to receive {@link CvEvent}s of type {@link CvNavigationResult}
     */
    navigationListeners?: Array<(event: CvEvent<CvNavigationResult>) => void>;
    /**
     * Provide a target for any navigations that originate from this action.  The navTarget should
     * correspond to the 'targetId' value of the coresident {@link CvNavigation} or {@link CvNavigator}.
     * This is useful for single page apps where components may be coresident.
     */
    navTarget?: string;
    /**
     * The sdk {PaneContext} associated with this action.  If not specified, the context chain will be upwardly
     * searched to find a component with a containing sdk {PaneContext} scopeObj
     */
    paneContext?: PaneContext;
    /**
     * Provides any target values that may have been 'selected' when firing this action
     */
    selectionProvider?: CvValueProvider<Array<string>>;
    /**
     * Render override function.  It should accept the following params:
     * @param cvContext The current cvContext.  The cvContext.cvScope.scopeObj will be the sdk {MenuDef} object
     * @param callback A callback for firing the action
     */
    renderer?: (cvContext: CvContext, callback?: CvActionCallback) => {};
    /**
     * Name of the wrapping element (should be html tag)
     */
    wrapperElemName?: string;
    /**
     * Props for the wrapping element
     */
    wrapperElemProps?: any;
    /**
     * Register to receive {@link CvEvent}s of type {@link CvStateChangeResult}
     */
    stateChangeListeners?: Array<(event: CvEvent<CvStateChangeResult>) => void>;
    /**
     * Allows the specification of a handler for 'client' side actions.  This is a special class of actions
     * that require some type of special processing by the client. (i.e. #search, #refresh, #calulateStatistics, etc.)
     */
    actionHandler?: CvValueListener<CvActionHandlerParams>;
}
export interface CvActionHandlerParams {
    event: CvEvent<CvActionFiredResult>;
    callback: CvResultCallback<any>;
}
export interface CvActionCallback {
    fireAction(): void;
}
export declare var CvActionBase: {
    findPaneContextWithActionId: (actionId: string) => PaneContext;
    getSelectedTargets: () => any;
    paneContext: () => any;
    menuDef: () => any;
    performAction: () => void;
    _checkDestroyed: (paneContext: PaneContext) => void;
    _getCallbackObj: () => CvActionCallback;
    _getActionMeta: (actionId: string) => {
        isClientAction: any;
        noTransition: any;
    };
    _publishActionStarted: (actionId: string, source: PaneContext, clientAction: boolean, actionListeners: ((event: CvEvent<CvActionFiredResult>) => void)[], eventRegistry: CvEventRegistry) => CvEvent<CvActionFiredResult>;
    _publishActionFinished: (actionId: string, source: PaneContext, actionListeners: ((event: CvEvent<CvActionFiredResult>) => void)[], eventRegistry: CvEventRegistry) => CvEvent<CvActionFiredResult>;
};
export interface CvActionState extends CvState {
}
export interface CvActionProps extends CvActionBaseProps {
}
export declare var CvAction: React.ClassicComponentClass<CvActionProps>;
