diff --git a/package.json b/package.json index ca542ee..dd3a1c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moonlight-mod/mappings", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "repository": { "type": "git", diff --git a/src/mappings/discord/Dispatcher.ts b/src/mappings/discord/Dispatcher.ts index 39dd297..3f0ec7e 100644 --- a/src/mappings/discord/Dispatcher.ts +++ b/src/mappings/discord/Dispatcher.ts @@ -1,32 +1,8 @@ import register from "../../registry"; -import { Dispatcher as OrigDispatcher } from "flux"; - -type Dispatcher = OrigDispatcher & { - dispatch: (payload: any) => void; - isDispatching: () => boolean; - - addInterceptor: (interceptor: (event: any) => boolean | void) => void; - - flushWaitQueue: () => void; - wait: (callback: () => void) => void; - - subscribe: (eventType: string, callback: (event: any) => void) => void; - unsubscribe: (eventType: string, callback: (event: any) => void) => void; - - register: ( - name: string, - actionHandlers: Record void>, - storeDidChange: (event: any) => void, - band: number, - token: string - ) => number; - - createToken: () => string; - addDependencies: (id: string, deps: string[]) => void; -}; +import type { Dispatcher } from "./packages/flux/Dispatcher"; type Exports = { - default: Dispatcher; + default: Dispatcher; }; export default Exports; diff --git a/src/mappings/discord/components/common/index.ts b/src/mappings/discord/components/common/index.ts index e3dc321..2be7859 100644 --- a/src/mappings/discord/components/common/index.ts +++ b/src/mappings/discord/components/common/index.ts @@ -24,8 +24,8 @@ export type IconSize = "xxs" | "xs" | "sm" | "md" | "lg" | "custom" | "refresh_s export type IconProps = { size?: IconSize; - width: number; - height: number; + width?: number; + height?: number; color?: CSS.DataType.Color; colorClass?: string; [index: string]: any; diff --git a/src/mappings/discord/packages/flux/PersistedStore.ts b/src/mappings/discord/packages/flux/PersistedStore.ts index adb7f70..53360ad 100644 --- a/src/mappings/discord/packages/flux/PersistedStore.ts +++ b/src/mappings/discord/packages/flux/PersistedStore.ts @@ -32,7 +32,7 @@ export declare abstract class PersistedStore extends Stor /** * Returns `this.constructor` */ - getClass(): (dispatcher: typeof Dispatcher, actionHandlers?: Record>) => this; + getClass(): (dispatcher: Dispatcher, actionHandlers?: Record>) => this; static clearAll(toClear: ClearAll): Promise | null | undefined; static shouldClear(toClear: ClearAll, store: string): boolean; static clearPersistQueue(store: string): void; @@ -49,7 +49,7 @@ export declare abstract class PersistedStore extends Stor initialize(state?: T): void; getState(): T; - constructor(dispatcher: typeof Dispatcher, actionHandlers?: Record>); + constructor(dispatcher: Dispatcher, actionHandlers?: Record>); } declare abstract class UserAgnosticStore extends PersistedStore { diff --git a/src/mappings/discord/packages/flux/Store.ts b/src/mappings/discord/packages/flux/Store.ts index 1633d14..1129375 100644 --- a/src/mappings/discord/packages/flux/Store.ts +++ b/src/mappings/discord/packages/flux/Store.ts @@ -15,7 +15,7 @@ export declare abstract class Store { _reactChangeCallbacks: ChangeListeners; _syncsWith: SyncsWith[]; _dispatchToken: string; - _dispatcher: typeof Dispatcher; + _dispatcher: Dispatcher; _mustEmitChanges: () => boolean; _isInitialized: boolean; __getLocalVars(): any; // most discord stores dont add it anymore o7 @@ -41,7 +41,7 @@ export declare abstract class Store { getDispatchToken(): string; mustEmitChanges(should?: () => boolean): void; - constructor(dispatcher: typeof Dispatcher, actionHandlers?: Record>, band?: number); + constructor(dispatcher: Dispatcher, actionHandlers?: Record>, band?: number); } export type Exports = { diff --git a/src/types.ts b/src/types.ts index b776300..71edcad 100644 --- a/src/types.ts +++ b/src/types.ts @@ -92,13 +92,11 @@ export type MappedModules = { "discord/utils/NativeUtils": NativeUtils; "highlight.js": HighlightJS; "highlight.js/lib/core": HighlightJSCore; - "lodash": lodash; - "murmurhash": murmurhash; + lodash: lodash; + murmurhash: murmurhash; "platform.js": PlatformJS; - "react": React; + react: React; "uuid/v4": UUID; }; -export declare function WebpackRequire( - module: T -): MappedModules[T]; +export declare function WebpackRequire(module: T): MappedModules[T];