Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (38 loc) · 1.03 KB

readme.md

File metadata and controls

40 lines (38 loc) · 1.03 KB

Kernel Settings

Simple settings module for kernel with an API out of the box.

Interface

interface SettingsSection {
    section: "DIVIDER" | "CUSTOM" | string;
    element?(): React.ReactElement;
    label?: string;
    id?: string;
    className?: string;
} 

interface SectionOptions {
    render(): React.ReactElement;
    className?: string;
}

interface KernelSettings {
    /**
     * Registers a tab in the settings section below "Kernel".
     * @param name Represents the name of the tab, will also be the label.
     * @param render Render/Options for the tab. See {@link SettingsOptions}
     */
    register(name: string, render: (() => React.ReactElement) | SectionOptions): () => boolean;
    /**
     * Represents all registered panels.
     */
    panels: SettingsSection[];
    private initialize(): void;
}

Usage

KernelSettings.register("MyAwesomeTab", () => <p>Hi :p</p>);
// or
KernelSettings.register("MyAwesomeTab", {
    render: () => <p>Hi :p</p>,
    className: "my-className-will-be-visible-in-dom"
});