refactor: misc. changes

This commit is contained in:
ryan-0324 2024-08-26 21:07:29 -04:00
parent faf1728308
commit 297afce7e1
93 changed files with 836 additions and 915 deletions

View file

@ -51,7 +51,7 @@
"@types/diff": "^5.2.1",
"@types/html-minifier-terser": "^7.0.2",
"@types/lodash": "~4.17.7",
"@types/node": "^18.19.45",
"@types/node": "^18.19.46",
"@types/react": "~18.2.79",
"@types/react-dom": "~18.2.25",
"@types/yazl": "^2.4.5",
@ -68,7 +68,7 @@
"highlight.js": "11.8.0",
"html-minifier-terser": "^7.2.0",
"moment": "2.22.2",
"puppeteer-core": "^23.1.1",
"puppeteer-core": "^23.2.0",
"standalone-electron-types": "^1.0.0",
"stylelint": "^16.8.2",
"stylelint-config-standard": "^36.0.1",
@ -76,11 +76,11 @@
"tsx": "^4.18.0",
"type-fest": "^4.25.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.2.0",
"typescript-eslint": "^8.3.0",
"typescript-transform-paths": "^3.5.0",
"zip-local": "^0.3.5"
},
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.9.0",
"pnpm": {
"patchedDependencies": {
"@stylistic/eslint-plugin-js@2.6.4": "patches/@stylistic__eslint-plugin-js@2.6.4.patch",

View file

@ -32,19 +32,19 @@
"@stylistic/eslint-plugin": "^2.6.4",
"@types/node": "^20.16.1",
"@types/semver": "^7.5.8",
"@typescript-eslint/typescript-estree": "^8.2.0",
"@typescript-eslint/typescript-estree": "^8.3.0",
"eslint": "^9.9.1",
"eslint-plugin-check-file": "^2.8.0",
"eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-import-x": "^4.0.0",
"eslint-plugin-simple-header": "^1.1.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "^4.1.3",
"puppeteer-core": "^23.1.1",
"puppeteer-core": "^23.2.0",
"semver": "^7.6.3",
"tsx": "^4.18.0",
"type-fest": "^4.25.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.2.0"
"typescript-eslint": "^8.3.0"
}
}

View file

