@kinvolk/headlamp-plugin
Version:
The needed infrastructure for building Headlamp plugins.
43 lines (42 loc) • 2.26 kB
TypeScript
import '../../../i18n/config';
import React from 'react';
import { KubeObjectInterface } from '../../../lib/k8s/KubeObject';
import { DialogProps } from '../Dialog';
type KubeObjectIsh = Partial<KubeObjectInterface>;
export interface EditorDialogProps extends DialogProps {
/** The object(s) to edit, or null to make the dialog be in "loading mode". Pass it an empty object if no contents are to be shown when the dialog is first open. */
item: KubeObjectIsh | object | object[] | string | null;
/** Called when the dialog is closed. */
onClose: () => void;
/** Called by a component for when the user clicks the save button. When set to "default", internal save logic is applied. */
onSave?: ((...args: any[]) => void) | 'default' | null;
/** Called when the editor's contents change. */
onEditorChanged?: ((newValue: string) => void) | null;
/** The function to open the dialog. */
setOpen?: (open: boolean) => void;
allowToHideManagedFields?: boolean;
/** The label to use for the save button. */
saveLabel?: string;
/** The error message to display. */
errorMessage?: string;
/** The dialog title. */
title?: string;
/** Extra optional actions. */
actions?: React.ReactNode[];
/** Extra buttons rendered in the right-side toolbar next to the editor toggles. */
toolbarActions?: React.ReactNode[];
/** Content to render in a "Form" tab between Editor and Documentation. */
formContent?: React.ReactNode;
/** Don't render the editor in the dialog */
noDialog?: boolean;
/** When true, changes to `item` update the editor code but do not reset the
* original-code baseline, so the Save button treats the new content as a
* user edit. Useful when a form pushes updated YAML into the editor. */
treatItemChangesAsEdits?: boolean;
/** Override the target cluster for apply operations. When set, this takes
* priority over `item.cluster` and the URL-derived cluster. */
cluster?: string;
}
export default function EditorDialog(props: EditorDialogProps): import("react/jsx-runtime").JSX.Element | null;
export declare function ViewDialog(props: Omit<EditorDialogProps, 'onSave'>): import("react/jsx-runtime").JSX.Element;
export {};