Skip to content

Commit

Permalink
Fix: export Region class instead of type
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Oct 15, 2023
1 parent 5c82b24 commit 8cef5b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/plugins/regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export type RegionParams = {
channelIdx?: number
}

class SingleRegion extends EventEmitter<RegionEvents> {
export class Region extends EventEmitter<RegionEvents> {
public element: HTMLElement
public id: string
public start: number
Expand Down Expand Up @@ -463,7 +463,7 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions

const duration = this.wavesurfer.getDuration()
const numberOfChannels = this.wavesurfer?.getDecodedData()?.numberOfChannels
const region = new SingleRegion(options, duration, numberOfChannels)
const region = new Region(options, duration, numberOfChannels)

if (!duration) {
this.subscriptions.push(
Expand Down Expand Up @@ -516,7 +516,7 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions
const end = ((x + initialSize) / width) * duration

// Create a region but don't save it until the drag ends
region = new SingleRegion(
region = new Region(
{
...options,
start,
Expand Down Expand Up @@ -552,4 +552,3 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions
}

export default RegionsPlugin
export type Region = SingleRegion

0 comments on commit 8cef5b9

Please sign in to comment.