mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-07 11:45:35 +00:00
move interfaces to interfaces.ts
This commit is contained in:
parent
d98257de90
commit
ead3a731ef
@ -1,3 +1,4 @@
|
|||||||
|
import { Track } from './../interfaces';
|
||||||
import Router from "../router";
|
import Router from "../router";
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
@ -14,7 +15,7 @@ interface Option {
|
|||||||
* @return {Array<Option>} a list of context menu items.
|
* @return {Array<Option>} a list of context menu items.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default (track: any): Array<Option> => {
|
export default (track: Track): Array<Option> => {
|
||||||
const option1: Option = {
|
const option1: Option = {
|
||||||
label: "Add to Playlist",
|
label: "Add to Playlist",
|
||||||
action: () => console.log("Add to Playlist"),
|
action: () => console.log("Add to Playlist"),
|
||||||
@ -62,18 +63,18 @@ export default (track: any): Array<Option> => {
|
|||||||
critical: true,
|
critical: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const sep: Option = {
|
const separator: Option = {
|
||||||
type: "separator",
|
type: "separator",
|
||||||
};
|
};
|
||||||
|
|
||||||
const options: Option[] = [
|
const options: Option[] = [
|
||||||
option1,
|
option1,
|
||||||
option2,
|
option2,
|
||||||
sep,
|
separator,
|
||||||
option3,
|
option3,
|
||||||
option4,
|
option4,
|
||||||
option5,
|
option5,
|
||||||
sep,
|
separator,
|
||||||
option6,
|
option6,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
32
src/interfaces.ts
Normal file
32
src/interfaces.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
interface Track {
|
||||||
|
trackid: string;
|
||||||
|
title: string;
|
||||||
|
album?: string;
|
||||||
|
artists: string[];
|
||||||
|
albumartist?: string;
|
||||||
|
folder?: string;
|
||||||
|
filepath?: string;
|
||||||
|
length?: number;
|
||||||
|
bitrate?: number;
|
||||||
|
genre?: string;
|
||||||
|
image: string;
|
||||||
|
tracknumber?: number;
|
||||||
|
discnumber?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AlbumInfo {
|
||||||
|
album: string;
|
||||||
|
artist: string;
|
||||||
|
count: number;
|
||||||
|
duration: number;
|
||||||
|
date: string;
|
||||||
|
artistimage: string;
|
||||||
|
image: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Artist {
|
||||||
|
name: string;
|
||||||
|
image: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Track, AlbumInfo, Artist };
|
Loading…
x
Reference in New Issue
Block a user