@openshift-console/dynamic-plugin-sdk
Version:
Provides core APIs, types and utilities used by dynamic plugins at runtime.
20 lines (19 loc) • 734 B
TypeScript
import * as React from 'react';
import type { ReactNode } from 'react';
import { UnknownProps } from '../common-types';
type CloseOverlay = () => void;
type CloseOverlayContextValue = (id: string) => void;
export type OverlayComponent<P = UnknownProps> = React.FC<P & {
closeOverlay: CloseOverlay;
}>;
export type LaunchOverlay = <P = UnknownProps>(component: OverlayComponent<P>, extraProps: P) => void;
type OverlayContextValue = {
launchOverlay: LaunchOverlay;
closeOverlay: CloseOverlayContextValue;
};
export declare const OverlayContext: React.Context<OverlayContextValue>;
interface OverlayProviderProps {
children?: ReactNode;
}
export declare const OverlayProvider: React.FC<OverlayProviderProps>;
export {};