@openshift-console/dynamic-plugin-sdk
Version:
Provides core APIs, types and utilities used by dynamic plugins at runtime.
17 lines (16 loc) • 935 B
TypeScript
import { K8sModel } from '../../../api/common-types';
import { UseK8sModel, K8sResourceKindReference, K8sGroupVersionKind } from '../../../extensions/console-types';
export declare const getK8sModel: (k8s: any, k8sGroupVersionKind?: K8sResourceKindReference | K8sGroupVersionKind) => K8sModel;
/**
* Hook that retrieves the k8s model for provided K8sGroupVersionKind from redux.
* @param groupVersionKind group, version, kind of k8s resource `K8sGroupVersionKind` is preferred alternatively can pass reference for group, version, kind which is deprecated i.e `group~version~kind` `K8sResourceKindReference`.
* @returns An array with the first item as k8s model and second item as inFlight status
* @example
* ```ts
* const Component: React.FC = () => {
* const [model, inFlight] = useK8sModel({ group: 'app'; version: 'v1'; kind: 'Deployment' });
* return ...
* }
* ```
*/
export declare const useK8sModel: UseK8sModel;