This repository has been archived on 2022-09-16. You can view files and clone it, but cannot push or open issues/pull-requests.
tlaternet-templates/src/music/store/music/types.ts

34 lines
841 B
TypeScript
Raw Normal View History

import { Action, createAction } from "redux-act";
export interface Title {
2021-04-07 23:23:21 +01:00
name: string;
artist: string;
album: string;
/**
* The length of the title in nanoseconds.
*/
length: number;
}
export interface MusicState {
2021-04-07 23:23:21 +01:00
muted: boolean;
playing: boolean;
title: Title;
playTime: number;
source?: string;
}
2021-04-07 23:14:42 +01:00
export const setTitle: (_title: Title) => Action<null, null> = createAction(
2021-04-07 23:23:21 +01:00
"set currently playing title"
);
2022-08-01 21:43:50 +01:00
export const setPlayTime: (_time: number) => Action<null, null> =
createAction("set the play time");
export const toggleMute: () => Action<null, null> = createAction("toggle mute");
export const togglePlay: () => Action<null, null> = createAction("toggle play");
2022-08-01 21:43:50 +01:00
export const setSource: (_source: string) => Action<null, null> =
createAction("set the title");