Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: misc. changes
Browse files Browse the repository at this point in the history
ryan-0324 committed Aug 1, 2024
1 parent 2cf37bd commit 9e9d465
Showing 20 changed files with 244 additions and 211 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@
"nanoid": "^5.0.7"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.4.0",
"@stylistic/eslint-plugin": "^2.6.0",
"@stylistic/stylelint-config": "^2.0.0",
"@stylistic/stylelint-plugin": "^3.0.0",
"@types/chrome": "^0.0.269",
@@ -67,22 +67,22 @@
"highlight.js": "11.8.0",
"html-minifier-terser": "^7.2.0",
"moment": "2.22.2",
"puppeteer-core": "^22.13.1",
"puppeteer-core": "^22.15.0",
"standalone-electron-types": "^1.0.0",
"stylelint": "^16.8.1",
"stylelint-config-standard": "^36.0.1",
"ts-patch": "^3.2.1",
"tsx": "^4.16.2",
"tsx": "^4.16.3",
"type-fest": "^4.23.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0-alpha.60",
"typescript-eslint": "^8.0.0",
"typescript-transform-paths": "^3.4.7",
"zip-local": "^0.3.5"
},
"packageManager": "pnpm@9.6.0",
"pnpm": {
"patchedDependencies": {
"@stylistic/eslint-plugin-js@2.4.0": "patches/@stylistic__eslint-plugin-js@2.4.0.patch",
"@stylistic/eslint-plugin-js@2.6.0": "patches/@stylistic__eslint-plugin-js@2.6.0.patch",
"eslint-plugin-path-alias@2.1.0": "patches/eslint-plugin-path-alias@2.1.0.patch",
"eslint@9.8.0": "patches/eslint@9.8.0.patch",
"standalone-electron-types@1.0.0": "patches/standalone-electron-types@1.0.0.patch"
10 changes: 5 additions & 5 deletions packages/discord-types/package.json
Original file line number Diff line number Diff line change
@@ -30,21 +30,21 @@
"type-fest": "^4.23.0"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.4.0",
"@stylistic/eslint-plugin": "^2.6.0",
"@types/node": "^20.14.13",
"@types/semver": "^7.5.8",
"@typescript-eslint/typescript-estree": "^8.0.0-alpha.60",
"@typescript-eslint/typescript-estree": "^8.0.0",
"eslint": "^9.8.0",
"eslint-plugin-check-file": "^2.8.0",
"eslint-plugin-import-x": "^3.1.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.0.1",
"puppeteer-core": "^22.13.1",
"puppeteer-core": "^22.15.0",
"semver": "^7.6.3",
"tsx": "^4.16.2",
"tsx": "^4.16.3",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0-alpha.60"
"typescript-eslint": "^8.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/discord-types/src/flux/FluxActionHandlersGraph.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
import type { DepGraph } from "dependency-graph";
import type { UnionToIntersection } from "type-fest";

import type { Nullish } from "../internal";
import type { IsAny, Nullish } from "../internal";
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
import type { FluxDispatchBand } from "./FluxDispatcher";

@@ -55,7 +55,7 @@ export type FluxActionHandlerMap<Action extends FluxAction = FluxAction>
= UnionToIntersection<
Action extends unknown
? PropertyKey extends keyof Action
? 0 extends 1 & Action[PropertyKey]
? IsAny<Action[string]> & IsAny<Action[number]> & IsAny<Action[symbol]> extends unknown
? { [ActionType in Action["type"]]: (action: any) => void; }
: { [ActionType in Action["type"]]: (action: Action & { type: ActionType; }) => void; }
: { [ActionType in Action["type"]]: (action: Action & { type: ActionType; }) => void; }
4 changes: 3 additions & 1 deletion packages/discord-types/src/flux/fluxActions.ts
Original file line number Diff line number Diff line change
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import type { IsAny } from "../internal";

export type FluxActionHandler<Action extends FluxAction = FluxAction, Return = void>
= Action extends unknown
? PropertyKey extends keyof Action
? 0 extends 1 & Action[PropertyKey]
? IsAny<Action[string]> & IsAny<Action[number]> & IsAny<Action[symbol]> extends unknown
? (action: any) => Return
: (action: Action) => Return
: (action: Action) => Return
7 changes: 7 additions & 0 deletions packages/discord-types/src/general/messages/MessageRecord.ts
Original file line number Diff line number Diff line change
@@ -164,6 +164,13 @@ export interface MessageReference {
channel_id: string;
guild_id?: string;
message_id?: string;
type: MessageReferenceType;
}

// Original name: MessageReferenceTypes
export enum MessageReferenceType {
DEFAULT = 0,
FORWARD = 1,
}

export interface MessagePoll {
3 changes: 3 additions & 0 deletions packages/discord-types/src/internal.ts
Original file line number Diff line number Diff line change
@@ -15,6 +15,9 @@ export type Defined<T> = Exclude<T, undefined>;
/** @internal */
export type GenericConstructor = new (...args: any[]) => unknown;

/** @internal */
export type IsAny<T> = 0 extends 1 & T ? unknown : never;

/** @internal */
export type Nullish = null | undefined;

2 changes: 1 addition & 1 deletion packages/vencord-types/package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"fs-extra": "^11.2.0",
"tsx": "^4.16.2",
"tsx": "^4.16.3",
"typescript": "^5.5.4"
}
}
Loading

0 comments on commit 9e9d465

Please sign in to comment.