@ -32,13 +32,13 @@ export default {
},
},
src: {
"./flux/FluxActionHandlersGraph.ts": {
FluxActionHandlersGraph: {
"./flux/ActionHandlersGraph.ts": {
ActionHandlersGraph: {
type: "class",
},
},
"./flux/FluxActionLog.ts": {
FluxActionLog: {
"./flux/ActionLog.ts": {
ActionLog: {
type: "class",
find() {
return this.Webpack.Common.FluxDispatcher.actionLogger.log(
@ -48,26 +48,26 @@ export default {
},
},
},
"./flux/FluxActionLogger.ts": {
FluxActionLogger: {
"./flux/ActionLogger.ts": {
ActionLogger: {
type: "class",
},
},
"./flux/FluxBatchedStoreListener.ts": {
FluxBatchedStoreListener: {
"./flux/BatchedStoreListener.ts": {
BatchedStoreListener: {
type: "class",
},
},
"./flux/FluxChangeListeners.ts": {
FluxChangeListeners: {
"./flux/ChangeListeners.ts": {
ChangeListeners: {
type: "class",
},
},
"./flux/FluxDispatcher.ts": {
FluxDispatcher: {
"./flux/Dispatcher.ts": {
Dispatcher: {
type: "class",
},
FluxDispatchBand: {
DispatchBand: {
type: "enum",
// Screaming snake case to pascal case (source enum's keys have no underscores)
keyMapper: key => key.replace(/(?<=^.).+/, s => s.toLowerCase()),
@ -76,11 +76,47 @@ export default {
type: "enum",
},
},
"./flux/FluxEmitter.ts": {
FluxEmitter: {
"./flux/Emitter.ts": {
Emitter: {
type: "class",
},
},
"./flux/PersistedStore.ts": {
PersistedStore: {
type: "class",
ignoredAdditions: {
// Overrides
staticMethodsAndFields: ["destroy"],
methods: ["initializeIfNeeded"],
},
},
},
"./flux/SnapshotStore.ts": {
SnapshotStore: {
type: "class",
ignoredRemovals: {
// Exists on type to enforce that subclasses have `displayName`
staticMethodsAndFields: ["displayName"],
},
},
},
"./flux/Store.ts": {
Store: {
type: "class",
},
},
"./flux/UserAgnosticStore.ts": {
UserAgnosticStore: {
type: "class",
find() {
return Object.getPrototypeOf(this.Webpack.Common.Flux.DeviceSettingsStore);
},
ignoredAdditions: {
// Overrides
methods: ["initializeFromState", "initializeIfNeeded", "getState"],
},
},
},
"./general/channels/ChannelRecord.ts": {
ChannelRecordBase: {
type: "class",
@ -256,25 +292,6 @@ export default {
},
},
},
"./general/i18n/FormattedMessage.ts": {
FormattedMessage: {
type: "class",
},
ASTNodeType: {
type: "enum",
// Undocumented
ignoredRemovals: [["HOOK"]],
},
},
"./general/i18n/Provider.ts": {
Provider: {
type: "class",
find() {
const { constructor } = this.Webpack.Common.i18n._provider;
return [Object.getPrototypeOf(constructor), constructor];
},
},
},
"./general/messages/ChannelMessages.ts": {
ChannelMessages: {
type: "class",
@ -531,15 +548,6 @@ export default {
type: "enum",
},
},
"./general/ImmutableRecord.ts": {
ImmutableRecord: {
type: "class",
ignoredRemovals: {
// Exists on type to enforce that subclasses have a valid constructor
constructorDefinition: true,
},
},
},
"./general/Permissions.ts": {
/*
// bigint enums are not yet possible: https://github.com/microsoft/TypeScript/issues/37783
@ -583,6 +591,15 @@ export default {
type: "enum",
},
},
"./general/RecordBase.ts": {
RecordBase: {
type: "class",
ignoredRemovals: {
// Exists on type to enforce that subclasses have a valid constructor
constructorDefinition: true,
},
},
},
"./general/Role.ts": {
RoleFlags: {
type: "enum",
@ -610,39 +627,27 @@ export default {
type: "enum",
},
},
"./stores/abstract/FluxPersistedStore.ts": {
FluxPersistedStore: {
"./i18n/FormattedMessage.ts": {
FormattedMessage: {
type: "class",
ignoredAdditions: {
// Overrides
staticMethodsAndFields: ["destroy"],
methods: ["initializeIfNeeded"],
},
},
ASTNodeType: {
type: "enum",
// Undocumented
ignoredRemovals: [["HOOK"]],
},
},
"./stores/abstract/FluxSnapshotStore.ts": {
FluxSnapshotStore: {
type: "class",
ignoredRemovals: {
// Exists on type to enforce that subclasses have `displayName`
staticMethodsAndFields: ["displayName"],
},
},
},
"./stores/abstract/FluxStore.ts": {
FluxStore: {
"./i18n/I18N.ts": {
I18N: {
type: "class",
},
},
"./stores/abstract/FluxUserAgnosticStore.ts": {
FluxUserAgnosticStore: {
"./i18n/Provider.ts": {
Provider: {
type: "class",
find() {
return Object.getPrototypeOf(this.Webpack.Common.Flux.DeviceSettingsStore);
},
ignoredAdditions: {
// Overrides
methods: ["initializeFromState", "initializeIfNeeded", "getState"],
const { constructor } = this.Webpack.Common.i18n._provider;
return [Object.getPrototypeOf(constructor), constructor];
},
},
},

View file

@ -0,0 +1,70 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { DepGraph } from "dependency-graph";
import type { IsAny, Nullish, UnionToIntersection } from "../internal";
import type { Action, ActionHandler, ActionType, ExtractAction } from "./actions";
import type { DispatchBand } from "./Dispatcher";
export declare class ActionHandlersGraph {
_addToBand(dispatchToken: string, dispatchBand: DispatchBand): void;
_bandToken(dispatchBand: DispatchBand): string;
_computeOrderedActionHandlers<T extends ActionType>(
actionType: T
): OrderedActionHandlers<ExtractAction<Action, T>>[];
_computeOrderedCallbackTokens(): string[];
_invalidateCaches(): void;
_validateDependencies(fromDispatchToken: string, toDispatchToken: string): void;
addDependencies(fromDispatchToken: string, toDispatchTokens: readonly string[]): void;
createToken(): string;
getOrderedActionHandlers<T extends ActionType>(partialAction: {
type: T;
}): OrderedActionHandlers<ExtractAction<Action, T>>;
register<A extends Action>(
storeName: string,
actionHandlers: ActionHandlerMap<A>,
storeDidChange: ActionHandler<A>,
dispatchBand: DispatchBand,
dispatchToken?: string | undefined /* = this.createToken() */
): string;
_dependencyGraph: DepGraph<ActionHandlersGraphNode>;
_lastID: number;
_orderedActionHandlers: {
[T in ActionType]?: OrderedActionHandlers<ExtractAction<Action, T>> | Nullish;
};
_orderedCallbackTokens: string[] | Nullish;
}
export interface ActionHandlersGraphNode {
actionHandler: Partial<ActionHandlerMap>;
band: DispatchBand;
/** Store name */
name: string;
storeDidChange: ActionHandler;
}
export type ActionHandlerMap<A extends Action = Action>
// Workaround to avoid ts(2589)
= UnionToIntersection<
A extends unknown
? unknown extends (
IsAny<A[Extract<string, keyof A>]>
& IsAny<A[Extract<number, keyof A>]>
& IsAny<A[Extract<symbol, keyof A>]>
)
? Record<A["type"], (action: any) => void>
: { [T in A["type"]]: (action: A & { type: T; }) => void; }
: never
>;
export type OrderedActionHandlers<A extends Action = Action> = {
actionHandler: ActionHandler<A>;
/** Store name */
name: string;
storeDidChange: ActionHandler<A>;
}[];

View file

@ -0,0 +1,30 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Action } from "./actions";
export declare class ActionLog<A extends Action = Action> {
constructor(actionType: A["type"]);
get name(): A["type"];
toJSON(): Pick<ActionLog<A>, "action" | "createdAt" | "traces"> & {
created_at: ActionLog["createdAt"];
};
action: A;
createdAt: Date;
error: Error | undefined;
id: number;
startTime: number;
totalTime: number;
traces: ActionLogTrace[];
}
export interface ActionLogTrace {
/** Store name */
name: string;
time: number;
}

View file

@ -0,0 +1,34 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { EventEmitter } from "events";
import type { Nullish } from "../internal";
import type { ActionLog } from "./ActionLog";
import type { Action, ActionType } from "./actions";
export declare class ActionLogger extends EventEmitter {
constructor(options?: { persist?: boolean | undefined; } | undefined);
getLastActionMetrics(
title: string,
limit?: number | undefined /* = 20 */
): ActionMetric[];
getSlowestActions<T extends ActionType = ActionType>(
actionType?: T | Nullish,
limit?: number | undefined /* = 20 */
): ActionMetric<T>[];
log<A extends Action>(
action: A,
callback: (func: <T>(storeName: string, func: () => T) => T) => void
): ActionLog<A>;
logs: ActionLog[];
persist: boolean;
}
export type ActionMetric<T extends ActionType = ActionType>
= [storeName: string, actionType: T, totalTime: number];

View file

@ -5,17 +5,16 @@
*/
import type { Stringable } from "../internal";
import type { FluxStore } from "../stores/abstract/FluxStore";
import type { Store } from "./Store";
// Original name: BatchedStoreListener
export declare class FluxBatchedStoreListener {
constructor(stores: FluxStore[], changeCallback: () => void);
export declare class BatchedStoreListener {
constructor(stores: Store[], changeCallback: () => void);
attach(debugName?: Stringable): void;
detach(): void;
changeCallback: () => void;
handleStoreChange: () => void;
stores: FluxStore[];
stores: Store[];
storeVersionHandled: number | undefined;
}

View file

@ -4,25 +4,24 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
// Original name: ChangeListeners
export declare class FluxChangeListeners {
has(listener: FluxChangeListener): boolean;
export declare class ChangeListeners {
has(listener: ChangeListener): boolean;
hasAny(): boolean;
invokeAll(): void;
add: (listener: FluxChangeListener<false>) => void;
add: (listener: ChangeListener<false>) => void;
/**
* @param listener The change listener to add. It will be removed when it returns false.
*/
addConditional: (
listener: FluxChangeListener<true>,
listener: ChangeListener<true>,
immediatelyCall?: boolean | undefined /* = true */
) => void;
listeners: Set<FluxChangeListener>;
remove: (listener: FluxChangeListener) => void;
listeners: Set<ChangeListener>;
remove: (listener: ChangeListener) => void;
}
export type FluxChangeListener<Conditional extends boolean = boolean>
export type ChangeListener<Conditional extends boolean = boolean>
= true extends Conditional
? () => unknown
: () => void;

View file

@ -0,0 +1,87 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Nullish } from "../internal";
import type { ActionHandlerMap, ActionHandlersGraph } from "./ActionHandlersGraph";
import type { ActionLogger } from "./ActionLogger";
import type { Action, ActionHandler, ActionType, ExtractAction } from "./actions";
export declare class Dispatcher {
constructor(
defaultBand?: DispatchBand | undefined /* = DispatchBand.EARLY */,
actionLogger?: ActionLogger | Nullish,
sentryUtils?: SentryUtils | Nullish
);
_dispatch(
action: Action,
func: <T>(storeName: string, func: () => T) => T
): boolean | undefined;
_dispatchWithDevtools(action: Action): void;
_dispatchWithLogging(action: Action): void;
addDependencies(fromDispatchToken: string, toDispatchTokens: readonly string[]): void;
addInterceptor(interceptor: ActionHandler): void;
createToken(): string;
dispatch(action: Action): Promise<void>;
flushWaitQueue(): void;
isDispatching(): boolean;
register<A extends Action>(
storeName: string,
actionHandlers: ActionHandlerMap<A>,
storeDidChange: ActionHandler<A>,
dispatchBand?: DispatchBand | Nullish, /* = this._defaultBand */
dispatchToken?: string | undefined /* = this._actionHandlers.createToken() */
): string;
subscribe<T extends ActionType>(
actionType: T,
listener: ActionHandler<ExtractAction<Action, T>>): void;
unsubscribe<T extends ActionType>(
actionType: T,
listener: ActionHandler<ExtractAction<Action, T>>
): void;
wait(callback: () => void): void;
_actionHandlers: ActionHandlersGraph;
_currentDispatchActionType: ActionType | Nullish;
_defaultBand: DispatchBand;
_interceptors: ((action: Action) => boolean)[];
_processingWaitQueue: boolean;
_sentryUtils: SentryUtils | Nullish;
_subscriptions: {
[T in ActionType]?: Set<ActionHandler<ExtractAction<Action, T>>> | Nullish;
};
_waitQueue: (() => void)[];
actionLogger: ActionLogger;
functionCache: Partial<ActionHandlerMap>;
}
// Enum keys made screaming snake case for consistency.
export enum DispatchBand {
EARLY = 0,
DATABASE = 1,
DEFAULT = 2,
}
export interface SentryUtils {
addBreadcrumb: (breadcrumb: {
category?: string | undefined;
data?: Record<string, unknown> | undefined;
event_id?: string | undefined;
level?: SeverityLevel | undefined;
message?: string | undefined;
timestamp?: number | undefined;
type?: string | undefined;
}) => void;
}
export enum SeverityLevel {
DEBUG = "debug",
ERROR = "error",
FATAL = "fatal",
INFO = "info",
LOG = "log",
WARNING = "warning",
}

View file

@ -4,28 +4,27 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxStore } from "../stores/abstract/FluxStore";
import type { Store } from "./Store";
// Original name: Emitter
export declare class FluxEmitter {
export declare class Emitter {
batched<T>(callback: () => T): T;
destroy(): void;
emit(): void;
emitNonReactOnce(syncWiths: Set<() => unknown>, changedStores: Set<FluxStore>): void;
emitNonReactOnce(syncWiths: Set<() => unknown>, changedStores: Set<Store>): void;
emitReactOnce(): void;
getChangeSentinel(): number;
getIsPaused(): boolean;
injectBatchEmitChanges(batchEmitChanges: () => unknown): void;
markChanged(store: FluxStore): void;
markChanged(store: Store): void;
/** If timeout is omitted, Emitter will pause until resume is called. */
pause(timeout?: number | undefined): void;
resume(shouldEmit?: boolean | undefined /* = true */): void;
changedStores: Set<FluxStore>;
changedStores: Set<Store>;
changeSentinel: number;
isBatchEmitting: boolean;
isDispatching: boolean;
isPaused: boolean;
pauseTimer: number | null;
reactChangedStores: Set<FluxStore>;
reactChangedStores: Set<Store>;
}

View file

@ -1,71 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { DepGraph } from "dependency-graph";
import type { IsAny, Nullish, UnionToIntersection } from "../internal";
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
import type { FluxDispatchBand } from "./FluxDispatcher";
// Original name: ActionHandlersGraph
export declare class FluxActionHandlersGraph {
_addToBand(dispatchToken: string, dispatchBand: FluxDispatchBand): void;
_bandToken(dispatchBand: FluxDispatchBand): string;
_computeOrderedActionHandlers<ActionType extends FluxActionType>(
actionType: ActionType
): FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>>[];
_computeOrderedCallbackTokens(): string[];
_invalidateCaches(): void;
_validateDependencies(fromDispatchToken: string, toDispatchToken: string): void;
addDependencies(fromDispatchToken: string, toDispatchTokens: readonly string[]): void;
createToken(): string;
getOrderedActionHandlers<ActionType extends FluxActionType>(partialAction: {
type: ActionType;
}): FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>>;
register<Action extends FluxAction>(
storeName: string,
actionHandlers: FluxActionHandlerMap<Action>,
storeDidChange: FluxActionHandler<Action>,
dispatchBand: FluxDispatchBand,
dispatchToken?: string | undefined /* = this.createToken() */
): string;
_dependencyGraph: DepGraph<FluxActionHandlersGraphNode>;
_lastID: number;
_orderedActionHandlers: {
[ActionType in FluxActionType]?: FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>> | Nullish;
};
_orderedCallbackTokens: string[] | Nullish;
}
export interface FluxActionHandlersGraphNode {
actionHandler: Partial<FluxActionHandlerMap>;
band: FluxDispatchBand;
/** Store name */
name: string;
storeDidChange: FluxActionHandler;
}
export type FluxActionHandlerMap<Action extends FluxAction = FluxAction>
// Workaround to avoid ts(2589)
= UnionToIntersection<
Action extends unknown
? unknown extends (
IsAny<Action[Extract<string, keyof Action>]>
& IsAny<Action[Extract<number, keyof Action>]>
& IsAny<Action[Extract<symbol, keyof Action>]>
)
? { [ActionType in Action["type"]]: (action: any) => void; }
: { [ActionType in Action["type"]]: (action: Action & { type: ActionType; }) => void; }
: never
>;
export type FluxOrderedActionHandlers<Action extends FluxAction = FluxAction> = {
actionHandler: FluxActionHandler<Action>;
/** Store name */
name: string;
storeDidChange: FluxActionHandler<Action>;
}[];

View file

@ -1,31 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxAction } from "./fluxActions";
// Original name: ActionLog
export declare class FluxActionLog<Action extends FluxAction = FluxAction> {
constructor(actionType: Action["type"]);
get name(): Action["type"];
toJSON(): Pick<FluxActionLog<Action>, "action" | "createdAt" | "traces"> & {
created_at: FluxActionLog["createdAt"];
};
action: Action;
createdAt: Date;
error: Error | undefined;
id: number;
startTime: number;
totalTime: number;
traces: FluxActionLogTrace[];
}
export interface FluxActionLogTrace {
/** Store name */
name: string;
time: number;
}

View file

@ -1,35 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { EventEmitter } from "events";
import type { Nullish } from "../internal";
import type { FluxActionLog } from "./FluxActionLog";
import type { FluxAction, FluxActionType } from "./fluxActions";
// Original name: ActionLogger
export declare class FluxActionLogger extends EventEmitter {
constructor(options?: { persist?: boolean | undefined; } | undefined);
getLastActionMetrics(
title: string,
limit?: number | undefined /* = 20 */
): FluxActionMetric[];
getSlowestActions<ActionType extends FluxActionType = FluxActionType>(
actionType?: ActionType | Nullish,
limit?: number | undefined /* = 20 */
): FluxActionMetric<ActionType>[];
log<Action extends FluxAction>(
action: Action,
callback: (func: <T>(storeName: string, func: () => T) => T) => void
): FluxActionLog<Action>;
logs: FluxActionLog[];
persist: boolean;
}
export type FluxActionMetric<ActionType extends FluxActionType = FluxActionType>
= [storeName: string, actionType: ActionType, totalTime: number];

View file

@ -1,90 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Nullish } from "../internal";
import type { FluxActionHandlerMap, FluxActionHandlersGraph } from "./FluxActionHandlersGraph";
import type { FluxActionLogger } from "./FluxActionLogger";
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
// Original name: Dispatcher
export declare class FluxDispatcher {
constructor(
defaultBand?: FluxDispatchBand | undefined /* = FluxDispatchBand.EARLY */,
actionLogger?: FluxActionLogger | Nullish,
sentryUtils?: SentryUtils | Nullish
);
_dispatch(
action: FluxAction,
func: <T>(storeName: string, func: () => T) => T
): boolean | undefined;
_dispatchWithDevtools(action: FluxAction): void;
_dispatchWithLogging(action: FluxAction): void;
addDependencies(fromDispatchToken: string, toDispatchTokens: readonly string[]): void;
addInterceptor(interceptor: FluxActionHandler): void;
createToken(): string;
dispatch(action: FluxAction): Promise<void>;
flushWaitQueue(): void;
isDispatching(): boolean;
register<Action extends FluxAction>(
storeName: string,
actionHandlers: FluxActionHandlerMap<Action>,
storeDidChange: FluxActionHandler<Action>,
dispatchBand?: FluxDispatchBand | Nullish, /* = this._defaultBand */
dispatchToken?: string | undefined /* = this._actionHandlers.createToken() */
): string;
subscribe<ActionType extends FluxActionType>(
actionType: ActionType,
listener: FluxActionHandler<ExtractAction<FluxAction, ActionType>>
): void;
unsubscribe<ActionType extends FluxActionType>(
actionType: ActionType,
listener: FluxActionHandler<ExtractAction<FluxAction, ActionType>>
): void;
wait(callback: () => void): void;
_actionHandlers: FluxActionHandlersGraph;
_currentDispatchActionType: FluxActionType | Nullish;
_defaultBand: FluxDispatchBand;
_interceptors: ((action: FluxAction) => boolean)[];
_processingWaitQueue: boolean;
_sentryUtils: SentryUtils | Nullish;
_subscriptions: {
[ActionType in FluxActionType]?: Set<FluxActionHandler<ExtractAction<FluxAction, ActionType>>> | Nullish;
};
_waitQueue: (() => void)[];
actionLogger: FluxActionLogger;
functionCache: Partial<FluxActionHandlerMap>;
}
// Original name: DispatchBand
// Enum keys made screaming snake case for consistency.
export enum FluxDispatchBand {
EARLY = 0,
DATABASE = 1,
DEFAULT = 2,
}
export interface SentryUtils {
addBreadcrumb: (breadcrumb: {
category?: string | undefined;
data?: Record<string, unknown> | undefined;
event_id?: string | undefined;
level?: SeverityLevel | undefined;
message?: string | undefined;
timestamp?: number | undefined;
type?: string | undefined;
}) => void;
}
export enum SeverityLevel {
DEBUG = "debug",
ERROR = "error",
FATAL = "fatal",
INFO = "info",
LOG = "log",
WARNING = "warning",
}

View file

@ -4,24 +4,23 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
import type { FluxDispatcher } from "../../flux/FluxDispatcher";
import type { GenericConstructor, Nullish } from "../../internal";
import type { FluxStore } from "./FluxStore";
import type { GenericConstructor, Nullish } from "../internal";
import type { ActionHandlerMap } from "./ActionHandlersGraph";
import type { Dispatcher } from "./Dispatcher";
import type { Store } from "./Store";
// Original name: PersistedStore
export declare abstract class FluxPersistedStore<
export declare abstract class PersistedStore<
Constructor extends GenericConstructor = GenericConstructor,
State = unknown
> extends FluxStore {
constructor(dispatcher: FluxDispatcher, actionHandlers: Partial<FluxActionHandlerMap>);
> extends Store {
constructor(dispatcher: Dispatcher, actionHandlers: Partial<ActionHandlerMap>);
static _clearAllPromise: Promise<void> | Nullish;
static _writePromises: Map</* persistKey: */string, Promise<void>>;
static _writeResolvers: Map</* persistKey: */string, [resolver: () => void, callbackId: number]>;
static allPersistKeys: Set<string>;
static clearAll(options: FluxPersistedStoreClearOptions): Promise<void>;
static clearPersistQueue(options: FluxPersistedStoreClearOptions): void;
static clearAll(options: PersistedStoreClearOptions): Promise<void>;
static clearPersistQueue(options: PersistedStoreClearOptions): void;
static disableWrite: boolean;
static disableWrites: boolean;
static getAllStates(): Promise<{ [persistKey: string]: unknown; }>;
@ -33,17 +32,17 @@ export declare abstract class FluxPersistedStore<
States extends readonly [unknown, ...unknown[]] | readonly [...unknown[], unknown] = [unknown]
>(
persistKey: string,
...migrations: [] extends FluxPersistedStoreMigrations<States>
? [migrations?: FluxPersistedStoreMigrations<States> | Nullish]
: [migrations: FluxPersistedStoreMigrations<States>]
...migrations: [] extends PersistedStoreMigrations<States>
? [migrations?: PersistedStoreMigrations<States> | Nullish]
: [migrations: PersistedStoreMigrations<States>]
): { requiresPersist: true; state: Tail<States>; } | { requiresPersist: false; state: undefined; };
static migrations: ((oldState: never) => unknown)[] | undefined;
/**
* Not present on {@link FluxPersistedStore}'s constructor.
* Not present on {@link PersistedStore}'s constructor.
* All subclasses are required to define their own.
*/
static persistKey: string;
static shouldClear(options: FluxPersistedStoreClearOptions, persistKey: string): boolean;
static shouldClear(options: PersistedStoreClearOptions, persistKey: string): boolean;
static throttleDelay: number;
static userAgnosticPersistKeys: Set<string>;
@ -64,29 +63,29 @@ export declare abstract class FluxPersistedStore<
};
}
export interface FluxPersistedStoreClearOptions {
export interface PersistedStoreClearOptions {
/** Array of persist keys */
omit?: readonly string[] | Nullish;
type: "all" | "user-data-only";
}
export type FluxPersistedStoreMigrations<
export type PersistedStoreMigrations<
States extends readonly [unknown, ...unknown[]] | readonly [...unknown[], unknown]
>
= States extends readonly [...infer OldStates, infer NewState]
? OldStates extends [...infer OlderStates, infer OldState]
? [...FluxPersistedStoreMigrations<[...OlderStates, OldState]>, (oldState: OldState) => NewState]
? [...PersistedStoreMigrations<[...OlderStates, OldState]>, (oldState: OldState) => NewState]
: OldStates extends []
? []
: OldStates extends (infer T)[]
? [] | [...((oldState: T) => T)[], (oldState: T) => NewState]
: never
: FluxPersistedStoreMigrationsTrailingRest<States>;
: PersistedStoreMigrationsTrailingRest<States>;
type FluxPersistedStoreMigrationsTrailingRest<States extends readonly unknown[]>
type PersistedStoreMigrationsTrailingRest<States extends readonly unknown[]>
= States extends readonly [infer OldState, ...infer NewStates]
? NewStates extends [infer NewState, ...infer NewerStates]
? [(oldState: OldState) => NewState, ...FluxPersistedStoreMigrationsTrailingRest<[NewState, ...NewerStates]>]
? [(oldState: OldState) => NewState, ...PersistedStoreMigrationsTrailingRest<[NewState, ...NewerStates]>]
: NewStates extends []
? []
: NewStates extends (infer T)[]

View file

@ -4,29 +4,28 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
import type { GenericConstructor } from "../../internal";
import type { FluxStore } from "./FluxStore";
import type { GenericConstructor } from "../internal";
import type { ActionHandlerMap } from "./ActionHandlersGraph";
import type { Store } from "./Store";
export interface FluxSnapshot<SnapshotData = unknown> {
export interface SnapshotStoreSnapshot<SnapshotData = unknown> {
data: SnapshotData;
version: number;
}
// Original name: SnapshotStore
export declare abstract class FluxSnapshotStore<
export declare abstract class SnapshotStore<
Constructor extends GenericConstructor = GenericConstructor,
SnapshotData = unknown
> extends FluxStore {
> extends Store {
constructor(
actionHandlers: Partial<FluxActionHandlerMap>
actionHandlers: Partial<ActionHandlerMap>
& Partial<Record<"CLEAR_CACHES" | "WRITE_CACHES", never>>
);
static allStores: FluxSnapshotStore[];
static allStores: SnapshotStore[];
static clearAll(): void;
/**
* Not present on {@link FluxSnapshotStore}'s constructor.
* Not present on {@link SnapshotStore}'s constructor.
* All subclasses are required to define their own.
*/
static displayName: string;
@ -36,5 +35,5 @@ export declare abstract class FluxSnapshotStore<
get persistKey(): string;
readSnapshot(version: number): SnapshotData | null;
save(): void;
abstract takeSnapshot(): FluxSnapshot<SnapshotData>;
abstract takeSnapshot(): SnapshotStoreSnapshot<SnapshotData>;
}

View file

@ -0,0 +1,65 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Nullish } from "../internal";
import type { ActionHandlerMap } from "./ActionHandlersGraph";
import type { Action } from "./actions";
import type { ChangeListeners } from "./ChangeListeners";
import type { DispatchBand, Dispatcher } from "./Dispatcher";
export declare abstract class Store {
constructor(
dispatcher: Dispatcher,
actionHandlers?: Partial<ActionHandlerMap> | Nullish,
dispatchBand?: DispatchBand | Nullish /* = dispatcher._defaultBand */
);
static destroy(): void;
/** Undefined on {@link Store}'s constructor. */
static displayName: string | undefined;
static getAll(): Store[];
static initialize(): void;
static initialized: Promise<void>;
emitChange(): void;
getDispatchToken(): string;
getName(): string;
initialize(...args: never[]): void;
initializeIfNeeded(): void;
mustEmitChanges(
mustEmitChanges?: ((action: Action) => boolean) | Nullish /* = () => true */
): void;
registerActionHandlers(
actionHandlers: Partial<ActionHandlerMap>,
dispatchBand?: DispatchBand | Nullish /* = this._dispatcher._defaultBand */
): void;
syncWith(
stores: readonly Store[],
func: () => unknown,
timeout?: number | Nullish
): void;
waitFor(...stores: Store[]): void;
__getLocalVars: undefined;
_changeCallbacks: ChangeListeners;
_dispatcher: Dispatcher;
_dispatchToken: string;
_isInitialized: boolean;
_mustEmitChanges: ((action: Action) => boolean) | Nullish;
_reactChangeCallbacks: ChangeListeners;
_syncWiths: {
func: () => unknown;
store: Store;
}[];
addChangeListener: ChangeListeners["add"];
/**
* @param listener The change listener to add. It will be removed when it returns false.
*/
addConditionalChangeListener: ChangeListeners["addConditional"];
addReactChangeListener: ChangeListeners["add"];
removeChangeListener: ChangeListeners["remove"];
removeReactChangeListener: ChangeListeners["remove"];
}

View file

@ -0,0 +1,15 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { GenericConstructor } from "../internal";
import type { PersistedStore } from "./PersistedStore";
export declare abstract class UserAgnosticStore<
Constructor extends GenericConstructor = GenericConstructor,
State = unknown
> extends PersistedStore<Constructor, State> {
abstract getUserAgnosticState(): State;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -4,29 +4,34 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxPersistedStore } from "../stores/abstract/FluxPersistedStore";
import type { FluxStore } from "../stores/abstract/FluxStore";
import type { FluxUserAgnosticStore } from "../stores/abstract/FluxUserAgnosticStore";
import type { FluxEmitter } from "./FluxEmitter";
import type { Emitter } from "./Emitter";
import type { PersistedStore } from "./PersistedStore";
import type { Store } from "./Store";
import type { UserAgnosticStore } from "./UserAgnosticStore";
export * from "./FluxActionHandlersGraph";
export * from "./FluxActionLog";
export * from "./FluxActionLogger";
export * from "./fluxActions";
export * from "./FluxBatchedStoreListener";
export * from "./FluxChangeListeners";
export * from "./FluxDispatcher";
export * from "./FluxEmitter";
export * from "./ActionHandlersGraph";
export * from "./ActionLog";
export * from "./ActionLogger";
export * from "./actions";
export * from "./BatchedStoreListener";
export * from "./ChangeListeners";
export * from "./Dispatcher";
export * from "./Emitter";
export * from "./PersistedStore";
export * from "./SnapshotStore";
export * from "./Store";
export * from "./UserAgnosticStore";
export * from "./utils";
export interface Flux {
get initialized(): typeof FluxStore["initialized"];
get initialized(): typeof Store["initialized"];
/** @todo */
connectStores: (a?: any, b?: any, c?: any) => (a?: any) => any;
DeviceSettingsStore: typeof FluxUserAgnosticStore;
Emitter: FluxEmitter;
initialize: typeof FluxStore["initialize"];
OfflineCacheStore: typeof FluxUserAgnosticStore;
PersistedStore: typeof FluxPersistedStore;
Store: typeof FluxStore;
DeviceSettingsStore: typeof UserAgnosticStore;
Emitter: Emitter;
initialize: typeof Store["initialize"];
OfflineCacheStore: typeof UserAgnosticStore;
PersistedStore: typeof PersistedStore;
Store: typeof Store;
}

View file

@ -5,27 +5,27 @@
*/
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
import type { Store } from "./Store";
// For createFetchStore
export type FetchStoreFactory<
StoreConstraint extends FluxStore = FluxStore,
StoreConstraint extends Store = Store,
StateConstraint = unknown,
DependenciesConstraint extends readonly unknown[] = readonly unknown[],
IsLoadingConstraint extends boolean = boolean
> = <
Store extends StoreConstraint,
S extends StoreConstraint,
State extends StateConstraint,
Dependencies extends DependenciesConstraint,
IsLoading extends IsLoadingConstraint
>(
store: Store,
store: S,
options: {
dangerousAbortOnCleanup?: boolean | undefined /* = false */;
get: (...dependencies: Dependencies) => State;
getIsLoading: (...dependencies: Dependencies) => IsLoading;
load: (signal: AbortSignal, ...dependencies: Dependencies) => Promise<void>;
useStateHook: StoreStateHook<[Store], State, Dependencies>;
useStateHook: StoreStateHook<[S], State, Dependencies>;
}
) => (...dependencies: Dependencies) => {
data: State;
@ -35,7 +35,7 @@ export type FetchStoreFactory<
// For useStateFromStores
export type StoreStateHook<
Stores extends readonly FluxStore[] = readonly FluxStore[],
Stores extends readonly Store[] = readonly Store[],
StateConstraint = unknown,
Dependencies extends readonly unknown[] | Nullish = readonly unknown[] | Nullish
> = <State extends StateConstraint>(
@ -51,7 +51,7 @@ export type StoreStateHook<
// For useStateFromStoresObject
export type StoreObjectStateHook<
Stores extends readonly FluxStore[] = readonly FluxStore[],
Stores extends readonly Store[] = readonly Store[],
StateConstraint extends {} = {},
Dependencies extends readonly unknown[] | Nullish = readonly unknown[] | Nullish
> = <State extends StateConstraint>(
@ -64,7 +64,7 @@ export type StoreObjectStateHook<
// For useStateFromStoresArray
export type StoreArrayStateHook<
Stores extends readonly FluxStore[] = readonly FluxStore[],
Stores extends readonly Store[] = readonly Store[],
StateConstraint extends readonly unknown[] = readonly unknown[],
Dependencies extends readonly unknown[] | Nullish = readonly unknown[] | Nullish
> = <State extends StateConstraint>(

View file

@ -6,8 +6,8 @@
import type { Nullish, Optional, PartialOnUndefined, SnakeCasedProperties } from "../internal";
import type { CompanyRecord } from "./CompanyRecord";
import type { ImmutableRecord } from "./ImmutableRecord";
import type { IconSource } from "./misc";
import type { RecordBase } from "./RecordBase";
import type { UserRecord } from "./UserRecord";
export type ApplicationRecordOwnProperties = Pick<ApplicationRecord, "aliases" | "bot" | "coverImage" | "description" | "developers" | "embeddedActivityConfig" | "eulaId" | "executables" | "flags" | "guild" | "guildId" | "hashes" | "hook" | "icon" | "id" | "integrationTypesConfig" | "isMonetized" | "maxParticipants" | "name" | "overlay" | "overlayCompatibilityHook" | "overlayMethods" | "overlayWarn" | "primarySkuId" | "privacyPolicyUrl" | "publishers" | "roleConnectionsVerificationUrl" | "slug" | "splash" | "storefront_available" | "storeListingSkuId" | "tags" | "team" | "termsOfServiceUrl" | "thirdPartySkus" | "type">;
@ -18,7 +18,7 @@ export type ApplicationProperties = Optional<PartialOnUndefined<Omit<Application
export declare class ApplicationRecord<
OwnProperties extends ApplicationRecordOwnProperties = ApplicationRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(applicationProperties: ApplicationProperties);
/** @todo */

View file

@ -4,13 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { ImmutableRecord } from "./ImmutableRecord";
import type { RecordBase } from "./RecordBase";
export type CompanyRecordOwnProperties = Pick<CompanyRecord, "id" | "name">;
export declare class CompanyRecord<
OwnProperties extends CompanyRecordOwnProperties = CompanyRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(companyProperties: CompanyRecordOwnProperties);
static createFromServer(companyFromServer: CompanyRecordOwnProperties): CompanyRecord;

View file

@ -6,8 +6,8 @@
import type { Nullish, Optional } from "../internal";
import type { Clan } from "./Clan";
import type { ImmutableRecord } from "./ImmutableRecord";
import type { IconSource } from "./misc";
import type { RecordBase } from "./RecordBase";
import type { UserRecord } from "./UserRecord";
export type GuildRecordOwnProperties = Pick<GuildRecord, "afkChannelId" | "afkTimeout" | "application_id" | "banner" | "clan" | "defaultMessageNotifications" | "description" | "discoverySplash" | "explicitContentFilter" | "features" | "homeHeader" | "hubType" | "icon" | "id" | "joinedAt" | "latestOnboardingQuestionId" | "maxMembers" | "maxStageVideoChannelUsers" | "maxVideoChannelUsers" | "mfaLevel" | "name" | "nsfwLevel" | "ownerId" | "preferredLocale" | "premiumProgressBarEnabled" | "premiumSubscriberCount" | "premiumTier" | "publicUpdatesChannelId" | "rulesChannelId" | "safetyAlertsChannelId" | "splash" | "systemChannelFlags" | "systemChannelId" | "vanityURLCode" | "verificationLevel">;
@ -19,7 +19,7 @@ export type GuildProperties = Optional<Omit<GuildRecordOwnProperties, "features"
export declare class GuildRecord<
OwnProperties extends GuildRecordOwnProperties = GuildRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(guildProperties: GuildProperties);
get acronym(): string;

View file

@ -8,7 +8,7 @@ import type { StringProperties } from "../internal";
// Original name: Record
// Renamed to avoid name conflicts with TypeScripts's Record utility type.
export declare abstract class ImmutableRecord<
export declare abstract class RecordBase<
OwnProperties extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>
> {
constructor(properties: OwnProperties);

View file

@ -5,8 +5,8 @@
*/
import type { Nullish, Optional, SnakeCasedProperties } from "../internal";
import type { ImmutableRecord } from "./ImmutableRecord";
import type { IconSource } from "./misc";
import type { RecordBase } from "./RecordBase";
export type UserRecordOwnProperties = Pick<UserRecord, "avatar" | "avatarDecorationData" | "banner" | "bot" | "clan" | "desktop" | "discriminator" | "email" | "flags" | "globalName" | "guildMemberAvatars" | "hasAnyStaffLevel" | "hasBouncedEmail" | "hasFlag" | "id" | "isStaff" | "isStaffPersonal" | "mfaEnabled" | "mobile" | "nsfwAllowed" | "personalConnectionId" | "phone" | "premiumType" | "premiumUsageFlags" | "publicFlags" | "purchasedFlags" | "system" | "username" | "verified">;
@ -18,7 +18,7 @@ export type UserProperties = Optional<Omit<UserRecordOwnProperties, "avatarDecor
export declare class UserRecord<
OwnProperties extends UserRecordOwnProperties = UserRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(userProperties: UserProperties);
addGuildAvatarHash(guildId: string, avatarHash: string): this;

View file

@ -17,12 +17,11 @@ export * from "./Frecency";
export * from "./GuildMember";
export * from "./GuildMemberProfile";
export * from "./GuildRecord";
export * from "./i18n";
export * from "./ImmutableRecord";
export * from "./messages";
export * from "./misc";
export * from "./Permissions";
export * from "./ReadState";
export * from "./RecordBase";
export * from "./Role";
export * from "./UserProfile";
export * from "./UserRecord";

View file

@ -5,7 +5,7 @@
*/
import type { Nullish } from "../../internal";
import type { ImmutableRecord } from "../ImmutableRecord";
import type { RecordBase } from "../RecordBase";
import type { UserRecord } from "../UserRecord";
export type InteractionRecordOwnProperties = Pick<InteractionRecord, "displayName" | "id" | "name" | "type" | "user">;
@ -15,7 +15,7 @@ export type InteractionProperties = Omit<InteractionRecordOwnProperties, "displa
export declare class InteractionRecord<
OwnProperties extends InteractionRecordOwnProperties = InteractionRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(interaction: InteractionProperties);
static createFromServer(

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { ImmutableRecord } from "../ImmutableRecord";
import type { RecordBase } from "../RecordBase";
import type { MinimalMessageProperties, MinimalMessageRecord } from "./MinimalMessageRecord";
export type MessageSnapshotRecordOwnProperties = Pick<MessageSnapshotRecord, "message">;
@ -15,7 +15,7 @@ export interface MessageSnapshotProperties {
export declare class MessageSnapshotRecord<
OwnProperties extends MessageSnapshotRecordOwnProperties = MessageSnapshotRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(messageSnapshotProperties: MessageSnapshotProperties);
message: MinimalMessageRecord;

View file

@ -8,7 +8,7 @@ import type { Moment } from "moment";
import type { Nullish, Optional, SnakeCasedProperties } from "../../internal";
import type { ChannelType } from "../channels/ChannelRecord";
import type { ImmutableRecord } from "../ImmutableRecord";
import type { RecordBase } from "../RecordBase";
export type MinimalMessageRecordOwnProperties = Pick<MinimalMessageRecord, "attachments" | "codedLinks" | "components" | "content" | "editedTimestamp" | "embeds" | "flags" | "stickerItems" | "stickers" | "timestamp" | "type">;
@ -17,7 +17,7 @@ export type MinimalMessageProperties = Optional<MinimalMessageRecordOwnPropertie
export declare class MinimalMessageRecord<
OwnProperties extends MinimalMessageRecordOwnProperties = MinimalMessageRecordOwnProperties
> extends ImmutableRecord<OwnProperties> {
> extends RecordBase<OwnProperties> {
constructor(minimalMessageProperties: MinimalMessageProperties);
attachments: MessageAttachment[];

View file

@ -8,7 +8,7 @@ import type MessageFormat from "intl-messageformat";
import type { ReactElement, ReactNode } from "react";
import type { State } from "simple-markdown";
import type { IsAny, IsDomainFinite, Stringable, StringProperties, UnionToIntersection } from "../../internal";
import type { IsAny, IsDomainFinite, Stringable, StringProperties, UnionToIntersection } from "../internal";
export type FormattedMessageArgs = RecordArgs | TupleArgs | string | number;

View file

@ -6,7 +6,7 @@
import type { EventEmitter } from "events";
import type { Nullish } from "../../internal";
import type { Nullish } from "../internal";
import type { FormattedMessage } from "./FormattedMessage";
import type { I18NMessages } from "./I18NMessages";
import type { Provider, ProviderParsedMessagesGetter } from "./Provider";

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { OmitIndexSignature } from "../../internal";
import type { OmitIndexSignature } from "../internal";
import type { FormattedMessage as FM } from "./FormattedMessage";
/*

View file

@ -6,7 +6,7 @@
import type { ParserRules } from "simple-markdown";
import type { Nullish } from "../../internal";
import type { Nullish } from "../internal";
import type { FormattedMessage, FormattedMessageArgs } from "./FormattedMessage";
// For getSystemLocale

View file

@ -6,4 +6,5 @@
export * from "./flux";
export * from "./general";
export * from "./i18n";
export * from "./stores";

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { ApplicationRecord, ApplicationType } from "../general/ApplicationRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class ApplicationStore extends FluxStore {
export declare class ApplicationStore extends Store {
static displayName: "ApplicationStore";
_getAllApplications(): ApplicationRecord[];

View file

@ -4,13 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { ChannelRecord, GuildChannelRecord } from "../general/channels/ChannelRecord";
import type { DMChannelRecord, PrivateChannelRecord } from "../general/channels/PrivateChannelRecord";
import type { ThreadChannelRecord } from "../general/channels/ThreadChannelRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class ChannelStore extends FluxStore {
export declare class ChannelStore extends Store {
static displayName: "ChannelStore";
getAllThreadsForParent(channelId: string): ThreadChannelRecord[];

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { PersistedStore } from "../flux/PersistedStore";
import type { Draft, DraftForumThreadSettings, DraftNonForumThreadSettings, DraftType } from "../general/Draft";
import type { GenericConstructor, Nullish } from "../internal";
import type { FluxPersistedStore } from "./abstract/FluxPersistedStore";
export interface DraftStoreState {
[userId: string]: { [channelId: string]: { [Type in DraftType]?: Draft<Type>; }; };
@ -15,7 +15,7 @@ export interface DraftStoreState {
export declare class DraftStore<
Constructor extends GenericConstructor = typeof DraftStore,
State extends DraftStoreState = DraftStoreState
> extends FluxPersistedStore<Constructor, State> {
> extends PersistedStore<Constructor, State> {
static displayName: "DraftStore";
static persistKey: "DraftStore";

View file

@ -4,13 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { PersistedStore } from "../flux/PersistedStore";
import type { ChannelRecord } from "../general/channels/ChannelRecord";
import type { Emoji, GuildEmoji } from "../general/emojis/Emoji";
import type { EmojiDisambiguations } from "../general/emojis/EmojiDisambiguations";
import type { GuildEmojis } from "../general/emojis/GuildEmojis";
import type { Frecency } from "../general/Frecency";
import type { GenericConstructor, Nullish } from "../internal";
import type { FluxPersistedStore } from "./abstract/FluxPersistedStore";
export interface EmojiStoreState {
emojiReactionPendingUsages: EmojiUsage[];
@ -26,7 +26,7 @@ export interface EmojiUsage {
export declare class EmojiStore<
Constructor extends GenericConstructor = typeof EmojiStore,
State extends EmojiStoreState = EmojiStoreState
> extends FluxPersistedStore<Constructor, State> {
> extends PersistedStore<Constructor, State> {
static displayName: "EmojiStore";
static persistKey: "EmojiStoreV2";

View file

@ -4,13 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import { ChannelType, type GuildChannelRecord, type GuildSelectableChannelRecord } from "../general/channels/ChannelRecord";
import type { GuildCategoryChannelRecord } from "../general/channels/GuildTextualChannelRecord";
import type { GuildVocalChannelRecord } from "../general/channels/GuildVocalChannelRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class GuildChannelStore extends FluxStore {
export declare class GuildChannelStore extends Store {
static displayName: "GuildChannelStore";
getAllGuilds(): { [guildId: string]: GuildChannels | undefined; };

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { GuildMember } from "../general/GuildMember";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class GuildMemberStore extends FluxStore {
export declare class GuildMemberStore extends Store {
static displayName: "GuildMemberStore";
getCommunicationDisabledUserMap(): { [userId: string]: string; };

View file

@ -4,12 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { GuildRecord } from "../general/GuildRecord";
import type { Role } from "../general/Role";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class GuildStore extends FluxStore {
export declare class GuildStore extends Store {
static displayName: "GuildStore";
getAllGuildsRoles(): { [guildId: string]: { [roleId: string]: Role; }; };

View file

@ -4,12 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { ChannelMessages } from "../general/messages/ChannelMessages";
import type { MessageRecord } from "../general/messages/MessageRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class MessageStore extends FluxStore {
export declare class MessageStore extends Store {
static displayName: "MessageStore";
focusedMessageId(channelId: string): string | undefined;

View file

@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { ChannelRecord } from "../general/channels/ChannelRecord";
import type { GuildRecord } from "../general/GuildRecord";
import type { PermissionOverwriteMap } from "../general/Permissions";
import type { Role } from "../general/Role";
import type { UserRecord } from "../general/UserRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class PermissionStore extends FluxStore {
export declare class PermissionStore extends Store {
static displayName: "PermissionStore";
/** Always returns false for private (non-guild) channels. */

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { Activity } from "../general/Activity";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class PresenceStore extends FluxStore {
export declare class PresenceStore extends Store {
static displayName: "PresenceStore";
findActivity<T extends Activity>(

View file

@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { GuildChannelRecord } from "../general/channels/ChannelRecord";
import type { GuildRecord } from "../general/GuildRecord";
import type { ChannelIdReadStateType, GuildChannelOverride, GuildIdReadStateType, ReadState, ReadStateSnapshot, ReadStateType, SerializedReadState, UserIdReadStateType } from "../general/ReadState";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
import type { BasicPermissionsObject } from "./PermissionStore";
export declare class ReadStateStore extends FluxStore {
export declare class ReadStateStore extends Store {
static displayName: "ReadStateStore";
ackMessageId(id: string, type?: ReadStateType | undefined /* = ReadStateType.CHANNEL */): string | null;

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { MessageRecord } from "../general/messages/MessageRecord";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class RelationshipStore extends FluxStore {
export declare class RelationshipStore extends Store {
static displayName: "RelationshipStore";
/** @todo May eventually be renamed to `getBlockedIds`. */

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { Store } from "../flux/Store";
import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore";
export declare class SelectedChannelStore extends FluxStore {
export declare class SelectedChannelStore extends Store {
static displayName: "SelectedChannelStore";
getChannelId(guildId?: string | Nullish): string | undefined;

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { PersistedStore } from "../flux/PersistedStore";
import type { GenericConstructor } from "../internal";
import type { FluxPersistedStore } from "./abstract/FluxPersistedStore";
export interface SelectedGuildStoreState {
lastSelectedGuildId: string | null;
@ -16,7 +16,7 @@ export interface SelectedGuildStoreState {
export declare class SelectedGuildStore<
Constructor extends GenericConstructor = typeof SelectedGuildStore,
State extends SelectedGuildStoreState = SelectedGuildStoreState
> extends FluxPersistedStore<Constructor, State> {
> extends PersistedStore<Constructor, State> {
static displayName: "SelectedGuildStore";
static persistKey: "SelectedGuildStore";

View file

@ -4,12 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { SnapshotStore, SnapshotStoreSnapshot } from "../flux/SnapshotStore";
import type { GuildMemberProfile } from "../general/GuildMemberProfile";
import type { GuildRecord } from "../general/GuildRecord";
import type { UserProfile } from "../general/UserProfile";
import type { UserRecord } from "../general/UserRecord";
import type { GenericConstructor, Nullish } from "../internal";
import type { FluxSnapshot, FluxSnapshotStore } from "./abstract/FluxSnapshotStore";
import type { StatusType } from "./PresenceStore";
export interface UserProfileStoreSnapshotData {
@ -20,7 +20,7 @@ export interface UserProfileStoreSnapshotData {
export declare class UserProfileStore<
Constructor extends GenericConstructor = typeof UserProfileStore,
SnapshotData extends UserProfileStoreSnapshotData = UserProfileStoreSnapshotData
> extends FluxSnapshotStore<Constructor, SnapshotData> {
> extends SnapshotStore<Constructor, SnapshotData> {
constructor();
static displayName: "UserProfileStore";
@ -43,7 +43,7 @@ export declare class UserProfileStore<
isFetchingFriends(userId: string): boolean;
isFetchingProfile(userId: string): boolean;
get isSubmitting(): boolean;
takeSnapshot(): FluxSnapshot<SnapshotData>;
takeSnapshot(): SnapshotStoreSnapshot<SnapshotData>;
loadCache: () => void;
}

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { SnapshotStore, SnapshotStoreSnapshot } from "../flux/SnapshotStore";
import type { UserRecord } from "../general/UserRecord";
import type { GenericConstructor, Nullish } from "../internal";
import type { FluxSnapshot, FluxSnapshotStore } from "./abstract/FluxSnapshotStore";
export interface UserStoreSnapshotData {
users: [UserRecord?];
@ -15,7 +15,7 @@ export interface UserStoreSnapshotData {
export declare class UserStore<
Constructor extends GenericConstructor = typeof UserStore,
SnapshotData extends UserStoreSnapshotData = UserStoreSnapshotData
> extends FluxSnapshotStore<Constructor, SnapshotData> {
> extends SnapshotStore<Constructor, SnapshotData> {
constructor();
static displayName: "UserStore";
@ -44,5 +44,5 @@ export declare class UserStore<
users: readonly any[] | Nullish;
}): void;
initialize(): void;
takeSnapshot(): FluxSnapshot<SnapshotData>;
takeSnapshot(): SnapshotStoreSnapshot<SnapshotData>;
}

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxStore } from "./abstract/FluxStore";
import type { Store } from "../flux/Store";
export declare class WindowStore extends FluxStore {
export declare class WindowStore extends Store {
static displayName: "WindowStore";
getFocusedWindowId(): string | null;

View file

@ -1,66 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
import type { FluxAction } from "../../flux/fluxActions";
import type { FluxChangeListeners } from "../../flux/FluxChangeListeners";
import type { FluxDispatchBand, FluxDispatcher } from "../../flux/FluxDispatcher";
import type { Nullish } from "../../internal";
// Original name: Store
export declare abstract class FluxStore {
constructor(
dispatcher: FluxDispatcher,
actionHandlers?: Partial<FluxActionHandlerMap> | Nullish,
dispatchBand?: FluxDispatchBand | Nullish /* = dispatcher._defaultBand */
);
static destroy(): void;
/** Undefined on {@link FluxStore}'s constructor. */
static displayName: string | undefined;
static getAll(): FluxStore[];
static initialize(): void;
static initialized: Promise<void>;
emitChange(): void;
getDispatchToken(): string;
getName(): string;
initialize(...args: never[]): void;
initializeIfNeeded(): void;
mustEmitChanges(
mustEmitChanges?: ((action: FluxAction) => boolean) | Nullish /* = () => true */
): void;
registerActionHandlers(
actionHandlers: Partial<FluxActionHandlerMap>,
dispatchBand?: FluxDispatchBand | Nullish /* = this._dispatcher._defaultBand */
): void;
syncWith(
stores: readonly FluxStore[],
func: () => unknown,
timeout?: number | Nullish
): void;
waitFor(...stores: FluxStore[]): void;
__getLocalVars: undefined;
_changeCallbacks: FluxChangeListeners;
_dispatcher: FluxDispatcher;
_dispatchToken: string;
_isInitialized: boolean;
_mustEmitChanges: ((action: FluxAction) => boolean) | Nullish;
_reactChangeCallbacks: FluxChangeListeners;
_syncWiths: {
func: () => unknown;
store: FluxStore;
}[];
addChangeListener: FluxChangeListeners["add"];
/**
* @param listener The change listener to add. It will be removed when it returns false.
*/
addConditionalChangeListener: FluxChangeListeners["addConditional"];
addReactChangeListener: FluxChangeListeners["add"];
removeChangeListener: FluxChangeListeners["remove"];
removeReactChangeListener: FluxChangeListeners["remove"];
}

View file

@ -1,16 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import type { GenericConstructor } from "../../internal";
import type { FluxPersistedStore } from "./FluxPersistedStore";
// Original name: UserAgnosticStore
export declare abstract class FluxUserAgnosticStore<
Constructor extends GenericConstructor = GenericConstructor,
State = unknown
> extends FluxPersistedStore<Constructor, State> {
abstract getUserAgnosticState(): State;
}

View file

@ -1,10 +0,0 @@
/*
* discord-types
* Copyright (C) 2024 Vencord project contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
export * from "./FluxPersistedStore";
export * from "./FluxSnapshotStore";
export * from "./FluxStore";
export * from "./FluxUserAgnosticStore";

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
export * from "./abstract";
export * from "./ApplicationStore";
export * from "./ChannelStore";
export * from "./DraftStore";
@ -21,5 +20,4 @@ export * from "./SelectedChannelStore";
export * from "./SelectedGuildStore";
export * from "./UserProfileStore";
export * from "./UserStore";
export * from "./utils";
export * from "./WindowStore";

View file

@ -17,7 +17,7 @@
"types": "./index.d.ts",
"dependencies": {
"@types/lodash": "~4.17.7",
"@types/node": "^18.19.45",
"@types/node": "^18.19.46",
"@types/react": "~18.2.79",
"@types/react-dom": "~18.2.25",
"@vencord/discord-types": "workspace:^",

View file

@ -83,8 +83,8 @@ importers:
specifier: ~4.17.7
version: 4.17.7
'@types/node':
specifier: ^18.19.45
version: 18.19.45
specifier: ^18.19.46
version: 18.19.46
'@types/react':
specifier: ~18.2.79
version: 18.2.79
@ -123,7 +123,7 @@ importers:
version: 12.1.1(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
eslint-plugin-unused-imports:
specifier: ^4.1.3
version: 4.1.3(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
version: 4.1.3(@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
highlight.js:
specifier: 11.8.0
version: 11.8.0
@ -134,8 +134,8 @@ importers:
specifier: 2.22.2
version: 2.22.2
puppeteer-core:
specifier: ^23.1.1
version: 23.1.1
specifier: ^23.2.0
version: 23.2.0
standalone-electron-types:
specifier: ^1.0.0
version: 1.0.0(patch_hash=cvychuhjtbzvtowhc2efrgpqjq)
@ -158,8 +158,8 @@ importers:
specifier: ^5.5.4
version: 5.5.4
typescript-eslint:
specifier: ^8.2.0
version: 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
specifier: ^8.3.0
version: 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
typescript-transform-paths:
specifier: ^3.5.0
version: 3.5.0(typescript@5.5.4)
@ -201,8 +201,8 @@ importers:
specifier: ^7.5.8
version: 7.5.8
'@typescript-eslint/typescript-estree':
specifier: ^8.2.0
version: 8.2.0(typescript@5.5.4)
specifier: ^8.3.0
version: 8.3.0(typescript@5.5.4)
eslint:
specifier: ^9.9.1
version: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
@ -210,8 +210,8 @@ importers:
specifier: ^2.8.0
version: 2.8.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
eslint-plugin-import-x:
specifier: ^3.1.0
version: 3.1.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
specifier: ^4.0.0
version: 4.0.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
eslint-plugin-simple-header:
specifier: ^1.1.1
version: 1.1.1
@ -223,10 +223,10 @@ importers:
version: 55.0.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
eslint-plugin-unused-imports:
specifier: ^4.1.3
version: 4.1.3(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
version: 4.1.3(@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
puppeteer-core:
specifier: ^23.1.1
version: 23.1.1
specifier: ^23.2.0
version: 23.2.0
semver:
specifier: ^7.6.3
version: 7.6.3
@ -240,8 +240,8 @@ importers:
specifier: ^5.5.4
version: 5.5.4
typescript-eslint:
specifier: ^8.2.0
version: 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
specifier: ^8.3.0
version: 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
packages/vencord-types:
dependencies:
@ -249,8 +249,8 @@ importers:
specifier: ~4.17.7
version: 4.17.7
'@types/node':
specifier: ^18.19.45
version: 18.19.45
specifier: ^18.19.46
version: 18.19.46
'@types/react':
specifier: ~18.2.79
version: 18.2.79
@ -701,8 +701,8 @@ packages:
'@types/lodash@4.17.7':
resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==}
'@types/node@18.19.45':
resolution: {integrity: sha512-VZxPKNNhjKmaC1SUYowuXSRSMGyQGmQjvvA1xE4QZ0xce2kLtEhPDS+kqpCPBZYgqblCLQ2DAjSzmgCM5auvhA==}
'@types/node@18.19.46':
resolution: {integrity: sha512-vnRgMS7W6cKa1/0G3/DTtQYpVrZ8c0Xm6UkLaVFrb9jtcVC3okokW09Ki1Qdrj9ISokszD69nY4WDLRlvHlhAA==}
'@types/node@20.16.1':
resolution: {integrity: sha512-zJDo7wEadFtSyNz5QITDfRcrhqDvQI1xQNQ0VoizPjM/dVAODqqIUWbJPkvsxmTI0MYRGRikcdjMPhOssnPejQ==}
@ -731,8 +731,8 @@ packages:
'@types/yazl@2.4.5':
resolution: {integrity: sha512-qpmPfx32HS7vlGJf7EsoM9qJnLZhXJBf1KH0hzfdc+D794rljQWh4H0I/UrZy+6Nhqn0l2jdBZXBGZtR1vnHqw==}
'@typescript-eslint/eslint-plugin@8.2.0':
resolution: {integrity: sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==}
'@typescript-eslint/eslint-plugin@8.3.0':
resolution: {integrity: sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
@ -742,8 +742,8 @@ packages:
typescript:
optional: true
'@typescript-eslint/parser@8.2.0':
resolution: {integrity: sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==}
'@typescript-eslint/parser@8.3.0':
resolution: {integrity: sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@ -752,16 +752,12 @@ packages:
typescript:
optional: true
'@typescript-eslint/scope-manager@7.17.0':
resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/scope-manager@8.2.0':
resolution: {integrity: sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==}
'@typescript-eslint/scope-manager@8.3.0':
resolution: {integrity: sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/type-utils@8.2.0':
resolution: {integrity: sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==}
'@typescript-eslint/type-utils@8.3.0':
resolution: {integrity: sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '*'
@ -769,25 +765,12 @@ packages:
typescript:
optional: true
'@typescript-eslint/types@7.17.0':
resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/types@8.2.0':
resolution: {integrity: sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==}
'@typescript-eslint/types@8.3.0':
resolution: {integrity: sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@7.17.0':
resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
'@typescript-eslint/typescript-estree@8.2.0':
resolution: {integrity: sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==}
'@typescript-eslint/typescript-estree@8.3.0':
resolution: {integrity: sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '*'
@ -795,24 +778,14 @@ packages:
typescript:
optional: true
'@typescript-eslint/utils@7.17.0':
resolution: {integrity: sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
'@typescript-eslint/utils@8.2.0':
resolution: {integrity: sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==}
'@typescript-eslint/utils@8.3.0':
resolution: {integrity: sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
'@typescript-eslint/visitor-keys@7.17.0':
resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/visitor-keys@8.2.0':
resolution: {integrity: sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==}
'@typescript-eslint/visitor-keys@8.3.0':
resolution: {integrity: sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@vap/core@0.0.12':
@ -1131,8 +1104,8 @@ packages:
resolution: {integrity: sha512-9YLIBURXj4DJMFALxXw9K3Y3rwb5Fk0X5/8ipCzaN84+gKxoHK43tVKRNakCQbiEx07E8Uwhuq21BpUagFhZ8w==}
engines: {node: '>= 0.6.0'}
devtools-protocol@0.0.1312386:
resolution: {integrity: sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==}
devtools-protocol@0.0.1330662:
resolution: {integrity: sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==}
diff@5.2.0:
resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==}
@ -1207,11 +1180,11 @@ packages:
peerDependencies:
eslint: '>=7.28.0'
eslint-plugin-import-x@3.1.0:
resolution: {integrity: sha512-/UbPA+bYY7nIxcjL3kpcDY3UNdoLHFhyBFzHox2M0ypcUoueTn6woZUUmzzi5et/dXChksasYYFeKE2wshOrhg==}
engines: {node: '>=16'}
eslint-plugin-import-x@4.0.0:
resolution: {integrity: sha512-5bWZ+2p3DKlpLSP830cAUmRUoYEnnvuBmSOSlURffEUuXL68uQUX0v2JpoXxyoDRIQWApzbqhnFeHA0XoQWosA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.56.0 || ^9.0.0-0
eslint: ^8.57.0 || ^9.0.0
eslint-plugin-path-alias@2.1.0:
resolution: {integrity: sha512-suHrHK2MmTDsmQhrZs+hvrNI2PBKAnZ4ir7y3oJLXJsjOFBfOJoQd+URqZC7ICHyNqesoZdcA0BxEG8z5p/mPw==}
@ -1996,8 +1969,8 @@ packages:
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
engines: {node: '>=6'}
puppeteer-core@23.1.1:
resolution: {integrity: sha512-OeTqNiYGF9qZtwZU4Yc88DDqFJs4TJ4rnK81jkillh6MwDeQodyisM9xe5lBmPhwiDy92s5J5DQtQLjCKHFQ3g==}
puppeteer-core@23.2.0:
resolution: {integrity: sha512-OFyPp2oolGSesx6ZrpmorE5tCaCKY1Z5e/h8f6sB0NpiezenB72jdWBdOrvBO/bUXyq14XyGJsDRUsv0ZOPdZA==}
engines: {node: '>=18'}
q@1.5.1:
@ -2306,8 +2279,8 @@ packages:
resolution: {integrity: sha512-hlR43v+GUIUy8/ZGFP1DquEqPh7PFKQdDMTAmYt671kCCA6AkDQMoeFaFmZ7ObPLYOmpMgyKUqL1C+coFMf30w==}
hasBin: true
tslib@2.6.2:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
tslib@2.7.0:
resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==}
tsx@4.18.0:
resolution: {integrity: sha512-a1jaKBSVQkd6yEc1/NI7G6yHFfefIcuf3QJST7ZEyn4oQnxLYrZR5uZAM8UrwUa3Ge8suiZHcNS1gNrEvmobqg==}
@ -2333,8 +2306,8 @@ packages:
typed-query-selector@2.12.0:
resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==}
typescript-eslint@8.2.0:
resolution: {integrity: sha512-DmnqaPcML0xYwUzgNbM1XaKXpEb7BShYf2P1tkUmmcl8hyeG7Pj08Er7R9bNy6AufabywzJcOybQAtnD/c9DGw==}
typescript-eslint@8.3.0:
resolution: {integrity: sha512-EvWjwWLwwKDIJuBjk2I6UkV8KEQcwZ0VM10nR1rIunRDIP67QJTZAHBXTX0HW/oI1H10YESF8yWie8fRQxjvFA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '*'
@ -2740,7 +2713,7 @@ snapshots:
dependencies:
'@stylistic/eslint-plugin-js': 2.6.4(patch_hash=pybdkzziqggup52e5v4scmfdsq)(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
'@types/eslint': 9.6.0
'@typescript-eslint/utils': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
transitivePeerDependencies:
- supports-color
@ -2817,7 +2790,7 @@ snapshots:
'@types/lodash@4.17.7': {}
'@types/node@18.19.45':
'@types/node@18.19.46':
dependencies:
undici-types: 5.26.5
@ -2854,14 +2827,14 @@ snapshots:
dependencies:
'@types/node': 20.16.1
'@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
'@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
dependencies:
'@eslint-community/regexpp': 4.11.0
'@typescript-eslint/parser': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/scope-manager': 8.2.0
'@typescript-eslint/type-utils': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/utils': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/visitor-keys': 8.2.0
'@typescript-eslint/parser': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/scope-manager': 8.3.0
'@typescript-eslint/type-utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/visitor-keys': 8.3.0
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
graphemer: 1.4.0
ignore: 5.3.2
@ -2872,12 +2845,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
'@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
dependencies:
'@typescript-eslint/scope-manager': 8.2.0
'@typescript-eslint/types': 8.2.0
'@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
'@typescript-eslint/visitor-keys': 8.2.0
'@typescript-eslint/scope-manager': 8.3.0
'@typescript-eslint/types': 8.3.0
'@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4)
'@typescript-eslint/visitor-keys': 8.3.0
debug: 4.3.6
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
optionalDependencies:
@ -2885,20 +2858,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/scope-manager@7.17.0':
'@typescript-eslint/scope-manager@8.3.0':
dependencies:
'@typescript-eslint/types': 7.17.0
'@typescript-eslint/visitor-keys': 7.17.0
'@typescript-eslint/types': 8.3.0
'@typescript-eslint/visitor-keys': 8.3.0
'@typescript-eslint/scope-manager@8.2.0':
'@typescript-eslint/type-utils@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
dependencies:
'@typescript-eslint/types': 8.2.0
'@typescript-eslint/visitor-keys': 8.2.0
'@typescript-eslint/type-utils@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
dependencies:
'@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
'@typescript-eslint/utils': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4)
'@typescript-eslint/utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
debug: 4.3.6
ts-api-utils: 1.3.0(typescript@5.5.4)
optionalDependencies:
@ -2907,16 +2875,14 @@ snapshots:
- eslint
- supports-color
'@typescript-eslint/types@7.17.0': {}
'@typescript-eslint/types@8.3.0': {}
'@typescript-eslint/types@8.2.0': {}
'@typescript-eslint/typescript-estree@7.17.0(typescript@5.5.4)':
'@typescript-eslint/typescript-estree@8.3.0(typescript@5.5.4)':
dependencies:
'@typescript-eslint/types': 7.17.0
'@typescript-eslint/visitor-keys': 7.17.0
'@typescript-eslint/types': 8.3.0
'@typescript-eslint/visitor-keys': 8.3.0
debug: 4.3.6
globby: 11.1.0
fast-glob: 3.3.2
is-glob: 4.0.3
minimatch: 9.0.4
semver: 7.6.3
@ -2926,51 +2892,20 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/typescript-estree@8.2.0(typescript@5.5.4)':
dependencies:
'@typescript-eslint/types': 8.2.0
'@typescript-eslint/visitor-keys': 8.2.0
debug: 4.3.6
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.4
semver: 7.6.3
ts-api-utils: 1.3.0(typescript@5.5.4)
optionalDependencies:
typescript: 5.5.4
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@7.17.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
'@typescript-eslint/utils@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
'@typescript-eslint/scope-manager': 7.17.0
'@typescript-eslint/types': 7.17.0
'@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4)
'@typescript-eslint/scope-manager': 8.3.0
'@typescript-eslint/types': 8.3.0
'@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4)
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
transitivePeerDependencies:
- supports-color
- typescript
'@typescript-eslint/utils@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)':
'@typescript-eslint/visitor-keys@8.3.0':
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
'@typescript-eslint/scope-manager': 8.2.0
'@typescript-eslint/types': 8.2.0
'@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4)
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
transitivePeerDependencies:
- supports-color
- typescript
'@typescript-eslint/visitor-keys@7.17.0':
dependencies:
'@typescript-eslint/types': 7.17.0
eslint-visitor-keys: 3.4.3
'@typescript-eslint/visitor-keys@8.2.0':
dependencies:
'@typescript-eslint/types': 8.2.0
'@typescript-eslint/types': 8.3.0
eslint-visitor-keys: 3.4.3
'@vap/core@0.0.12':
@ -3035,7 +2970,7 @@ snapshots:
ast-types@0.13.4:
dependencies:
tslib: 2.6.2
tslib: 2.7.0
astral-regex@2.0.0: {}
@ -3134,7 +3069,7 @@ snapshots:
camel-case@4.1.2:
dependencies:
pascal-case: 3.1.2
tslib: 2.6.2
tslib: 2.7.0
caniuse-lite@1.0.30001625: {}
@ -3149,9 +3084,9 @@ snapshots:
ansi-styles: 4.3.0
supports-color: 7.2.0
chromium-bidi@0.6.4(devtools-protocol@0.0.1312386):
chromium-bidi@0.6.4(devtools-protocol@0.0.1330662):
dependencies:
devtools-protocol: 0.0.1312386
devtools-protocol: 0.0.1330662
mitt: 3.0.1
urlpattern-polyfill: 10.0.0
zod: 3.23.8
@ -3277,7 +3212,7 @@ snapshots:
dependency-graph@0.9.0: {}
devtools-protocol@0.0.1312386: {}
devtools-protocol@0.0.1330662: {}
diff@5.2.0: {}
@ -3301,7 +3236,7 @@ snapshots:
dot-case@3.0.4:
dependencies:
no-case: 3.0.4
tslib: 2.6.2
tslib: 2.7.0
electron-to-chromium@1.4.788: {}
@ -3374,9 +3309,10 @@ snapshots:
is-glob: 4.0.3
micromatch: 4.0.7
eslint-plugin-import-x@3.1.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4):
eslint-plugin-import-x@4.0.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4):
dependencies:
'@typescript-eslint/utils': 7.17.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4)
'@typescript-eslint/utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
debug: 4.3.6
doctrine: 3.0.0
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
@ -3386,7 +3322,7 @@ snapshots:
minimatch: 9.0.4
semver: 7.6.3
stable-hash: 0.0.4
tslib: 2.6.2
tslib: 2.7.0
transitivePeerDependencies:
- supports-color
- typescript
@ -3448,11 +3384,11 @@ snapshots:
semver: 7.6.3
strip-indent: 3.0.0
eslint-plugin-unused-imports@4.1.3(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)):
eslint-plugin-unused-imports@4.1.3(@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)):
dependencies:
eslint: 9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
optionalDependencies:
'@typescript-eslint/eslint-plugin': 8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/eslint-plugin': 8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
eslint-scope@8.0.2:
dependencies:
@ -3941,7 +3877,7 @@ snapshots:
lower-case@2.0.2:
dependencies:
tslib: 2.6.2
tslib: 2.7.0
lru-cache@7.18.3: {}
@ -4026,7 +3962,7 @@ snapshots:
no-case@3.0.4:
dependencies:
lower-case: 2.0.2
tslib: 2.6.2
tslib: 2.7.0
node-releases@2.0.14: {}
@ -4109,7 +4045,7 @@ snapshots:
param-case@3.0.4:
dependencies:
dot-case: 3.0.4
tslib: 2.6.2
tslib: 2.7.0
parent-module@1.0.1:
dependencies:
@ -4127,7 +4063,7 @@ snapshots:
pascal-case@3.1.2:
dependencies:
no-case: 3.0.4
tslib: 2.6.2
tslib: 2.7.0
pascalcase@0.1.1: {}
@ -4200,12 +4136,12 @@ snapshots:
punycode@2.1.1: {}
puppeteer-core@23.1.1:
puppeteer-core@23.2.0:
dependencies:
'@puppeteer/browsers': 2.3.1
chromium-bidi: 0.6.4(devtools-protocol@0.0.1312386)
chromium-bidi: 0.6.4(devtools-protocol@0.0.1330662)
debug: 4.3.6
devtools-protocol: 0.0.1312386
devtools-protocol: 0.0.1330662
typed-query-selector: 2.12.0
ws: 8.18.0
transitivePeerDependencies:
@ -4394,7 +4330,7 @@ snapshots:
standalone-electron-types@1.0.0(patch_hash=cvychuhjtbzvtowhc2efrgpqjq):
dependencies:
'@types/node': 18.19.45
'@types/node': 18.19.46
static-extend@0.1.2:
dependencies:
@ -4567,7 +4503,7 @@ snapshots:
semver: 7.6.3
strip-ansi: 6.0.1
tslib@2.6.2: {}
tslib@2.7.0: {}
tsx@4.18.0:
dependencies:
@ -4588,11 +4524,11 @@ snapshots:
typed-query-selector@2.12.0: {}
typescript-eslint@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4):
typescript-eslint@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4):
dependencies:
'@typescript-eslint/eslint-plugin': 8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/parser': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/utils': 8.2.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/eslint-plugin': 8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4))(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/parser': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
'@typescript-eslint/utils': 8.3.0(eslint@9.9.1(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.5.4)
optionalDependencies:
typescript: 5.5.4
transitivePeerDependencies:

View file

@ -17,14 +17,14 @@
*/
import ErrorBoundary from "@components/ErrorBoundary";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
import { useStateFromStores } from "@webpack/common";
import type { CSSProperties } from "react";
import { ExpandedGuildFolderStore, settings } from ".";
const ChannelRTCStore: FluxStore & Record<string, any> = findStoreLazy("ChannelRTCStore");
const ChannelRTCStore: Store & Record<string, any> = findStoreLazy("ChannelRTCStore");
const Animations = findByPropsLazy("a", "animated", "useTransition");
const GuildsBar = findComponentByCodeLazy('("guildsnav")');

View file

@ -19,7 +19,7 @@
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxPersistedStore, FluxSnapshotStore } from "@vencord/discord-types";
import type { PersistedStore, SnapshotStore } from "@vencord/discord-types";
import { findByPropsLazy, findLazy, findStoreLazy } from "@webpack";
import { FluxDispatcher, i18n, useMemo } from "@webpack/common";
@ -32,8 +32,8 @@ enum FolderIconDisplay {
}
const GuildsTree = findLazy(m => m.prototype?.moveNextTo);
const SortedGuildStore: FluxSnapshotStore & Record<string, any> = findStoreLazy("SortedGuildStore");
export const ExpandedGuildFolderStore: FluxPersistedStore & Record<string, any> = findStoreLazy("ExpandedGuildFolderStore");
const SortedGuildStore: SnapshotStore & Record<string, any> = findStoreLazy("SortedGuildStore");
export const ExpandedGuildFolderStore: PersistedStore & Record<string, any> = findStoreLazy("ExpandedGuildFolderStore");
const GuildActionCreators = findByPropsLazy("move", "toggleGuildFolderExpand");
let lastGuildId: string | null = null;

View file

@ -21,7 +21,7 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findByPropsLazy, findExportedComponentLazy, findStoreLazy } from "@webpack";
import { Constants, RestAPI, Tooltip, UserSettingsModalActionCreators, useState } from "@webpack/common";
import type { ComponentType } from "react";
@ -30,7 +30,7 @@ import { RenameButton } from "./components/RenameButton";
import type { Session, SessionInfo } from "./types";
import { fetchNamesFromDataStore, getDefaultName, GetOSColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils";
const AuthSessionsStore: FluxStore & Record<string, any> = findStoreLazy("AuthSessionsStore");
const AuthSessionsStore: Store & Record<string, any> = findStoreLazy("AuthSessionsStore");
const TimestampClasses: Record<string, string> = findByPropsLazy("timestampTooltip", "blockquoteContainer");
const SessionIconClasses: Record<string, string> = findByPropsLazy("sessionIcon");

View file

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
export interface ApplicationStreamPreviewStore extends FluxStore {
export interface ApplicationStreamPreviewStore extends Store {
getIsPreviewLoading: (guildId: string | null | undefined, channelId: string, ownerId: string) => boolean;
getPreviewURL: (guildId: string | null | undefined, channelId: string, ownerId: string) => string | null;
getPreviewURLForStreamKey: (streamKey: string) => ReturnType<ApplicationStreamPreviewStore["getPreviewURL"]>;
@ -57,7 +57,7 @@ export interface StreamingStoreState {
/**
* example how a stream key could look like: `call(type of connection):1116549917987192913(channelId):305238513941667851(ownerId)`
*/
export interface ApplicationStreamingStore extends FluxStore {
export interface ApplicationStreamingStore extends Store {
getActiveStreamForApplicationStream: (stream: ApplicationStream) => Stream | null;
getActiveStreamForStreamKey: (streamKey: string) => Stream | null;
getActiveStreamForUser: (userId: string, guildId?: string | null) => Stream | null;

View file

@ -12,7 +12,7 @@ import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
import definePlugin, { OptionType, StartAt } from "@utils/types";
import type { FluxPersistedStore } from "@vencord/discord-types";
import type { PersistedStore } from "@vencord/discord-types";
import { findByCodeLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
import { Button, Forms, useStateFromStores } from "@webpack/common";
@ -38,8 +38,8 @@ function setTheme(theme: string) {
saveClientTheme({ theme });
}
const ThemeStore: FluxPersistedStore & Record<string, any> = findStoreLazy("ThemeStore");
const ClientThemesBackgroundStore: FluxPersistedStore & Record<string, any> = findStoreLazy("ClientThemesBackgroundStore");
const ThemeStore: PersistedStore & Record<string, any> = findStoreLazy("ThemeStore");
const ClientThemesBackgroundStore: PersistedStore & Record<string, any> = findStoreLazy("ClientThemesBackgroundStore");
function ThemeSettings() {
const theme = useStateFromStores([ThemeStore], () => ThemeStore.theme);

View file

@ -23,12 +23,12 @@ import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins";
import { ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
import definePlugin from "@utils/types";
import { type FluxStore, type GuildEmoji as $Emoji, type MessageRecord, type Sticker as $Sticker, StickerFormat } from "@vencord/discord-types";
import { type GuildEmoji as $Emoji, type MessageRecord, type Sticker as $Sticker, StickerFormat, type Store } from "@vencord/discord-types";
import { findByCodeLazy, findStoreLazy } from "@webpack";
import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, Permissions, PermissionStore, RestAPI, Toasts, Tooltip, useMemo, useReducer, UserStore, useState } from "@webpack/common";
import type { Promisable } from "type-fest";
const StickersStore: FluxStore & Record<string, any> = findStoreLazy("StickersStore");
const StickersStore: Store & Record<string, any> = findStoreLazy("StickersStore");
const uploadEmoji = findByCodeLazy(".GUILD_EMOJIS(", "EMOJI_UPLOAD_START");
const DATA_TYPE = Symbol();

View file

@ -23,19 +23,19 @@ import { ApngBlendOp, ApngDisposeOp, importApngJs } from "@utils/dependencies";
import { getCurrentGuild } from "@utils/discord";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { DraftType, type Emoji, EmojiIntention, EmojiType, type FluxPersistedStore, type FluxStore, type MessageAttachment, type MessageEmbed, type MessageRecord, type Sticker, StickerFormat, UserPremiumType } from "@vencord/discord-types";
import { DraftType, type Emoji, EmojiIntention, EmojiType, type MessageAttachment, type MessageEmbed, type MessageRecord, type PersistedStore, type Sticker, StickerFormat, type Store, UserPremiumType } from "@vencord/discord-types";
import { findByCodeLazy, findByPropsLazy, findStoreLazy, proxyLazyWebpack } from "@webpack";
import { AlertActionCreators, ChannelStore, EmojiStore, FluxDispatcher, Forms, GuildMemberStore, IconUtils, lodash, MarkupUtils, Permissions, PermissionStore, promptToUpload, UserSettingsProtoActionCreators, UserStore } from "@webpack/common";
import { applyPalette, GIFEncoder, quantize } from "gifenc";
import type { ReactElement, ReactNode } from "react";
const StickerStore: FluxStore & {
const StickerStore: Store & {
getPremiumPacks: () => StickerPack[];
getAllGuildStickers: () => Map<string, Sticker[]>;
getStickerById: (id: string) => Sticker | undefined;
} = findStoreLazy("StickersStore");
const UserSettingsProtoStore: FluxPersistedStore & Record<string, any> = findStoreLazy("UserSettingsProtoStore");
const UserSettingsProtoStore: PersistedStore & Record<string, any> = findStoreLazy("UserSettingsProtoStore");
const BINARY_READ_OPTIONS = findByPropsLazy("readerFactory");

View file

@ -12,7 +12,7 @@ import { Flex } from "@components/Flex";
import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types";
import { ActivityType, type FluxStore } from "@vencord/discord-types";
import { ActivityType, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { Button, Forms, showToast, TextInput, Toasts, Tooltip, useEffect, useState } from "@webpack/common";
import type { MouseEvent } from "react";
@ -28,7 +28,7 @@ interface IgnoredActivity {
type: ActivitiesTypes;
}
const RunningGameStore: FluxStore & Record<string, any> = findStoreLazy("RunningGameStore");
const RunningGameStore: Store & Record<string, any> = findStoreLazy("RunningGameStore");
const ShowCurrentGame = getUserSettingLazy("status", "showCurrentGame")!;

View file

@ -19,12 +19,12 @@
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { type FluxPersistedStore, RelationshipType } from "@vencord/discord-types";
import { type PersistedStore, RelationshipType } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { ChannelStore, Constants, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common";
import { Settings } from "Vencord";
const UserAffinitiesStore: FluxPersistedStore & Record<string, any> = findStoreLazy("UserAffinitiesStore");
const UserAffinitiesStore: PersistedStore & Record<string, any> = findStoreLazy("UserAffinitiesStore");
export default definePlugin({
name: "ImplicitRelationships",

View file

@ -22,7 +22,7 @@ import { Settings } from "@api/Settings";
import { Logger } from "@utils/Logger";
import { canonicalizeFind } from "@utils/patches";
import { type Patch, type Plugin, ReporterTestable, StartAt } from "@utils/types";
import type { FluxActionType } from "@vencord/discord-types";
import type { ActionType, Dispatcher } from "@vencord/discord-types";
import { FluxDispatcher } from "@webpack/common";
import Plugins from "~plugins";
@ -167,13 +167,13 @@ export function startDependenciesRecursive(plugin: Plugin) {
return { restartNeeded, failures };
}
export function subscribePluginFluxActions(plugin: Plugin, fluxDispatcher: typeof FluxDispatcher) {
export function subscribePluginFluxActions(plugin: Plugin, fluxDispatcher: Dispatcher) {
if (plugin.flux && !subscribedFluxActionsPlugins.has(plugin.name) && (!IS_REPORTER || isReporterTestable(plugin, ReporterTestable.FluxActions))) {
subscribedFluxActionsPlugins.add(plugin.name);
logger.debug("Subscribing to Flux actions of plugin", plugin.name);
for (const [action, handler] of Object.entries(plugin.flux)) {
const wrappedHandler = plugin.flux[action as FluxActionType] = function () {
const wrappedHandler = plugin.flux[action as ActionType] = function () {
try {
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
const res = handler.apply(plugin, arguments as any);
@ -186,23 +186,23 @@ export function subscribePluginFluxActions(plugin: Plugin, fluxDispatcher: typeo
}
};
fluxDispatcher.subscribe(action as FluxActionType, wrappedHandler);
fluxDispatcher.subscribe(action as ActionType, wrappedHandler);
}
}
}
export function unsubscribePluginFluxActions(plugin: Plugin, fluxDispatcher: typeof FluxDispatcher) {
export function unsubscribePluginFluxActions(plugin: Plugin, fluxDispatcher: Dispatcher) {
if (plugin.flux) {
subscribedFluxActionsPlugins.delete(plugin.name);
logger.debug("Unsubscribing from Flux action of plugin", plugin.name);
for (const [action, handler] of Object.entries(plugin.flux)) {
fluxDispatcher.unsubscribe(action as FluxActionType, handler);
fluxDispatcher.unsubscribe(action as ActionType, handler);
}
}
}
export function subscribeAllPluginsFluxActions(fluxDispatcher: typeof FluxDispatcher) {
export function subscribeAllPluginsFluxActions(fluxDispatcher: Dispatcher) {
enabledPluginsSubscribedFlux = true;
for (const name in Plugins) {

View file

@ -21,7 +21,7 @@ import { Link } from "@components/Link";
import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { type Activity, type ActivityAssets, ActivityFlags, ActivityType, type FluxStore } from "@vencord/discord-types";
import { type Activity, type ActivityAssets, ActivityFlags, ActivityType, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { ApplicationAssetUtils, FluxDispatcher, Forms } from "@webpack/common";
@ -52,7 +52,7 @@ const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
const logger = new Logger("LastFMRichPresence");
const SelfPresenceStore: FluxStore & Record<string, any> = findStoreLazy("SelfPresenceStore");
const SelfPresenceStore: Store & Record<string, any> = findStoreLazy("SelfPresenceStore");
const getApplicationAsset = async (key: string) =>
(await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0]!;

View file

@ -23,22 +23,22 @@ import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { MemberCount } from "./MemberCount";
export const GuildMemberCountStore: FluxStore & {
export const GuildMemberCountStore: Store & {
getMemberCount: (guildId?: string | null | undefined) => number | null | undefined;
} = findStoreLazy("GuildMemberCountStore");
export const ChannelMemberStore: FluxStore & {
export const ChannelMemberStore: Store & {
getProps: (guildId: string, channelId?: string | null | undefined) => {
groups: { count: number; id: string; }[];
};
} = findStoreLazy("ChannelMemberStore");
export const ThreadMemberListStore: FluxStore & {
export const ThreadMemberListStore: Store & {
getMemberListSections: (channelId: string) => {
[sectionId: string]: { sectionId: string; userIds: string[]; };
};

View file

@ -20,11 +20,11 @@ import { addClickListener, removeClickListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { type FluxStore, MessageFlags, type MessageRecord } from "@vencord/discord-types";
import { MessageFlags, type MessageRecord, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { FluxDispatcher, MessageActionCreators, Permissions, PermissionStore, UserStore } from "@webpack/common";
const EditMessageStore: FluxStore & Record<string, any> = findStoreLazy("EditMessageStore");
const EditMessageStore: Store & Record<string, any> = findStoreLazy("EditMessageStore");
let isDeletePressed = false;
const keydown = (e: KeyboardEvent) => e.key === "Backspace" && (isDeletePressed = true);

View file

@ -19,10 +19,10 @@
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxSnapshotStore } from "@vencord/discord-types";
import type { SnapshotStore } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
const MessageRequestStore: FluxSnapshotStore & Record<string, any> = findStoreLazy("MessageRequestStore");
const MessageRequestStore: SnapshotStore & Record<string, any> = findStoreLazy("MessageRequestStore");
const settings = definePluginSettings({
hideFriendRequestsCount: {

View file

@ -20,7 +20,7 @@ import { ApplicationCommandInputType, type Argument, type CommandContext, findOp
import { Devs } from "@utils/constants";
import { makeLazy } from "@utils/lazy";
import definePlugin from "@utils/types";
import { ApplicationCommandOptionType, DraftType, type FluxStore } from "@vencord/discord-types";
import { ApplicationCommandOptionType, DraftType, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { promptToUpload, UploadAttachmentActionCreators, UserActionCreators } from "@webpack/common";
import { applyPalette, GIFEncoder, quantize } from "gifenc";
@ -36,7 +36,7 @@ const getFrames = makeLazy(() => {
return Promise.all(frames);
});
const UploadAttachmentStore: FluxStore & Record<string, any> = findStoreLazy("UploadAttachmentStore");
const UploadAttachmentStore: Store & Record<string, any> = findStoreLazy("UploadAttachmentStore");
function loadImage(source: File | string) {
const isFile = source instanceof File;

View file

@ -12,7 +12,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import { classes } from "@utils/misc";
import definePlugin, { OptionType, StartAt } from "@utils/types";
import type { ChannelRecord, FluxStore } from "@vencord/discord-types";
import type { ChannelRecord, Store } from "@vencord/discord-types";
import { findByPropsLazy, findStoreLazy } from "@webpack";
import { ContextMenuApi, FluxDispatcher, Menu } from "@webpack/common";
import type { ComponentType, ReactNode } from "react";
@ -30,7 +30,7 @@ interface ChannelComponentProps {
const headerClasses: Record<string, string> = findByPropsLazy("privateChannelsHeaderContainer");
export const PrivateChannelSortStore: FluxStore & {
export const PrivateChannelSortStore: Store & {
getPrivateChannelIds: () => string[];
} = findStoreLazy("PrivateChannelSortStore");

View file

@ -25,7 +25,7 @@ import { Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { type ClientStatusMap, ClientType, type FluxStore, StatusType, type UserRecord } from "@vencord/discord-types";
import { type ClientStatusMap, ClientType, StatusType, type Store, type UserRecord } from "@vencord/discord-types";
import { findByPropsLazy, findStoreLazy } from "@webpack";
import { PresenceStore, Tooltip, UserStore } from "@webpack/common";
@ -40,7 +40,7 @@ export interface Session {
};
}
const SessionsStore: FluxStore & {
const SessionsStore: Store & {
getSessions: () => Record<string, Session>;
} = findStoreLazy("SessionsStore");

View file

@ -20,11 +20,11 @@ import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatB
import { generateId, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import definePlugin, { StartAt } from "@utils/types";
import { DraftType, type FluxStore, type MessageAttachment } from "@vencord/discord-types";
import { DraftType, type MessageAttachment, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { DraftStore, SelectedChannelStore, UserStore, useStateFromStores } from "@webpack/common";
const UploadAttachmentStore: FluxStore & Record<string, any> = findStoreLazy("UploadAttachmentStore");
const UploadAttachmentStore: Store & Record<string, any> = findStoreLazy("UploadAttachmentStore");
const getDraft = (channelId: string) => DraftStore.getDraft(channelId, DraftType.CHANNEL_MESSAGE);

View file

@ -21,14 +21,14 @@ import { debounce } from "@shared/debounce";
import { VENCORD_USER_AGENT } from "@shared/vencordUserAgent";
import { getCurrentChannel } from "@utils/discord";
import { useAwaiter } from "@utils/react";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { UserProfileStore, UserStore } from "@webpack/common";
import { settings } from "./settings";
import { type CachePronouns, type PronounCode, PronounMapping, type PronounsResponse } from "./types";
const UserSettingsAccountStore: FluxStore & Record<string, any> = findStoreLazy("UserSettingsAccountStore");
const UserSettingsAccountStore: Store & Record<string, any> = findStoreLazy("UserSettingsAccountStore");
type PronounsWithSource = [pronouns: string | null, source: string, hasPendingPronouns: boolean];
const EmptyPronouns: PronounsWithSource = [null, "", false];

View file

@ -22,7 +22,7 @@ import { addServerListElement, removeServerListElement, ServerListRenderPosition
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { type FluxStore, GuildChannelType, ReadStateType, type ThreadChannelRecord } from "@vencord/discord-types";
import { GuildChannelType, ReadStateType, type Store, type ThreadChannelRecord } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { Button, FluxDispatcher, GuildChannelStore, GuildStore, ReadStateStore } from "@webpack/common";
@ -34,7 +34,7 @@ interface ThreadJoined {
type ThreadsJoined = Record<string, ThreadJoined>;
type ThreadsJoinedByParent = Record<string, ThreadsJoined>;
const ActiveJoinedThreadsStore: FluxStore & {
const ActiveJoinedThreadsStore: Store & {
getActiveJoinedThreadsForGuild: (guildId: string) => ThreadsJoinedByParent;
} = findStoreLazy("ActiveJoinedThreadsStore");

View file

@ -19,14 +19,14 @@
import { DataStore, Notices } from "@api/index";
import { showNotification } from "@api/Notifications";
import { getUniqueUsername, openUserProfile } from "@utils/discord";
import { type FluxStore, RelationshipType } from "@vencord/discord-types";
import { RelationshipType, type Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { ChannelStore, GuildMemberStore, GuildStore, IconUtils, RelationshipStore, UserActionCreators, UserStore } from "@webpack/common";
import settings from "./settings";
import type { SimpleGroupDMChannel, SimpleGuild } from "./types";
export const GuildAvailabilityStore: FluxStore & {
export const GuildAvailabilityStore: Store & {
totalGuilds: number;
totalUnavailableGuilds: number;
unavailableGuilds: string[];

View file

@ -8,11 +8,11 @@ import { DataStore } from "@api/index";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { type FluxPersistedStore, GuildFeature } from "@vencord/discord-types";
import { GuildFeature, type PersistedStore } from "@vencord/discord-types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import { ChannelStore, GuildStore } from "@webpack/common";
const SummaryStore: FluxPersistedStore & Record<string, any> = findByPropsLazy("allSummaries", "findSummary");
const SummaryStore: PersistedStore & Record<string, any> = findByPropsLazy("allSummaries", "findSummary");
const createSummaryFromServer = findByCodeLazy(".people)),startId:", ".type}");
const settings = definePluginSettings({

View file

@ -17,7 +17,7 @@
*/
import { Settings } from "@api/Settings";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findByPropsLazy, findStore, proxyLazyWebpack } from "@webpack";
import { Flux, FluxDispatcher } from "@webpack/common";
@ -69,7 +69,7 @@ type Repeat = "off" | "track" | "context";
// Don't wanna run before Flux and Dispatcher are ready!
export const SpotifyStore = proxyLazyWebpack(() => {
const $SpotifyStore: FluxStore & Record<string, any> = findStore("SpotifyStore");
const $SpotifyStore: Store & Record<string, any> = findStore("SpotifyStore");
const SpotifyAPI = findByPropsLazy("vcSpotifyMarker");
const API_BASE = "https://api.spotify.com/v1/me/player";

View file

@ -19,7 +19,7 @@
import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { FluxDispatcher, MessageActionCreators } from "@webpack/common";
@ -53,8 +53,8 @@ interface Track {
name: string;
}
const SpotifyStore: FluxStore & Record<string, any> = findStoreLazy("SpotifyStore");
const PendingReplyStore: FluxStore & Record<string, any> = findStoreLazy("PendingReplyStore");
const SpotifyStore: Store & Record<string, any> = findStoreLazy("SpotifyStore");
const PendingReplyStore: Store & Record<string, any> = findStoreLazy("PendingReplyStore");
async function sendMessage(channelId: string, message: { content: string; }) {
const messageToSend = {

View file

@ -22,7 +22,7 @@ import { definePluginSettings, Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxPersistedStore, FluxStore } from "@vencord/discord-types";
import type { PersistedStore, Store } from "@vencord/discord-types";
import { findComponentByCodeLazy, findExportedComponentLazy, findStoreLazy } from "@webpack";
import { ChannelStore, GuildMemberStore, i18n, RelationshipStore, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common";
import type { ReactNode } from "react";
@ -32,8 +32,8 @@ import { buildSeveralUsers } from "../typingTweaks";
const ThreeDots = findExportedComponentLazy("Dots", "AnimatedDots");
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers");
const TypingStore: FluxStore & Record<string, any> = findStoreLazy("TypingStore");
const UserGuildSettingsStore: FluxPersistedStore & Record<string, any> = findStoreLazy("UserGuildSettingsStore");
const TypingStore: Store & Record<string, any> = findStoreLazy("TypingStore");
const UserGuildSettingsStore: PersistedStore & Record<string, any> = findStoreLazy("UserGuildSettingsStore");
const enum IndicatorMode {
Dots = 1 << 0,

View file

@ -20,13 +20,13 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import type { FluxStore, UserRecord } from "@vencord/discord-types";
import type { Store, UserRecord } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { ChannelStore, GuildStore, UserStore } from "@webpack/common";
import { VoiceChannelSection } from "./components/VoiceChannelSection";
const VoiceStateStore: FluxStore & Record<string, any> = findStoreLazy("VoiceStateStore");
const VoiceStateStore: Store & Record<string, any> = findStoreLazy("VoiceStateStore");
const settings = definePluginSettings({
showInUserProfileModal: {

View file

@ -23,7 +23,7 @@ import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins";
import { wordsToTitle } from "@utils/text";
import definePlugin, { OptionType, type PluginOptionsItem, ReporterTestable } from "@utils/types";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
import { Button, ChannelStore, Forms, GuildMemberStore, SelectedChannelStore, SelectedGuildStore, useMemo, UserStore } from "@webpack/common";
import type { ReactElement } from "react";
@ -38,7 +38,7 @@ interface VoiceState {
selfMute: boolean;
}
const VoiceStateStore: FluxStore & Record<string, any> = findStoreLazy("VoiceStateStore");
const VoiceStateStore: Store & Record<string, any> = findStoreLazy("VoiceStateStore");
// Mute/Deaf for other people than you is commented out, because otherwise someone can spam it and it will be annoying
// Filtering out events is not as simple as just dropping duplicates, as otherwise mute, unmute, mute would

View file

@ -27,7 +27,7 @@ import { ModalContent, ModalFooter, ModalHeader, type ModalProps, ModalRoot, ope
import { useAwaiter } from "@utils/react";
import definePlugin from "@utils/types";
import { chooseFile } from "@utils/web";
import { type ChannelRecord, type FluxStore, MessageFlags, MessageType } from "@vencord/discord-types";
import { type ChannelRecord, MessageFlags, MessageType, type Store } from "@vencord/discord-types";
import { findByPropsLazy, findLazy, findStoreLazy } from "@webpack";
import { Button, Card, Constants, FluxDispatcher, Forms, lodash, Menu, MessageActionCreators, Permissions, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from "@webpack/common";
import type { ComponentType } from "react";
@ -39,7 +39,7 @@ import { VoicePreview } from "./VoicePreview";
import { VoiceRecorderWeb } from "./WebRecorder";
const CloudUpload = findLazy(m => m.prototype?.trackUploadFinished);
const PendingReplyStore: FluxStore & Record<string, any> = findStoreLazy("PendingReplyStore");
const PendingReplyStore: Store & Record<string, any> = findStoreLazy("PendingReplyStore");
const OptionClasses: Record<string, string> = findByPropsLazy("optionName", "optionIcon", "optionLabel");
export type VoiceRecorder = ComponentType<{

View file

@ -17,8 +17,8 @@
*/
import { classNameFactory } from "@api/Styles";
import type { FluxStore } from "@vencord/discord-types";
import type { Store } from "@vencord/discord-types";
import { findStoreLazy } from "@webpack";
export const MediaEngineStore: FluxStore & Record<string, any> = findStoreLazy("MediaEngineStore");
export const MediaEngineStore: Store & Record<string, any> = findStoreLazy("MediaEngineStore");
export const cl = classNameFactory("vc-vmsg-");

View file

@ -18,7 +18,7 @@
import type { Command } from "@api/Commands";
import type { NavContextMenuPatchCallback } from "@api/ContextMenu";
import type { FluxActionHandlerMap } from "@vencord/discord-types";
import type { ActionHandlerMap } from "@vencord/discord-types";
import type { ComponentType, FunctionComponent } from "react";
import type Electron from "standalone-electron-types";
import type { Promisable } from "type-fest";
@ -129,7 +129,7 @@ export interface PluginDef {
/**
* Allows you to subscribe to Flux actions
*/
flux?: Partial<FluxActionHandlerMap>;
flux?: Partial<ActionHandlerMap>;
/**
* Allows you to manipulate context menus
*/

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { Flux as $Flux } from "@vencord/discord-types";
import type { FetchStoreFactory, Flux as $Flux, StoreArrayStateHook, StoreObjectStateHook, StoreStateHook, UnequatableStateComparator } from "@vencord/discord-types";
import type * as Stores from "@vencord/discord-types/src/stores";
// eslint-disable-next-line path-alias/no-relative
@ -25,7 +25,7 @@ import { waitForStore } from "./internal";
export const Flux: $Flux = findByPropsLazy("connectStores");
export const createFetchStore: Stores.FetchStoreFactory
export const createFetchStore: FetchStoreFactory
= findByCodeLazy("dangerousAbortOnCleanup:", "new AbortController");
/**
@ -38,7 +38,7 @@ export const createFetchStore: Stores.FetchStoreFactory
*
* @example const user = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), null, (old, current) => old.id === current.id);
*/
export const useStateFromStores: Stores.StoreStateHook = findByCodeLazy("useStateFromStores");
export const useStateFromStores: StoreStateHook = findByCodeLazy("useStateFromStores");
const shallowEqual: (
a?: {},
@ -48,7 +48,7 @@ const shallowEqual: (
) => boolean = findByCodeLazy('"shallowEqual: unequal key lengths "');
/** @see {@link useStateFromStores} */
export const useStateFromStoresObject: Stores.StoreObjectStateHook
export const useStateFromStoresObject: StoreObjectStateHook
= (a, b, c) => useStateFromStores(a, b, c, shallowEqual);
// shallowEqual.tsx
@ -56,10 +56,10 @@ const areArraysShallowEqual = (a: readonly unknown[], b?: readonly unknown[] | n
b != null && a.length === b.length && a.every((x, i) => x === b[i]);
/** @see {@link useStateFromStores} */
export const useStateFromStoresArray: Stores.StoreArrayStateHook
export const useStateFromStoresArray: StoreArrayStateHook
= (a, b, c) => useStateFromStores(a, b, c, areArraysShallowEqual);
export const statesWillNeverBeEqual: Stores.UnequatableStateComparator = () => false;
export const statesWillNeverBeEqual: UnequatableStateComparator = () => false;
export let ApplicationStore: Stores.ApplicationStore;
waitForStore("ApplicationStore", m => { ApplicationStore = m; });

View file

@ -16,15 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { ChannelMessages as $ChannelMessages, ChannelRecord, DraftType, FluxDispatcher as $FluxDispatcher, FormattedMessage as $FormattedMessage, I18N, MessageFactory, UserRecord } from "@vencord/discord-types";
import type { ChannelMessages as $ChannelMessages, ChannelRecord, Dispatcher, DraftType, FormattedMessage as $FormattedMessage, I18N, MessageFactory, UserRecord } from "@vencord/discord-types";
import type { ReactNode } from "react";
// eslint-disable-next-line path-alias/no-relative
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "../webpack";
import type * as t from "./types/utils";
export let FluxDispatcher: $FluxDispatcher;
waitFor(["dispatch", "subscribe"], (m: $FluxDispatcher) => {
export let FluxDispatcher: Dispatcher;
waitFor(["dispatch", "subscribe"], (m: Dispatcher) => {
FluxDispatcher = m;
// Non import call to avoid circular dependency
Vencord.Plugins.subscribeAllPluginsFluxActions(m);