mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 02:57:30 +00:00
Cleanup types
This commit is contained in:
parent
5587947c7e
commit
b616989eda
9 changed files with 43 additions and 15 deletions
|
|
@ -14,6 +14,7 @@ export {
|
|||
ButterchurnOptions,
|
||||
Track,
|
||||
AppState,
|
||||
PartialState,
|
||||
URLTrack,
|
||||
FilePicker,
|
||||
Action,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import { Track, AppState, URLTrack } from "./Webamp";
|
||||
import { Track, URLTrack, PartialState } from "./Webamp";
|
||||
// @ts-ignore
|
||||
import llamaAudio from "../mp3/llama-2.91.mp3";
|
||||
import { DeepPartial } from "redux";
|
||||
|
||||
interface Config {
|
||||
initialTracks?: Track[];
|
||||
audioUrl?: string;
|
||||
skinUrl?: string;
|
||||
disableMarquee?: boolean;
|
||||
initialState?: DeepPartial<AppState>;
|
||||
initialState?: PartialState;
|
||||
}
|
||||
|
||||
const { hash } = window.location;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { DeepPartial } from "redux";
|
||||
import { AppState } from "./Webamp";
|
||||
import { PartialState } from "./Webamp";
|
||||
|
||||
const defaultTracksState = {
|
||||
"0": {
|
||||
|
|
@ -44,7 +43,7 @@ const defaultTracksState = {
|
|||
},
|
||||
};
|
||||
|
||||
const initialState: DeepPartial<AppState> = {
|
||||
const initialState: PartialState = {
|
||||
equalizer: {
|
||||
sliders: {
|
||||
"60": 52,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createStore, applyMiddleware, DeepPartial } from "redux";
|
||||
import { createStore, applyMiddleware } from "redux";
|
||||
import thunk from "redux-thunk";
|
||||
import { composeWithDevTools } from "redux-devtools-extension";
|
||||
import reducer from "./reducers";
|
||||
|
|
@ -7,7 +7,7 @@ import { merge } from "./utils";
|
|||
import { UPDATE_TIME_ELAPSED, STEP_MARQUEE } from "./actionTypes";
|
||||
import Media from "./media";
|
||||
import Emitter from "./emitter";
|
||||
import { Extras, Dispatch, Action, AppState, Middleware } from "./types";
|
||||
import { Extras, Dispatch, Action, Middleware, PartialState } from "./types";
|
||||
|
||||
// TODO: Move to demo
|
||||
const compose = composeWithDevTools({
|
||||
|
|
@ -18,7 +18,7 @@ export default function (
|
|||
media: Media,
|
||||
actionEmitter: Emitter,
|
||||
customMiddlewares: Middleware[] = [],
|
||||
stateOverrides: DeepPartial<AppState> | undefined,
|
||||
stateOverrides: PartialState | undefined,
|
||||
extras: Extras
|
||||
) {
|
||||
let initialState;
|
||||
|
|
|
|||
|
|
@ -666,6 +666,8 @@ export interface AppState {
|
|||
milkdrop: MilkdropState;
|
||||
}
|
||||
|
||||
export type PartialState = any;
|
||||
|
||||
/**
|
||||
* Type definition of the music-metadata-browser module.
|
||||
* Ref: https://github.com/Borewit/music-metadata-browser/blob/master/src/index.ts
|
||||
|
|
@ -732,7 +734,6 @@ export interface Store extends ReduxStore {
|
|||
subscribe(cb: () => void): () => void;
|
||||
dispatch: Dispatch;
|
||||
getState: GetState;
|
||||
replaceReducer(reducer: Reducer): void;
|
||||
}
|
||||
|
||||
export interface MiddlewareStore {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
Middleware,
|
||||
WindowPosition,
|
||||
ButterchurnOptions,
|
||||
PartialState,
|
||||
} from "./types";
|
||||
import getStore from "./store";
|
||||
import App from "./components/App";
|
||||
|
|
@ -37,7 +38,6 @@ import Emitter from "./emitter";
|
|||
|
||||
import { SerializedStateV1 } from "./serializedStates/v1Types";
|
||||
import Disposable from "./Disposable";
|
||||
import { DeepPartial } from "redux";
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
|
|
@ -123,7 +123,7 @@ export interface PrivateOptions {
|
|||
avaliableSkins?: { url: string; name: string }[]; // Old misspelled name
|
||||
requireJSZip(): Promise<any>; // TODO: Type JSZip
|
||||
requireMusicMetadata(): Promise<any>; // TODO: Type musicmetadata
|
||||
__initialState?: DeepPartial<AppState>;
|
||||
__initialState?: PartialState;
|
||||
__customMiddlewares?: Middleware[];
|
||||
__initialWindowLayout?: WindowLayout;
|
||||
__butterchurnOptions?: ButterchurnOptions;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
"@types/css-font-loading-module": "^0.0.2",
|
||||
"@types/fscreen": "^1.0.1",
|
||||
"@types/invariant": "^2.2.29",
|
||||
"@types/jest": "^23.3.2",
|
||||
"@types/jest": "^27.0.3",
|
||||
"@types/jszip": "^3.1.5",
|
||||
"@types/lodash": "^4.14.116",
|
||||
"@types/lodash-es": "^4.17.1",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
"jsx": "preserve",
|
||||
"noEmit": true,
|
||||
"pretty": true,
|
||||
"types": ["react/experimental", "react-dom/experimental"]
|
||||
"types": ["react/experimental", "react-dom/experimental", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules", "demo/built"]
|
||||
|
|
|
|||
30
yarn.lock
30
yarn.lock
|
|
@ -3168,6 +3168,14 @@
|
|||
jest-diff "^26.0.0"
|
||||
pretty-format "^26.0.0"
|
||||
|
||||
"@types/jest@^27.0.3":
|
||||
version "27.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a"
|
||||
integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg==
|
||||
dependencies:
|
||||
jest-diff "^27.0.0"
|
||||
pretty-format "^27.0.0"
|
||||
|
||||
"@types/json-schema@*", "@types/json-schema@^7.0.7":
|
||||
version "7.0.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818"
|
||||
|
|
@ -6239,6 +6247,11 @@ diff-sequences@^26.6.2:
|
|||
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1"
|
||||
integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==
|
||||
|
||||
diff-sequences@^27.0.6:
|
||||
version "27.0.6"
|
||||
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723"
|
||||
integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==
|
||||
|
||||
diff@^4.0.1:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
||||
|
|
@ -9615,6 +9628,16 @@ jest-diff@^26.1.0:
|
|||
jest-get-type "^26.0.0"
|
||||
pretty-format "^26.1.0"
|
||||
|
||||
jest-diff@^27.0.0:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55"
|
||||
integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ==
|
||||
dependencies:
|
||||
chalk "^4.0.0"
|
||||
diff-sequences "^27.0.6"
|
||||
jest-get-type "^27.3.1"
|
||||
pretty-format "^27.3.1"
|
||||
|
||||
jest-docblock@^24.3.0:
|
||||
version "24.9.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2"
|
||||
|
|
@ -9747,6 +9770,11 @@ jest-get-type@^26.3.0:
|
|||
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0"
|
||||
integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==
|
||||
|
||||
jest-get-type@^27.3.1:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff"
|
||||
integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg==
|
||||
|
||||
jest-haste-map@^24.9.0:
|
||||
version "24.9.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d"
|
||||
|
|
@ -13107,7 +13135,7 @@ pretty-format@^26.1.0:
|
|||
ansi-styles "^4.0.0"
|
||||
react-is "^16.12.0"
|
||||
|
||||
pretty-format@^27.0.2:
|
||||
pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.3.1:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5"
|
||||
integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA==
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue