Perseus
    Preparing search index...

    Type Alias WidgetOptions<Type, Options>

    The type representing the common structure of all widget's options. The Options generic type represents the widget-specific option data.

    type WidgetOptions<Type extends string, Options extends Record<string, any>> = {
        alignment?: string;
        graded?: boolean;
        key?: number | null;
        options: Options;
        static?: boolean;
        type: Type;
        version?: Version;
    }

    Type Parameters

    • Type extends string
    • Options extends Record<string, any>
    Index

    Properties

    alignment?: string

    The HTML alignment of the widget. "default" or "block".

    If the alignment is "default", it gets the default alignment from the widget logic, which can be various other alignments (e.g. "inline-block", "inline", etc).

    graded?: boolean

    Whether a widget is scored. Usually true except for IFrame widgets (deprecated). Default: true

    key?: number | null

    Only used by interactive child widgets (line, point, etc) to identify the components

    options: Options

    Options specific to the type field of the widget. See Perseus*WidgetOptions for more details

    static?: boolean

    Whether this widget is displayed with the values and is immutable. For display only.

    type: Type

    The "type" of widget which will define what the Options field looks like.

    version?: Version

    The version of the widget data spec. Used to differentiate between newer and older content data. The parsers (parseAndMigratePerseusItem, parseAndMigratePerseusArticle, or parseAndMigratePerseusRenderer) will upgrade non-current versions of widget options to the latest.