@openshift-console/dynamic-plugin-sdk
Version:
Provides core APIs, types and utilities used by dynamic plugins at runtime.
24 lines (23 loc) • 750 B
TypeScript
export type UtilsConfig = {
/**
* Resource fetch implementation provided by the host application.
*
* Applications must validate the response before resolving the Promise.
*
* If the request cannot be completed successfully, the Promise should be rejected
* with an appropriate error.
*/
appFetch: (url: string, options?: RequestInit) => Promise<Response>;
};
/**
* Set the {@link UtilsConfig} reference.
*
* This must be done before using any of the Kubernetes utilities.
*/
export declare const setUtilsConfig: (c: UtilsConfig) => void;
/**
* Get the {@link UtilsConfig} reference.
*
* Throws an error if the reference isn't already set.
*/
export declare const getUtilsConfig: () => UtilsConfig;