h5p-types
    Preparing search index...

    Class H5PConfirmationDialog

    Hierarchy (View Summary)

    Index
    • Parameters

      • Optionaloptions: {
            cancelText?: string;
            classes?: string[];
            closeText?: string;
            confirmText?: string;
            dialogText?: string;
            headerText?: string;
            hideCancel?: boolean;
            hideExit?: boolean;
            instance?: IH5PContentType<unknown>;
            skipRestoreFocus?: boolean;
            theme?: boolean;
        }
        • OptionalcancelText?: string
        • Optionalclasses?: string[]
        • OptionalcloseText?: string
        • OptionalconfirmText?: string
        • OptionaldialogText?: string
        • OptionalheaderText?: string
        • OptionalhideCancel?: boolean
        • OptionalhideExit?: boolean
        • Optionalinstance?: IH5PContentType<unknown>
        • OptionalskipRestoreFocus?: boolean
        • Optionaltheme?: boolean

          Whether to use the new theme (true) or the old design (false)

      Returns H5PConfirmationDialog

    off: <TData = unknown>(type: string, listener?: (event: TData) => void) => void

    Remove event listener If no listener is specified, all listeners will be removed

    Type Declaration

      • <TData = unknown>(type: string, listener?: (event: TData) => void): void
      • Type Parameters

        • TData = unknown

        Parameters

        • type: string

          Event type

        • Optionallistener: (event: TData) => void

          Event listener

        Returns void

    listener must be a function

    on: <TData = unknown, TType extends string = string>(
        type: TType,
        listener: EventListener<TData, TType>,
        thisArg?: ThisType<unknown>,
    ) => void

    Add new event listener

    Type Declaration

      • <TData = unknown, TType extends string = string>(
            type: TType,
            listener: EventListener<TData, TType>,
            thisArg?: ThisType<unknown>,
        ): void
      • Type Parameters

        • TData = unknown
        • TType extends string = string

        Parameters

        • type: TType

          Event type. If the event type is xAPI, the listener's event parameter will be of type XAPIEvent. Any dispatched XAPIEvent will trigger the xAPI event.

        • listener: EventListener<TData, TType>

          Event listener

        • OptionalthisArg: ThisType<unknown>

          Optionally specify the listener's this value

        Returns void

    listener must be a function

    once: <TData = unknown, TType extends string = string>(
        type: TType,
        listener: EventListener<TData, TType>,
        thisArg?: ThisType<unknown>,
    ) => void

    Add new event listener that will be fired only once

    Type Declaration

      • <TData = unknown, TType extends string = string>(
            type: TType,
            listener: EventListener<TData, TType>,
            thisArg?: ThisType<unknown>,
        ): void
      • Type Parameters

        • TData = unknown
        • TType extends string = string

        Parameters

        • type: TType

          Event type. If the event type is xAPI, the listener's event parameter will be of type XAPIEvent. Any dispatched XAPIEvent will trigger the xAPI event.

        • listener: EventListener<TData, TType>

          Event listener

        • OptionalthisArg: ThisType<unknown>

          Optionally specify the listener's this value

        Returns void

    listener must be a function

    trigger: <TData = unknown>(
        event: unknown,
        eventData?: TData,
        extras?: { bubbles?: boolean; external?: boolean },
    ) => void

    Dispatch event

    Type Declaration

      • <TData = unknown>(
            event: unknown,
            eventData?: TData,
            extras?: { bubbles?: boolean; external?: boolean },
        ): void
      • Type Parameters

        • TData = unknown

        Parameters

        • event: unknown

          Event object or event type as string

        • OptionaleventData: TData

          Custom event data (used when event type as string is used as first argument)

        • Optionalextras: { bubbles?: boolean; external?: boolean }

        Returns void

    triggerXAPI: (verb: XAPIVerb, extra: unknown) => void
    • Returns HTMLElement

      The ConfirmationDialog HTML element

    • Returns HTMLElement

      The element that had focus before the ConfirmationDialog was opened

    • Mark the activity as started. Triggers the attempted xAPI event the first time it's called for an instance.

      Returns void

    • Parameters

      • minimumHeight: number | null

      Returns void

    • Helper function to create xAPI completed events.

      Parameters

      • score: number
      • maxScore: number
      • success: boolean

      Returns void

      Use triggerXAPIScored instead

    • Helper function to create scored xAPI events

      Parameters

      • score: number

        Will be set as the 'raw' value of the score object

      • maxScore: number

        Will be set as the "max" value of the score object

      • verb: XAPIVerb

        Short form of adl verb

      • completion: boolean

        Is this a statement from a completed activity?

      • success: boolean

        Is this a statement from an activity that was done successfully?

      Returns void