# Interface Playlist<T>

interface Playlist<T> {
add(items, index?): T[];
getCurrentIndex(): number;
getCurrentItem(): null | T;
getItems(): T[];
getLastIndex(): number;
getNextIndex(): number;
getPreviousIndex(): number;
moveTo(index): boolean;
moveToFirst(): boolean;
moveToLast(): boolean;
moveToNext(): boolean;
moveToPrevious(): boolean;
remove(index, count): T[];
reset(): void;
reverse(): void;
shuffle(options?): void;
sort(compare): void;
updateConfiguration(configuration): void;
}

#### Type Parameters

- T

#####
Index

### Methods

add
getCurrentIndex
getCurrentItem
getItems
getLastIndex
getNextIndex
getPreviousIndex
moveTo
moveToFirst
moveToLast
moveToNext
moveToPrevious
remove
reset
reverse
shuffle
sort
updateConfiguration

## Methods

### add

- add(items, index?): T[]

- #### Parameters

  - items: T[]
  - `Optional` index: number

  #### Returns T[]

### getCurrentIndex

- getCurrentIndex(): number

- #### Returns number

### getCurrentItem

- getCurrentItem(): null | T

- #### Returns null | T

### getItems

- getItems(): T[]

- #### Returns T[]

### getLastIndex

- getLastIndex(): number

- #### Returns number

### getNextIndex

- getNextIndex(): number

- #### Returns number

### getPreviousIndex

- getPreviousIndex(): number

- #### Returns number

### moveTo

- moveTo(index): boolean

- #### Parameters

  - index: number

  #### Returns boolean

### moveToFirst

- moveToFirst(): boolean

- #### Returns boolean

### moveToLast

- moveToLast(): boolean

- #### Returns boolean

### moveToNext

- moveToNext(): boolean

- #### Returns boolean

### moveToPrevious

- moveToPrevious(): boolean

- #### Returns boolean

### remove

- remove(index, count): T[]

- #### Parameters

  - index: number
  - count: number

  #### Returns T[]

### reset

- reset(): void

- #### Returns void

### reverse

- reverse(): void

- #### Returns void

### shuffle

- shuffle(options?): void

- #### Parameters

  - `Optional` options: PlaylistShuffleOptions

  #### Returns void

### sort

- sort(compare): void

- #### Parameters

  - compare: ((a, b) => number)
    - - (a, b): number

      - #### Parameters

        - a: T
        - b: T

        #### Returns number

  #### Returns void

### updateConfiguration

- updateConfiguration(configuration): void

- #### Parameters

  - configuration: PlaylistConfiguration

  #### Returns void