UNPKG

@openshift-console/dynamic-plugin-sdk

Version:

Provides core APIs, types and utilities used by dynamic plugins at runtime.

43 lines (42 loc) 2.18 kB
import { Extension, ExtensionDeclaration, CodeRef } from '../types'; import { K8sResourceCommon } from './console-types'; /** This extension can be used to specify additional properties that will be used when creating PVC resources on the PVC list page. */ export type PVCCreateProp = ExtensionDeclaration<'console.pvc/create-prop', { /** Label for the create prop action. */ label: string; /** Path for the create prop action. */ path: string; }>; /** This extension can be used to contribute custom alerts on the PVC details page. */ export type PVCAlert = ExtensionDeclaration<'console.pvc/alert', { /** The alert component. */ alert: CodeRef<React.ComponentType<{ pvc: K8sResourceCommon; }>>; }>; /** This extension can be used to contribute an additional status component for PVC resources on the cluster dashboard page. */ export type PVCStatus = ExtensionDeclaration<'console.pvc/status', { /** Priority for the status component. Bigger value means higher priority. */ priority: number; /** The status component. */ status: CodeRef<React.ComponentType<{ pvc: K8sResourceCommon; }>>; /** Predicate that tells whether to render the status component or not. */ predicate: CodeRef<(pvc: K8sResourceCommon) => boolean>; }>; /** This extension allows hooking into deleting PVC resources. It can provide an alert with additional information and custom PVC delete logic. */ export type PVCDelete = ExtensionDeclaration<'console.pvc/delete', { /** Predicate that tells whether to use the extension or not. */ predicate: CodeRef<(pvc: K8sResourceCommon) => boolean>; /** Method for the PVC delete operation. */ onPVCKill: CodeRef<(pvc: K8sResourceCommon) => Promise<void>>; /** Alert component to show additional information. */ alert: CodeRef<React.ComponentType<{ pvc: K8sResourceCommon; }>>; }>; export declare const isPVCCreateProp: (e: Extension) => e is PVCCreateProp; export declare const isPVCAlert: (e: Extension) => e is PVCAlert; export declare const isPVCStatus: (e: Extension) => e is PVCStatus; export declare const isPVCDelete: (e: Extension) => e is PVCDelete;