Hierarchy

Constructors

  • Create an instance of RegionsPlugin

    Parameters

    • Optional options: undefined

    Returns default

Properties

options: undefined
regions: SingleRegion[] = []
regionsContainer: HTMLElement
subscriptions: (() => void)[] = []

Type declaration

    • (): void
    • Returns void

wavesurfer?: default

Methods

  • Do not call directly, only called by WavesSurfer internally

    Parameters

    Returns void

  • Parameters

    • region: SingleRegion

    Returns void

  • Destroy the plugin and clean up

    Returns void

  • Emit an event

    Type Parameters

    • EventName extends "destroy" | "region-created" | "region-update" | "region-updated" | "region-removed" | "region-clicked" | "region-double-clicked" | "region-in" | "region-out"

    Parameters

    Returns void

  • Enable creation of regions by dragging on an empty space on the waveform. Returns a function to disable the drag selection.

    Parameters

    • options: Omit<RegionParams, "start" | "end">
    • threshold: number = 3

    Returns (() => void)

      • (): void
      • Enable creation of regions by dragging on an empty space on the waveform. Returns a function to disable the drag selection.

        Returns void

  • Get all created regions

    Returns SingleRegion[]

  • Subscribe to an event. Returns an unsubscribe function.

    Type Parameters

    • EventName extends "destroy" | "region-created" | "region-update" | "region-updated" | "region-removed" | "region-clicked" | "region-double-clicked" | "region-in" | "region-out"

    Parameters

    • event: EventName
    • listener: EventListener<RegionsPluginEvents, EventName>
    • Optional options: {
          once?: boolean;
      }
      • Optional once?: boolean

    Returns (() => void)

      • (): void
      • Subscribe to an event. Returns an unsubscribe function.

        Returns void

  • Called by wavesurfer, don't call manually

    Returns void

  • Subscribe to an event only once

    Type Parameters

    • EventName extends "destroy" | "region-created" | "region-update" | "region-updated" | "region-removed" | "region-clicked" | "region-double-clicked" | "region-in" | "region-out"

    Parameters

    Returns (() => void)

      • (): void
      • Subscribe to an event only once

        Returns void

  • Unsubscribe from an event

    Type Parameters

    • EventName extends "destroy" | "region-created" | "region-update" | "region-updated" | "region-removed" | "region-clicked" | "region-double-clicked" | "region-in" | "region-out"

    Parameters

    Returns void

  • Clear all events

    Returns void

  • Parameters

    • region: SingleRegion
    • container: HTMLElement
    • element: HTMLElement

    Returns void

Generated using TypeDoc