Perseus
    Preparing search index...

    The Widget type represents the common API that the Renderer uses to interact with all widgets. All widgets must implement the methods in this API, unless they are marked as optional (?: ...).

    These methods are called on the widget ref and allow the renderer to communicate with the individual widgets to coordinate actions such as scoring, state serialization/deserialization, and focus management.

    interface Widget {
        blurInputPath?: (path: FocusPath) => void;
        focus?: () => boolean | { id: string; path: FocusPath };
        focusInputPath?: (path: FocusPath) => void;
        getDOMNodeForPath?: (path: FocusPath) => Element | Text | null;
        getInputPaths?: () => readonly FocusPath[];
        getPromptJSON?: () => WidgetPromptJSON;
        getSerializedState?: () => SerializedState;
        isWidget?: true;
    }
    Index

    Properties

    blurInputPath?: (path: FocusPath) => void
    focus?: () => boolean | { id: string; path: FocusPath }
    focusInputPath?: (path: FocusPath) => void
    getDOMNodeForPath?: (path: FocusPath) => Element | Text | null
    getInputPaths?: () => readonly FocusPath[]
    getPromptJSON?: () => WidgetPromptJSON
    getSerializedState?: () => SerializedState
    • do not use in new code.
    isWidget?: true

    don't use isWidget; it's just a dummy property to help TypeScript's weak typing to recognize non-interactive widgets as Widgets