Skip to content

Commit 975eef9

Browse files
committed
Fix some weird broken mappings
1 parent b808105 commit 975eef9

File tree

6 files changed

+13
-39
lines changed

6 files changed

+13
-39
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@moonlight-mod/mappings",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

src/mappings/discord/Dispatcher.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
11
import register from "../../registry";
2-
import { Dispatcher as OrigDispatcher } from "flux";
3-
4-
type Dispatcher = OrigDispatcher<any> & {
5-
dispatch: (payload: any) => void;
6-
isDispatching: () => boolean;
7-
8-
addInterceptor: (interceptor: (event: any) => boolean | void) => void;
9-
10-
flushWaitQueue: () => void;
11-
wait: (callback: () => void) => void;
12-
13-
subscribe: (eventType: string, callback: (event: any) => void) => void;
14-
unsubscribe: (eventType: string, callback: (event: any) => void) => void;
15-
16-
register: (
17-
name: string,
18-
actionHandlers: Record<string, (event: any) => void>,
19-
storeDidChange: (event: any) => void,
20-
band: number,
21-
token: string
22-
) => number;
23-
24-
createToken: () => string;
25-
addDependencies: (id: string, deps: string[]) => void;
26-
};
2+
import type { Dispatcher } from "./packages/flux/Dispatcher";
273

284
type Exports = {
29-
default: Dispatcher;
5+
default: Dispatcher<any>;
306
};
317
export default Exports;
328

src/mappings/discord/components/common/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export type IconSize = "xxs" | "xs" | "sm" | "md" | "lg" | "custom" | "refresh_s
2424

2525
export type IconProps = {
2626
size?: IconSize;
27-
width: number;
28-
height: number;
27+
width?: number;
28+
height?: number;
2929
color?: CSS.DataType.Color;
3030
colorClass?: string;
3131
[index: string]: any;

src/mappings/discord/packages/flux/PersistedStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export declare abstract class PersistedStore<T extends BasePayload> extends Stor
3232
/**
3333
* Returns `this.constructor`
3434
*/
35-
getClass(): (dispatcher: typeof Dispatcher, actionHandlers?: Record<T["type"], ActionHandler<T>>) => this;
35+
getClass(): (dispatcher: Dispatcher<any>, actionHandlers?: Record<T["type"], ActionHandler<T>>) => this;
3636
static clearAll(toClear: ClearAll): Promise<void> | null | undefined;
3737
static shouldClear(toClear: ClearAll, store: string): boolean;
3838
static clearPersistQueue(store: string): void;
@@ -49,7 +49,7 @@ export declare abstract class PersistedStore<T extends BasePayload> extends Stor
4949
initialize(state?: T): void;
5050
getState(): T;
5151

52-
constructor(dispatcher: typeof Dispatcher, actionHandlers?: Record<T["type"], ActionHandler<T>>);
52+
constructor(dispatcher: Dispatcher<any>, actionHandlers?: Record<T["type"], ActionHandler<T>>);
5353
}
5454

5555
declare abstract class UserAgnosticStore<T extends BasePayload> extends PersistedStore<T> {

src/mappings/discord/packages/flux/Store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export declare abstract class Store<T extends BasePayload> {
1515
_reactChangeCallbacks: ChangeListeners;
1616
_syncsWith: SyncsWith[];
1717
_dispatchToken: string;
18-
_dispatcher: typeof Dispatcher;
18+
_dispatcher: Dispatcher<any>;
1919
_mustEmitChanges: () => boolean;
2020
_isInitialized: boolean;
2121
__getLocalVars(): any; // most discord stores dont add it anymore o7
@@ -41,7 +41,7 @@ export declare abstract class Store<T extends BasePayload> {
4141
getDispatchToken(): string;
4242
mustEmitChanges(should?: () => boolean): void;
4343

44-
constructor(dispatcher: typeof Dispatcher, actionHandlers?: Record<T["type"], ActionHandler<T>>, band?: number);
44+
constructor(dispatcher: Dispatcher<any>, actionHandlers?: Record<T["type"], ActionHandler<T>>, band?: number);
4545
}
4646

4747
export type Exports = {

src/types.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ export type MappedModules = {
9292
"discord/utils/NativeUtils": NativeUtils;
9393
"highlight.js": HighlightJS;
9494
"highlight.js/lib/core": HighlightJSCore;
95-
"lodash": lodash;
96-
"murmurhash": murmurhash;
95+
lodash: lodash;
96+
murmurhash: murmurhash;
9797
"platform.js": PlatformJS;
98-
"react": React;
98+
react: React;
9999
"uuid/v4": UUID;
100100
};
101101

102-
export declare function WebpackRequire<T extends keyof MappedModules>(
103-
module: T
104-
): MappedModules[T];
102+
export declare function WebpackRequire<T extends keyof MappedModules>(module: T): MappedModules[T];

0 commit comments

Comments
 (0)