Skip to content

Commit b616989

Browse files
committed
Cleanup types
1 parent 5587947 commit b616989

File tree

9 files changed

+43
-15
lines changed

9 files changed

+43
-15
lines changed

packages/webamp/demo/js/Webamp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export {
1414
ButterchurnOptions,
1515
Track,
1616
AppState,
17+
PartialState,
1718
URLTrack,
1819
FilePicker,
1920
Action,

packages/webamp/demo/js/config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { Track, AppState, URLTrack } from "./Webamp";
1+
import { Track, URLTrack, PartialState } from "./Webamp";
22
// @ts-ignore
33
import llamaAudio from "../mp3/llama-2.91.mp3";
4-
import { DeepPartial } from "redux";
54

65
interface Config {
76
initialTracks?: Track[];
87
audioUrl?: string;
98
skinUrl?: string;
109
disableMarquee?: boolean;
11-
initialState?: DeepPartial<AppState>;
10+
initialState?: PartialState;
1211
}
1312

1413
const { hash } = window.location;

packages/webamp/demo/js/screenshotInitialState.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { DeepPartial } from "redux";
2-
import { AppState } from "./Webamp";
1+
import { PartialState } from "./Webamp";
32

43
const defaultTracksState = {
54
"0": {
@@ -44,7 +43,7 @@ const defaultTracksState = {
4443
},
4544
};
4645

47-
const initialState: DeepPartial<AppState> = {
46+
const initialState: PartialState = {
4847
equalizer: {
4948
sliders: {
5049
"60": 52,

packages/webamp/js/store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createStore, applyMiddleware, DeepPartial } from "redux";
1+
import { createStore, applyMiddleware } from "redux";
22
import thunk from "redux-thunk";
33
import { composeWithDevTools } from "redux-devtools-extension";
44
import reducer from "./reducers";
@@ -7,7 +7,7 @@ import { merge } from "./utils";
77
import { UPDATE_TIME_ELAPSED, STEP_MARQUEE } from "./actionTypes";
88
import Media from "./media";
99
import Emitter from "./emitter";
10-
import { Extras, Dispatch, Action, AppState, Middleware } from "./types";
10+
import { Extras, Dispatch, Action, Middleware, PartialState } from "./types";
1111

1212
// TODO: Move to demo
1313
const compose = composeWithDevTools({
@@ -18,7 +18,7 @@ export default function (
1818
media: Media,
1919
actionEmitter: Emitter,
2020
customMiddlewares: Middleware[] = [],
21-
stateOverrides: DeepPartial<AppState> | undefined,
21+
stateOverrides: PartialState | undefined,
2222
extras: Extras
2323
) {
2424
let initialState;

packages/webamp/js/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,8 @@ export interface AppState {
666666
milkdrop: MilkdropState;
667667
}
668668

669+
export type PartialState = any;
670+
669671
/**
670672
* Type definition of the music-metadata-browser module.
671673
* Ref: https://github.com/Borewit/music-metadata-browser/blob/master/src/index.ts
@@ -732,7 +734,6 @@ export interface Store extends ReduxStore {
732734
subscribe(cb: () => void): () => void;
733735
dispatch: Dispatch;
734736
getState: GetState;
735-
replaceReducer(reducer: Reducer): void;
736737
}
737738

738739
export interface MiddlewareStore {

packages/webamp/js/webampLazy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Middleware,
1111
WindowPosition,
1212
ButterchurnOptions,
13+
PartialState,
1314
} from "./types";
1415
import getStore from "./store";
1516
import App from "./components/App";
@@ -37,7 +38,6 @@ import Emitter from "./emitter";
3738

3839
import { SerializedStateV1 } from "./serializedStates/v1Types";
3940
import Disposable from "./Disposable";
40-
import { DeepPartial } from "redux";
4141

4242
export interface Options {
4343
/**
@@ -123,7 +123,7 @@ export interface PrivateOptions {
123123
avaliableSkins?: { url: string; name: string }[]; // Old misspelled name
124124
requireJSZip(): Promise<any>; // TODO: Type JSZip
125125
requireMusicMetadata(): Promise<any>; // TODO: Type musicmetadata
126-
__initialState?: DeepPartial<AppState>;
126+
__initialState?: PartialState;
127127
__customMiddlewares?: Middleware[];
128128
__initialWindowLayout?: WindowLayout;
129129
__butterchurnOptions?: ButterchurnOptions;

packages/webamp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@types/css-font-loading-module": "^0.0.2",
7070
"@types/fscreen": "^1.0.1",
7171
"@types/invariant": "^2.2.29",
72-
"@types/jest": "^23.3.2",
72+
"@types/jest": "^27.0.3",
7373
"@types/jszip": "^3.1.5",
7474
"@types/lodash": "^4.14.116",
7575
"@types/lodash-es": "^4.17.1",

packages/webamp/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"jsx": "preserve",
1212
"noEmit": true,
1313
"pretty": true,
14-
"types": ["react/experimental", "react-dom/experimental"]
14+
"types": ["react/experimental", "react-dom/experimental", "jest"]
1515
},
1616
"include": ["**/*.ts", "**/*.tsx"],
1717
"exclude": ["node_modules", "demo/built"]

yarn.lock

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3168,6 +3168,14 @@
31683168
jest-diff "^26.0.0"
31693169
pretty-format "^26.0.0"
31703170

3171+
"@types/jest@^27.0.3":
3172+
version "27.0.3"
3173+
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a"
3174+
integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg==
3175+
dependencies:
3176+
jest-diff "^27.0.0"
3177+
pretty-format "^27.0.0"
3178+
31713179
"@types/json-schema@*", "@types/json-schema@^7.0.7":
31723180
version "7.0.8"
31733181
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818"
@@ -6239,6 +6247,11 @@ diff-sequences@^26.6.2:
62396247
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1"
62406248
integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==
62416249

6250+
diff-sequences@^27.0.6:
6251+
version "27.0.6"
6252+
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723"
6253+
integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==
6254+
62426255
diff@^4.0.1:
62436256
version "4.0.2"
62446257
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
@@ -9615,6 +9628,16 @@ jest-diff@^26.1.0:
96159628
jest-get-type "^26.0.0"
96169629
pretty-format "^26.1.0"
96179630

9631+
jest-diff@^27.0.0:
9632+
version "27.3.1"
9633+
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55"
9634+
integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ==
9635+
dependencies:
9636+
chalk "^4.0.0"
9637+
diff-sequences "^27.0.6"
9638+
jest-get-type "^27.3.1"
9639+
pretty-format "^27.3.1"
9640+
96189641
jest-docblock@^24.3.0:
96199642
version "24.9.0"
96209643
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2"
@@ -9747,6 +9770,11 @@ jest-get-type@^26.3.0:
97479770
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0"
97489771
integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==
97499772

9773+
jest-get-type@^27.3.1:
9774+
version "27.3.1"
9775+
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff"
9776+
integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg==
9777+
97509778
jest-haste-map@^24.9.0:
97519779
version "24.9.0"
97529780
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:
1310713135
ansi-styles "^4.0.0"
1310813136
react-is "^16.12.0"
1310913137

13110-
pretty-format@^27.0.2:
13138+
pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.3.1:
1311113139
version "27.3.1"
1311213140
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5"
1311313141
integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA==

0 commit comments

Comments
 (0)