mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
@vencord/discord-types 1.0.0
This commit is contained in:
parent
f5bed654ba
commit
2090f62412
76 changed files with 1017 additions and 881 deletions
25
package.json
25
package.json
|
@ -49,38 +49,39 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/chrome": "^0.0.246",
|
||||
"@types/diff": "^5.0.3",
|
||||
"@types/lodash": "~4.17.4",
|
||||
"@types/diff": "^5.2.1",
|
||||
"@types/html-minifier-terser": "^7.0.2",
|
||||
"@types/lodash": "~4.17.5",
|
||||
"@types/node": "^18.19.34",
|
||||
"@types/react": "~18.2.79",
|
||||
"@types/react-dom": "~18.2.25",
|
||||
"@types/yazl": "^2.4.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
||||
"@typescript-eslint/parser": "^7.12.0",
|
||||
"@types/yazl": "^2.4.5",
|
||||
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
||||
"@typescript-eslint/parser": "^7.13.0",
|
||||
"@vencord/discord-types": "workspace:^",
|
||||
"diff": "^5.1.0",
|
||||
"discord-types": "^1.3.26",
|
||||
"diff": "^5.2.0",
|
||||
"discord-types": "^1.3.3",
|
||||
"esbuild": "^0.15.18",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-path-alias": "^1.1.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.0",
|
||||
"eslint-plugin-unused-imports": "^3.2.0",
|
||||
"highlight.js": "11.7.0",
|
||||
"highlight.js": "11.8.0",
|
||||
"html-minifier-terser": "^7.2.0",
|
||||
"moment": "2.22.2",
|
||||
"puppeteer-core": "^19.11.1",
|
||||
"standalone-electron-types": "^1.0.0",
|
||||
"stylelint": "^15.6.0",
|
||||
"stylelint": "^15.11.0",
|
||||
"stylelint-config-standard": "^33.0.0",
|
||||
"ts-patch": "^3.1.2",
|
||||
"tsx": "^4.13.3",
|
||||
"ts-patch": "^3.2.0",
|
||||
"tsx": "^4.15.4",
|
||||
"type-fest": "^4.20.0",
|
||||
"typescript": "^5.4.5",
|
||||
"typescript-transform-paths": "^3.4.7",
|
||||
"zip-local": "^0.3.5"
|
||||
},
|
||||
"packageManager": "pnpm@9.2.0",
|
||||
"packageManager": "pnpm@9.3.0",
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"eslint-plugin-path-alias@1.1.0": "patches/eslint-plugin-path-alias@1.1.0.patch",
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import stylistic from "@stylistic/eslint-plugin";
|
||||
import checkFile from "eslint-plugin-check-file";
|
||||
import eslintPluginHeaders from "eslint-plugin-headers";
|
||||
import eslintPluginImport from "eslint-plugin-import-x";
|
||||
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
||||
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
||||
import unusedImports from "eslint-plugin-unused-imports";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
files: ["**/*.mjs", "**/*.ts"],
|
||||
files: ["**/*.?(c|m)[jt]s?(x)"],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
|
@ -19,10 +21,12 @@ export default tseslint.config(
|
|||
plugins: {
|
||||
"@stylistic": stylistic,
|
||||
"@typescript-eslint": tseslint.plugin,
|
||||
"check-file": checkFile,
|
||||
headers: eslintPluginHeaders,
|
||||
import: eslintPluginImport,
|
||||
"simple-import-sort": simpleImportSort,
|
||||
unicorn: eslintPluginUnicorn,
|
||||
"unused-imports": unusedImports,
|
||||
},
|
||||
rules: {
|
||||
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
||||
|
@ -49,7 +53,7 @@ export default tseslint.config(
|
|||
"@stylistic/no-extra-semi": "error",
|
||||
"@stylistic/no-floating-decimal": "error",
|
||||
"@stylistic/no-multi-spaces": "error",
|
||||
"@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxBOF: 0, maxEOF: 0 }],
|
||||
"@stylistic/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
||||
"@stylistic/no-trailing-spaces": "error",
|
||||
"@stylistic/no-whitespace-before-property": "error",
|
||||
"@stylistic/object-curly-newline": "error",
|
||||
|
@ -94,7 +98,10 @@ export default tseslint.config(
|
|||
}
|
||||
}],
|
||||
"@typescript-eslint/method-signature-style": "error",
|
||||
"@typescript-eslint/naming-convention": ["error", { selector: "typeLike", format: ["PascalCase"] }],
|
||||
"@typescript-eslint/naming-convention": ["error", {
|
||||
selector: "typeLike",
|
||||
format: ["PascalCase"]
|
||||
}],
|
||||
"@typescript-eslint/no-duplicate-enum-values": "error",
|
||||
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
||||
"@typescript-eslint/no-empty-interface": "error",
|
||||
|
@ -107,23 +114,19 @@ export default tseslint.config(
|
|||
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
||||
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
||||
"@typescript-eslint/no-unused-vars": ["error", {
|
||||
args: "all",
|
||||
argsIgnorePattern: "^_",
|
||||
destructuredArrayIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_"
|
||||
}],
|
||||
"@typescript-eslint/no-useless-empty-export": "error",
|
||||
"@typescript-eslint/prefer-function-type": "error",
|
||||
"@typescript-eslint/triple-slash-reference": "error",
|
||||
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
|
||||
"check-file/filename-naming-convention": ["error", { "**/*.{mjs,ts}": "+([.0-9A-Za-z])" }],
|
||||
"check-file/folder-naming-convention": ["error", { "**/": "CAMEL_CASE" }],
|
||||
"import/extensions": "error",
|
||||
"import/first": "error",
|
||||
"import/newline-after-import": ["error", { considerComments: true }],
|
||||
"import/no-absolute-path": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/no-empty-named-blocks": "error",
|
||||
"import/no-extraneous-dependencies": "error",
|
||||
"import/no-extraneous-dependencies": ["error", { includeTypes: true }],
|
||||
"import/no-relative-packages": "error",
|
||||
"import/no-self-import": "error",
|
||||
"import/no-unassigned-import": "error",
|
||||
|
@ -131,18 +134,25 @@ export default tseslint.config(
|
|||
"simple-import-sort/exports": "error",
|
||||
"simple-import-sort/imports": ["error", { groups: [["^[^.]"]] }],
|
||||
"unicorn/escape-case": "error",
|
||||
"unicorn/filename-case": ["error", { cases: { camelCase: true, pascalCase: true } }],
|
||||
"unicorn/no-hex-escape": "error",
|
||||
"unicorn/no-zero-fractions": "error",
|
||||
"unicorn/number-literal-case": "error",
|
||||
"unicorn/numeric-separators-style": ["error", { number: { minimumDigits: 0 } }],
|
||||
"unicorn/prefer-export-from": ["error", { ignoreUsedVariables: true }],
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"unused-imports/no-unused-vars": ["error", {
|
||||
args: "all",
|
||||
argsIgnorePattern: "^_",
|
||||
destructuredArrayIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_"
|
||||
}],
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["src/**/*.ts"],
|
||||
files: ["src/**/*"],
|
||||
rules: {
|
||||
"@typescript-eslint/prefer-enum-initializers": "error",
|
||||
"check-file/filename-blocklist": ["error", { "!**/!(*.d).ts": "!(*.d).ts" }],
|
||||
"headers/header-format": ["error", {
|
||||
source: "string",
|
||||
content: [
|
||||
|
@ -158,13 +168,25 @@ export default tseslint.config(
|
|||
}
|
||||
}],
|
||||
"import/no-default-export": "error",
|
||||
"import/no-unused-modules": "error",
|
||||
"import/no-extraneous-dependencies": ["error", {
|
||||
devDependencies: false,
|
||||
includeTypes: true
|
||||
}],
|
||||
"import/no-unassigned-import": "error",
|
||||
"no-restricted-globals": ["error", "_", "JSX", "React"],
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
"ImportDeclaration[importKind=value]",
|
||||
"TSEnumDeclaration[const=false]",
|
||||
":expression:not([declare=true] *, [type=/^TS/] *, ExportAllDeclaration *, ImportDeclaration *)",
|
||||
"ObjectPattern.params",
|
||||
"TSEnumDeclaration:matches([const=true], [declare=true])",
|
||||
],
|
||||
}
|
||||
},
|
||||
{
|
||||
// https://github.com/import-js/eslint-plugin-import/issues/2414
|
||||
files: ["src/**/!(index.ts)"],
|
||||
rules: {
|
||||
"import/no-unused-modules": ["error", { missingExports: true }],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vencord/discord-types",
|
||||
"version": "0.0.0-development",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"author": "Vencord",
|
||||
|
@ -9,6 +9,7 @@
|
|||
"url": "https://github.com/Vendicated/Vencord.git",
|
||||
"directory": "packages/discord-types"
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"files": ["src"],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
|
@ -17,10 +18,9 @@
|
|||
"test-ts": "tsc --noEmit"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"types": "./src/index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/events": "~3.0.3",
|
||||
"@types/lodash": "~4.17.4",
|
||||
"@types/lodash": "~4.17.5",
|
||||
"@types/react": "~18.2.79",
|
||||
"dependency-graph": "0.9.0",
|
||||
"moment": "2.22.2",
|
||||
|
@ -29,12 +29,14 @@
|
|||
"devDependencies": {
|
||||
"@eslint-types/unicorn": "^52.0.0",
|
||||
"@stylistic/eslint-plugin": "^2.1.0",
|
||||
"eslint": "^9.4.0",
|
||||
"eslint": "^9.5.0",
|
||||
"eslint-plugin-check-file": "^2.8.0",
|
||||
"eslint-plugin-headers": "^1.1.2",
|
||||
"eslint-plugin-import-x": "^0.5.1",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.0",
|
||||
"eslint-plugin-unicorn": "^53.0.0",
|
||||
"eslint-plugin-unicorn": "^54.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.0.0",
|
||||
"typescript": "^5.4.5",
|
||||
"typescript-eslint": "^8.0.0-alpha.28"
|
||||
"typescript-eslint": "^8.0.0-alpha.30"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,41 +5,14 @@
|
|||
*/
|
||||
|
||||
import type { DepGraph } from "dependency-graph";
|
||||
import type { UnionToIntersection } from "type-fest";
|
||||
|
||||
import type { Nullish } from "../internal";
|
||||
import type { ExtractAction, FluxAction, FluxActionType } from "./fluxActions";
|
||||
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
|
||||
import type { FluxDispatchBand } from "./FluxDispatcher";
|
||||
|
||||
/*
|
||||
export type FluxActionHandler<Action = FluxAction, Return = void> = Action extends FluxAction
|
||||
? Exclude<keyof OmitIndexSignature<Action>, "type"> extends never
|
||||
? (action: any) => Return
|
||||
: (action: Action) => Return
|
||||
: never;
|
||||
*/
|
||||
|
||||
export type FluxActionHandler<Action extends FluxAction = FluxAction> = (action: Action) => void;
|
||||
|
||||
export type FluxActionHandlerMap<Action extends FluxAction = FluxAction>
|
||||
= { [ActionType in Action["type"]]: FluxActionHandler<ExtractAction<Action, ActionType>>; };
|
||||
|
||||
interface FluxActionHandlersGraphNode {
|
||||
actionHandler: FluxActionHandlerMap;
|
||||
band: FluxDispatchBand;
|
||||
/** Name of a store. */
|
||||
name: string;
|
||||
storeDidChange: FluxActionHandler;
|
||||
}
|
||||
|
||||
type FluxOrderedActionHandlers<Action extends FluxAction = FluxAction> = {
|
||||
actionHandler: FluxActionHandler<Action>;
|
||||
/** Name of a store. */
|
||||
name: string;
|
||||
storeDidChange: FluxActionHandler<Action>;
|
||||
}[];
|
||||
|
||||
// Original name: ActionHandlersGraph
|
||||
export class FluxActionHandlersGraph {
|
||||
export declare class FluxActionHandlersGraph {
|
||||
_addToBand(dispatchToken: string, dispatchBand: FluxDispatchBand): void;
|
||||
_bandToken(dispatchBand: FluxDispatchBand): string;
|
||||
_computeOrderedActionHandlers<ActionType extends FluxActionType>(
|
||||
|
@ -50,7 +23,7 @@ export class FluxActionHandlersGraph {
|
|||
_validateDependencies(fromDispatchToken: string, toDispatchToken: string): void;
|
||||
addDependencies(fromDispatchToken: string, toDispatchTokens: string[]): void;
|
||||
createToken(): string;
|
||||
getOrderedActionHandlers<ActionType extends FluxActionType>({ type }: {
|
||||
getOrderedActionHandlers<ActionType extends FluxActionType>(partialAction: {
|
||||
type: ActionType;
|
||||
}): FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>>;
|
||||
register<Action extends FluxAction>(
|
||||
|
@ -58,7 +31,7 @@ export class FluxActionHandlersGraph {
|
|||
actionHandlers: FluxActionHandlerMap<Action>,
|
||||
storeDidChange: FluxActionHandler<Action>,
|
||||
dispatchBand: FluxDispatchBand,
|
||||
dispatchToken?: string | undefined
|
||||
dispatchToken?: string | undefined /* = this.createToken() */
|
||||
): string;
|
||||
|
||||
_dependencyGraph: DepGraph<FluxActionHandlersGraphNode>;
|
||||
|
@ -68,3 +41,28 @@ export class FluxActionHandlersGraph {
|
|||
};
|
||||
_orderedCallbackTokens: string[] | Nullish;
|
||||
}
|
||||
|
||||
export interface FluxActionHandlersGraphNode {
|
||||
actionHandler: Partial<FluxActionHandlerMap>;
|
||||
band: FluxDispatchBand;
|
||||
/** Name of a store. */
|
||||
name: string;
|
||||
storeDidChange: FluxActionHandler;
|
||||
}
|
||||
|
||||
export type FluxActionHandlerMap<Action extends FluxAction = FluxAction>
|
||||
// Workaround to avoid ts(2589)
|
||||
= UnionToIntersection<
|
||||
Action extends unknown
|
||||
? { type: never; } extends Action
|
||||
? { [ActionType in Action["type"]]: (action: any) => void; }
|
||||
: { [ActionType in Action["type"]]: (action: { type: ActionType; } & Omit<Action, "type">) => void; }
|
||||
: never
|
||||
>;
|
||||
|
||||
export type FluxOrderedActionHandlers<Action extends FluxAction = FluxAction> = {
|
||||
actionHandler: FluxActionHandler<Action>;
|
||||
/** Name of a store. */
|
||||
name: string;
|
||||
storeDidChange: FluxActionHandler<Action>;
|
||||
}[];
|
31
packages/discord-types/src/flux/FluxActionLog.ts
Normal file
31
packages/discord-types/src/flux/FluxActionLog.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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<this, "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 {
|
||||
/** Name of a store. */
|
||||
name: string;
|
||||
time: number;
|
||||
}
|
35
packages/discord-types/src/flux/FluxActionLogger.ts
Normal file
35
packages/discord-types/src/flux/FluxActionLogger.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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];
|
|
@ -5,11 +5,12 @@
|
|||
*/
|
||||
|
||||
import type { Nullish } from "../internal";
|
||||
import type { FluxActionHandler, FluxActionHandlerMap, FluxActionHandlersGraph } from "./fluxActionHandlers";
|
||||
import type { ExtractAction, FluxAction, FluxActionLogger, FluxActionType } from "./fluxActions";
|
||||
import type { FluxActionHandlerMap, FluxActionHandlersGraph } from "./FluxActionHandlersGraph";
|
||||
import type { FluxActionLogger } from "./FluxActionLogger";
|
||||
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
|
||||
|
||||
// Original name: Dispatcher
|
||||
export class FluxDispatcher {
|
||||
export declare class FluxDispatcher {
|
||||
constructor(
|
||||
defaultBand?: FluxDispatchBand | undefined /* = FluxDispatchBand.EARLY */,
|
||||
actionLogger?: FluxActionLogger | Nullish,
|
||||
|
@ -32,8 +33,8 @@ export class FluxDispatcher {
|
|||
storeName: string,
|
||||
actionHandlers: FluxActionHandlerMap<Action>,
|
||||
storeDidChange: FluxActionHandler<Action>,
|
||||
dispatchBand?: FluxDispatchBand | Nullish,
|
||||
dispatchToken?: string | undefined
|
||||
dispatchBand?: FluxDispatchBand | Nullish, /* = this._defaultBand */
|
||||
dispatchToken?: string | undefined /* = this._actionHandlers.createToken() */
|
||||
): string;
|
||||
subscribe<ActionType extends FluxActionType>(
|
||||
actionType: ActionType,
|
||||
|
@ -56,12 +57,12 @@ export class FluxDispatcher {
|
|||
};
|
||||
_waitQueue: (() => void)[];
|
||||
actionLogger: FluxActionLogger;
|
||||
functionCache: FluxActionHandlerMap;
|
||||
functionCache: Partial<FluxActionHandlerMap>;
|
||||
}
|
||||
|
||||
// Original name: DispatchBand
|
||||
// Enum keys made screaming snake case for consistency.
|
||||
export const enum FluxDispatchBand {
|
||||
export enum FluxDispatchBand {
|
||||
EARLY = 0,
|
||||
DATABASE = 1,
|
||||
DEFAULT = 2,
|
|
@ -7,7 +7,7 @@
|
|||
import type { FluxStore, FluxSyncWithFunction } from "../stores/abstract/FluxStore";
|
||||
|
||||
// Original name: Emitter
|
||||
export class FluxEmitter {
|
||||
export declare class FluxEmitter {
|
||||
batched<T>(callback: () => T): T;
|
||||
destroy(): void;
|
||||
emit(): void;
|
||||
|
@ -17,8 +17,9 @@ export class FluxEmitter {
|
|||
getIsPaused(): boolean;
|
||||
injectBatchEmitChanges(batchEmitChanges: () => unknown): void;
|
||||
markChanged(store: FluxStore): void;
|
||||
/** If timeout is omitted, Emitter will pause until resume is called. */
|
||||
pause(timeout?: number | undefined): void;
|
||||
resume(shouldEmit?: boolean | undefined): void;
|
||||
resume(shouldEmit?: boolean | undefined /* = true */): void;
|
||||
|
||||
changedStores: Set<FluxStore>;
|
||||
changeSentinel: number;
|
94
packages/discord-types/src/flux/fluxActions.d.ts
vendored
94
packages/discord-types/src/flux/fluxActions.d.ts
vendored
File diff suppressed because one or more lines are too long
58
packages/discord-types/src/flux/fluxActions.ts
Normal file
58
packages/discord-types/src/flux/fluxActions.ts
Normal file
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,9 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
export * from "./fluxActionHandlers";
|
||||
export * from "./FluxActionHandlersGraph";
|
||||
export * from "./FluxActionLog";
|
||||
export * from "./FluxActionLogger";
|
||||
export * from "./fluxActions";
|
||||
export * from "./FluxDispatcher";
|
||||
export * from "./FluxEmitter";
|
|
@ -14,6 +14,7 @@ export interface Activity {
|
|||
emoji?: ActivityEmoji;
|
||||
flags?: ActivityFlags;
|
||||
id: string;
|
||||
metadata?: Record<string, any>;
|
||||
name: string;
|
||||
party?: ActivityParty;
|
||||
platform?: ActivityGamePlatform;
|
||||
|
@ -45,7 +46,7 @@ export interface ActivityGuildEmoji {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export const enum ActivityFlags {
|
||||
export enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
JOIN = 1 << 1,
|
||||
SYNC = 1 << 4,
|
||||
|
@ -61,7 +62,7 @@ export interface ActivityParty {
|
|||
}
|
||||
|
||||
// Original name: ActivityGamePlatforms
|
||||
export const enum ActivityGamePlatform {
|
||||
export enum ActivityGamePlatform {
|
||||
ANDROID = "android",
|
||||
DESKTOP = "desktop",
|
||||
EMBEDDED = "embedded",
|
||||
|
@ -72,7 +73,7 @@ export const enum ActivityGamePlatform {
|
|||
XBOX = "xbox",
|
||||
}
|
||||
|
||||
export const enum ActivityPlatform {
|
||||
export enum ActivityPlatform {
|
||||
DESKTOP = "desktop",
|
||||
MOBILE = "mobile",
|
||||
}
|
||||
|
@ -83,7 +84,7 @@ export interface ActivityTimestamps {
|
|||
}
|
||||
|
||||
// Original name: ActivityTypes
|
||||
export const enum ActivityType {
|
||||
export enum ActivityType {
|
||||
PLAYING = 0,
|
||||
STREAMING = 1,
|
||||
LISTENING = 2,
|
|
@ -26,13 +26,13 @@ export type ApplicationCommand<CommandType extends ApplicationCommandType = Appl
|
|||
version: string;
|
||||
} & (CommandType extends ApplicationCommandType.CHAT ? { options?: ApplicationCommandOption[]; } : {});
|
||||
|
||||
export const enum InteractionContextType {
|
||||
export enum InteractionContextType {
|
||||
GUILD = 0,
|
||||
BOT_DM = 1,
|
||||
PRIVATE_CHANNEL = 2,
|
||||
}
|
||||
|
||||
export const enum ApplicationCommandType {
|
||||
export enum ApplicationCommandType {
|
||||
CHAT = 1,
|
||||
USER = 2,
|
||||
MESSAGE = 3,
|
||||
|
@ -125,7 +125,7 @@ export interface ApplicationCommandAttachmentOption extends ApplicationCommandNo
|
|||
type: ApplicationCommandOptionType.ATTACHMENT;
|
||||
}
|
||||
|
||||
export const enum ApplicationCommandOptionType {
|
||||
export enum ApplicationCommandOptionType {
|
||||
SUB_COMMAND = 1,
|
||||
SUB_COMMAND_GROUP = 2,
|
||||
STRING = 3,
|
|
@ -12,7 +12,7 @@ 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">;
|
||||
|
||||
export class ApplicationRecord<
|
||||
export declare class ApplicationRecord<
|
||||
OwnProperties extends ApplicationRecordOwnProperties = ApplicationRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
/** @todo */
|
||||
|
@ -85,7 +85,7 @@ export interface EmbeddedActivityConfig {
|
|||
}
|
||||
|
||||
// Original name: EmbeddedActivitySupportedPlatforms
|
||||
export const enum EmbeddedActivitySupportedPlatform {
|
||||
export enum EmbeddedActivitySupportedPlatform {
|
||||
ANDROID = "android",
|
||||
IOS = "ios",
|
||||
WEB = "web",
|
||||
|
@ -99,13 +99,13 @@ export interface EmbeddedActivityClientPlatformConfig {
|
|||
}
|
||||
|
||||
// Original name: EmbeddedActivityLabelTypes
|
||||
export const enum EmbeddedActivityLabelType {
|
||||
export enum EmbeddedActivityLabelType {
|
||||
NONE = 0,
|
||||
NEW = 1,
|
||||
UPDATED = 2,
|
||||
}
|
||||
|
||||
export const enum OrientationLockState {
|
||||
export enum OrientationLockState {
|
||||
UNLOCKED = 1,
|
||||
PORTRAIT = 2,
|
||||
LANDSCAPE = 3,
|
||||
|
@ -118,7 +118,7 @@ export interface ApplicationExecutable {
|
|||
os: string;
|
||||
}
|
||||
|
||||
export const enum ApplicationIntegrationType {
|
||||
export enum ApplicationIntegrationType {
|
||||
GUILD_INSTALL = 0,
|
||||
USER_INSTALL = 1,
|
||||
}
|
||||
|
@ -128,7 +128,8 @@ export interface ApplicationIntegrationTypeConfig {
|
|||
}
|
||||
|
||||
// Original name: OAuth2Scopes
|
||||
export const enum OAuth2Scope {
|
||||
export enum OAuth2Scope {
|
||||
ACCOUNT_GLOBAL_NAME_UPDATE = "account.global_name.update",
|
||||
ACTIVITIES_READ = "activities.read",
|
||||
ACTIVITIES_WRITE = "activities.write",
|
||||
APPLICATIONS_BUILDS_READ = "applications.builds.read",
|
||||
|
@ -144,6 +145,7 @@ export const enum OAuth2Scope {
|
|||
DM_CHANNELS_MESSAGES_WRITE = "dm_channels.messages.write",
|
||||
DM_CHANNELS_READ = "dm_channels.read",
|
||||
EMAIL = "email",
|
||||
GATEWAY_CONNECT = "gateway.connect",
|
||||
GDM_JOIN = "gdm.join",
|
||||
GUILDS = "guilds",
|
||||
GUILDS_JOIN = "guilds.join",
|
||||
|
@ -151,6 +153,7 @@ export const enum OAuth2Scope {
|
|||
IDENTIFY = "identify",
|
||||
MESSAGES_READ = "messages.read",
|
||||
OPENID = "openid",
|
||||
PAYMENT_SOURCES_COUNTRY_CODE = "payment_sources.country_code",
|
||||
PRESENCES_READ = "presences.read",
|
||||
PRESENCES_WRITE = "presences.write",
|
||||
RELATIONSHIPS_READ = "relationships.read",
|
||||
|
@ -175,7 +178,7 @@ export interface ApplicationInstallParams {
|
|||
scopes: OAuth2Scope[];
|
||||
}
|
||||
|
||||
export const enum ApplicationFlags {
|
||||
export enum ApplicationFlags {
|
||||
EMBEDDED_RELEASED = 1 << 1,
|
||||
EMBEDDED_IAP = 1 << 3,
|
||||
APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE = 1 << 6,
|
||||
|
@ -191,13 +194,13 @@ export const enum ApplicationFlags {
|
|||
SOCIAL_LAYER_INTEGRATION = 1 << 27,
|
||||
}
|
||||
|
||||
export const enum ApplicationOverlayMethodFlags {
|
||||
export enum ApplicationOverlayMethodFlags {
|
||||
DEFAULT = 0,
|
||||
OUT_OF_PROCESS = 1 << 0,
|
||||
}
|
||||
|
||||
// Original name: ApplicationTypes
|
||||
export const enum ApplicationType {
|
||||
export enum ApplicationType {
|
||||
GAME = 1,
|
||||
TICKETED_EVENTS = 3,
|
||||
GUILD_ROLE_SUBSCRIPTIONS = 4,
|
|
@ -28,7 +28,7 @@ export interface Clan {
|
|||
wildcardDescriptors: string[];
|
||||
}
|
||||
|
||||
export const enum ClanBadgeKind {
|
||||
export enum ClanBadgeKind {
|
||||
SWORD = 0,
|
||||
WATER_DROP = 1,
|
||||
SKULL = 2,
|
||||
|
@ -52,7 +52,7 @@ export const enum ClanBadgeKind {
|
|||
WIND = 20,
|
||||
}
|
||||
|
||||
export const enum ClanBannerKind {
|
||||
export enum ClanBannerKind {
|
||||
NIGHT_SKY = 0,
|
||||
CASTLE = 1,
|
||||
WORLD_MAP = 2,
|
||||
|
@ -65,7 +65,7 @@ export const enum ClanBannerKind {
|
|||
}
|
||||
|
||||
// Original name: ClanPlaystyles
|
||||
export const enum ClanPlaystyle {
|
||||
export enum ClanPlaystyle {
|
||||
NONE = 0,
|
||||
SOCIAL = 1,
|
||||
CASUAL = 2,
|
|
@ -8,7 +8,7 @@ import type { ImmutableRecord } from "./ImmutableRecord";
|
|||
|
||||
export type CompanyRecordOwnProperties = Pick<CompanyRecord, "id" | "name">;
|
||||
|
||||
export class CompanyRecord<
|
||||
export declare class CompanyRecord<
|
||||
OwnProperties extends CompanyRecordOwnProperties = CompanyRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
constructor(companyProperties: CompanyRecordOwnProperties);
|
|
@ -11,7 +11,7 @@ export type Draft<Type extends DraftType = DraftType>
|
|||
: never;
|
||||
|
||||
// Enum keys made screaming snake case for consistency.
|
||||
export const enum DraftType {
|
||||
export enum DraftType {
|
||||
CHANNEL_MESSAGE = 0,
|
||||
THREAD_SETTINGS = 1,
|
||||
FIRST_THREAD_MESSAGE = 2,
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import type { Nullish } from "../internal";
|
||||
|
||||
export class Frecency<Key extends PropertyKey = PropertyKey, Value = unknown> {
|
||||
export declare class Frecency<Key extends PropertyKey = PropertyKey, Value = unknown> {
|
||||
constructor(options: {
|
||||
afterCompute: Frecency<Key, Value>["afterCompute"];
|
||||
computeBonus: Frecency<Key, Value>["computeBonus"];
|
|
@ -28,7 +28,7 @@ export interface GuildMember {
|
|||
userId: string;
|
||||
}
|
||||
|
||||
export const enum GuildMemberFlags {
|
||||
export enum GuildMemberFlags {
|
||||
DID_REJOIN = 1 << 0,
|
||||
COMPLETED_ONBOARDING = 1 << 1,
|
||||
BYPASSES_VERIFICATION = 1 << 2,
|
|
@ -12,7 +12,7 @@ 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">;
|
||||
|
||||
export class GuildRecord<
|
||||
export declare class GuildRecord<
|
||||
OwnProperties extends GuildRecordOwnProperties = GuildRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
/** @todo */
|
||||
|
@ -22,8 +22,8 @@ export class GuildRecord<
|
|||
canHaveRaidActivityAlerts(): boolean;
|
||||
getApplicationId(): string | null;
|
||||
getEveryoneRoleId(): string;
|
||||
getIconSource(iconSize?: number | undefined, canAnimate?: boolean | undefined): IconSource;
|
||||
getIconURL(iconSize?: number | undefined, canAnimate?: boolean | undefined): string;
|
||||
getIconSource(iconSize?: number | undefined, canAnimate?: boolean | undefined /* = false */): IconSource;
|
||||
getIconURL(iconSize?: number | undefined, canAnimate?: boolean | undefined /* = false */): string;
|
||||
getMaxEmojiSlots(): number;
|
||||
getMaxRoleSubscriptionEmojiSlots(): number;
|
||||
getMaxSoundboardSlots(): number;
|
||||
|
@ -76,7 +76,7 @@ export class GuildRecord<
|
|||
}
|
||||
|
||||
// Original name: UserNotificationSettings
|
||||
export const enum UserNotificationSetting {
|
||||
export enum UserNotificationSetting {
|
||||
ALL_MESSAGES = 0,
|
||||
ONLY_MENTIONS = 1,
|
||||
NO_MESSAGES = 2,
|
||||
|
@ -84,18 +84,18 @@ export const enum UserNotificationSetting {
|
|||
}
|
||||
|
||||
// Original name: GuildExplicitContentFilterTypes
|
||||
export const enum GuildExplicitContentFilterType {
|
||||
export enum GuildExplicitContentFilterType {
|
||||
DISABLED = 0,
|
||||
MEMBERS_WITHOUT_ROLES = 1,
|
||||
ALL_MEMBERS = 2,
|
||||
}
|
||||
|
||||
// Original name: GuildFeatures
|
||||
export const enum GuildFeature {
|
||||
export enum GuildFeature {
|
||||
ANIMATED_BANNER = "ANIMATED_BANNER",
|
||||
ANIMATED_ICON = "ANIMATED_ICON",
|
||||
AUTOMOD_TRIGGER_USER_PROFILE = "AUTOMOD_TRIGGER_USER_PROFILE",
|
||||
AUTO_MODERATION = "AUTO_MODERATION",
|
||||
AUTOMOD_TRIGGER_USER_PROFILE = "AUTOMOD_TRIGGER_USER_PROFILE",
|
||||
BANNER = "BANNER",
|
||||
BURST_REACTIONS = "BURST_REACTIONS",
|
||||
CHANNEL_ICON_EMOJIS_GENERATED = "CHANNEL_ICON_EMOJIS_GENERATED",
|
||||
|
@ -131,14 +131,15 @@ export const enum GuildFeature {
|
|||
HAS_DIRECTORY_ENTRY = "HAS_DIRECTORY_ENTRY",
|
||||
HUB = "HUB",
|
||||
INTERNAL_EMPLOYEE_ONLY = "INTERNAL_EMPLOYEE_ONLY",
|
||||
INVITES_DISABLED = "INVITES_DISABLED",
|
||||
INVITE_SPLASH = "INVITE_SPLASH",
|
||||
INVITES_DISABLED = "INVITES_DISABLED",
|
||||
LINKED_TO_HUB = "LINKED_TO_HUB",
|
||||
MEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED",
|
||||
MORE_EMOJI = "MORE_EMOJI",
|
||||
MORE_SOUNDBOARD = "MORE_SOUNDBOARD",
|
||||
MORE_STICKERS = "MORE_STICKERS",
|
||||
NEWS = "NEWS",
|
||||
NEW_THREAD_PERMISSIONS = "NEW_THREAD_PERMISSIONS",
|
||||
NEWS = "NEWS",
|
||||
NON_COMMUNITY_RAID_ALERTS = "NON_COMMUNITY_RAID_ALERTS",
|
||||
PARTNERED = "PARTNERED",
|
||||
PREVIEW_ENABLED = "PREVIEW_ENABLED",
|
||||
|
@ -164,19 +165,19 @@ export const enum GuildFeature {
|
|||
}
|
||||
|
||||
// Original name: GuildHubTypes
|
||||
export const enum GuildHubType {
|
||||
export enum GuildHubType {
|
||||
DEFAULT = 0,
|
||||
HIGH_SCHOOL = 1,
|
||||
COLLEGE = 2,
|
||||
}
|
||||
|
||||
// Original name: MFALevels
|
||||
export const enum MFALevel {
|
||||
export enum MFALevel {
|
||||
NONE = 0,
|
||||
ELEVATED = 1,
|
||||
}
|
||||
|
||||
export const enum GuildNSFWContentLevel {
|
||||
export enum GuildNSFWContentLevel {
|
||||
DEFAULT = 0,
|
||||
EXPLICIT = 1,
|
||||
SAFE = 2,
|
||||
|
@ -184,14 +185,14 @@ export const enum GuildNSFWContentLevel {
|
|||
}
|
||||
|
||||
// Original name: BoostedGuildTiers
|
||||
export const enum BoostedGuildTier {
|
||||
export enum BoostedGuildTier {
|
||||
NONE = 0,
|
||||
TIER_1 = 1,
|
||||
TIER_2 = 2,
|
||||
TIER_3 = 3,
|
||||
}
|
||||
|
||||
export const enum SystemChannelFlags {
|
||||
export enum SystemChannelFlags {
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,
|
||||
|
@ -202,7 +203,7 @@ export const enum SystemChannelFlags {
|
|||
}
|
||||
|
||||
// Original name: VerificationLevels
|
||||
export const enum VerificationLevel {
|
||||
export enum VerificationLevel {
|
||||
NONE = 0,
|
||||
LOW = 1,
|
||||
MEDIUM = 2,
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// Original name: Record
|
||||
// Renamed to avoid name conflicts with TypeScripts's Record utility type.
|
||||
export class ImmutableRecord<OwnProperties extends object = object> {
|
||||
export declare class ImmutableRecord<OwnProperties extends object = object> {
|
||||
merge(collection: Partial<OwnProperties>): this;
|
||||
set<Key extends keyof OwnProperties>(key: Key, value: OwnProperties[Key]): this;
|
||||
toJS(): OwnProperties;
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
/*
|
||||
// bigint enums are not yet possible: https://github.com/microsoft/TypeScript/issues/37783
|
||||
export const enum Permissions {
|
||||
export enum Permissions {
|
||||
CREATE_INSTANT_INVITE = 1n << 0n,
|
||||
KICK_MEMBERS = 1n << 1n,
|
||||
BAN_MEMBERS = 1n << 2n,
|
||||
|
@ -57,6 +57,7 @@ export const enum Permissions {
|
|||
USE_CLYDE_AI = 1n << 47n,
|
||||
SET_VOICE_CHANNEL_STATUS = 1n << 48n,
|
||||
SEND_POLLS = 1n << 49n,
|
||||
USE_EXTERNAL_APPS = 1n << 50n,
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -71,7 +72,7 @@ export interface PermissionOverwrite {
|
|||
type: PermissionOverwriteType;
|
||||
}
|
||||
|
||||
export const enum PermissionOverwriteType {
|
||||
export enum PermissionOverwriteType {
|
||||
ROLE = 0,
|
||||
MEMBER = 1,
|
||||
}
|
|
@ -8,7 +8,7 @@ import type { Nullish, Optional } from "../internal";
|
|||
import type { BasicPermissionsObject } from "../stores/PermissionStore";
|
||||
import type { GuildChannelRecord } from "./channels/ChannelRecord";
|
||||
|
||||
export class ReadState<Type extends ReadStateType = ReadStateType> {
|
||||
export declare class ReadState<Type extends ReadStateType = ReadStateType> {
|
||||
constructor(channelId: string, type?: ChannelIdReadStateType | undefined);
|
||||
constructor(userId: string, type: UserIdReadStateType);
|
||||
constructor(guildId: string, type: GuildIdReadStateType);
|
||||
|
@ -175,7 +175,7 @@ export interface GuildChannelOverride {
|
|||
muted: boolean;
|
||||
}
|
||||
|
||||
export const enum ChannelNotificationSettingsFlags {
|
||||
export enum ChannelNotificationSettingsFlags {
|
||||
UNREADS_ONLY_MENTIONS = 1 << 9,
|
||||
UNREADS_ALL_MESSAGES = 1 << 10,
|
||||
FAVORITED = 1 << 11,
|
||||
|
@ -197,7 +197,7 @@ export interface ReadStateSnapshot {
|
|||
unread: boolean;
|
||||
}
|
||||
|
||||
export const enum ReadStateFlags {
|
||||
export enum ReadStateFlags {
|
||||
IS_GUILD_CHANNEL = 1 << 0,
|
||||
IS_THREAD = 1 << 1,
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ export type UserIdReadStateType = ReadStateType.NOTIFICATION_CENTER | ReadStateT
|
|||
export type GuildIdReadStateType = ReadStateType.GUILD_EVENT | ReadStateType.GUILD_HOME | ReadStateType.GUILD_ONBOARDING_QUESTION;
|
||||
|
||||
// Original name: ReadStateTypes
|
||||
export const enum ReadStateType {
|
||||
export enum ReadStateType {
|
||||
CHANNEL = 0,
|
||||
GUILD_EVENT = 1,
|
||||
NOTIFICATION_CENTER = 2,
|
|
@ -17,17 +17,19 @@ export interface Role {
|
|||
originalPosition: number;
|
||||
permissions: /* Permissions */ bigint;
|
||||
position: number;
|
||||
tags: {
|
||||
available_for_purchase?: null;
|
||||
bot_id?: string;
|
||||
guild_connections?: null;
|
||||
integration_id?: string;
|
||||
premium_subscriber?: null;
|
||||
subscription_listing_id?: string;
|
||||
};
|
||||
tags: RoleTags;
|
||||
unicodeEmoji: string | null;
|
||||
}
|
||||
|
||||
export const enum RoleFlags {
|
||||
export enum RoleFlags {
|
||||
IN_PROMPT = 1,
|
||||
}
|
||||
|
||||
export interface RoleTags {
|
||||
available_for_purchase?: null;
|
||||
bot_id?: string;
|
||||
guild_connections?: null;
|
||||
integration_id?: string;
|
||||
premium_subscriber?: null;
|
||||
subscription_listing_id?: string;
|
||||
}
|
|
@ -81,7 +81,7 @@ export interface ProfileConnectedAccountData {
|
|||
}
|
||||
|
||||
// Original name: PlatformTypes
|
||||
export const enum PlatformType {
|
||||
export enum PlatformType {
|
||||
AMAZON_MUSIC = "amazon-music",
|
||||
BATTLENET = "battlenet",
|
||||
BUNGIE = "bungie",
|
|
@ -10,7 +10,7 @@ import type { IconSource } from "./misc";
|
|||
|
||||
export type UserRecordOwnProperties = Pick<UserRecord, "avatar" | "avatarDecorationData" | "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">;
|
||||
|
||||
export class UserRecord<
|
||||
export declare class UserRecord<
|
||||
OwnProperties extends UserRecordOwnProperties = UserRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
/** @todo */
|
||||
|
@ -26,13 +26,13 @@ export class UserRecord<
|
|||
get createdAt(): Date;
|
||||
getAvatarSource(
|
||||
guildId?: string | Nullish,
|
||||
canAnimate?: boolean | undefined,
|
||||
avatarSize?: number | undefined
|
||||
canAnimate?: boolean | undefined /* = false */,
|
||||
avatarSize?: number | undefined /* = 128 */
|
||||
): IconSource;
|
||||
getAvatarURL(
|
||||
guildId?: string | Nullish,
|
||||
avatarSize?: number | undefined,
|
||||
canAnimate?: boolean | undefined
|
||||
avatarSize?: number | undefined /* = 128 */,
|
||||
canAnimate?: boolean | undefined /* = false */
|
||||
): string;
|
||||
hasAvatarForGuild(guildId?: string | Nullish): boolean;
|
||||
hasDisabledPremium(): boolean;
|
||||
|
@ -97,7 +97,7 @@ export interface UserClanData {
|
|||
tag: string | null;
|
||||
}
|
||||
|
||||
export const enum UserFlags {
|
||||
export enum UserFlags {
|
||||
STAFF = 1 << 0,
|
||||
PARTNER = 1 << 1,
|
||||
HYPESQUAD = 1 << 2,
|
||||
|
@ -124,10 +124,10 @@ export const enum UserFlags {
|
|||
}
|
||||
|
||||
// Original name: PremiumTypes
|
||||
export const enum UserPremiumType {
|
||||
export enum UserPremiumType {
|
||||
/** Nitro Classic */
|
||||
TIER_1 = 1,
|
||||
/** Nitro */
|
||||
/** Nitro Standard */
|
||||
TIER_2 = 2,
|
||||
/** Nitro Basic */
|
||||
TIER_0 = 3,
|
|
@ -19,13 +19,13 @@ export type ChannelRecord = GuildChannelRecord | PrivateChannelRecord | ThreadCh
|
|||
|
||||
export type GuildChannelRecord = GuildTextualChannelRecord | GuildVocalChannelRecord | ForumChannelRecord;
|
||||
|
||||
export type GuildSelectableChannelRecord = Exclude<GuildChannelRecord, GuildCategoryChannelRecord>;
|
||||
export type GuildSelectableChannelRecord = Exclude<GuildChannelRecord, GuildCategoryChannelRecord | GuildVocalChannelRecord>;
|
||||
|
||||
type ChannelRecordOwnPropertyKeys = "application_id" | "appliedTags" | "availableTags" | "bitrate_" | "defaultAutoArchiveDuration" | "defaultForumLayout" | "defaultReactionEmoji" | "defaultSortOrder" | "defaultThreadRateLimitPerUser" | "flags_" | "guild_id" | "icon" | "iconEmoji" | "id" | "isMessageRequest" | "isMessageRequestTimestamp" | "isSpam" | "lastMessageId" | "lastPinTimestamp" | "member" | "memberCount" | "memberIdsPreview" | "memberListId" | "messageCount" | "name" | "nicks" | "nsfw_" | "originChannelId" | "ownerId" | "parentChannelThreadType" | "parent_id" | "permissionOverwrites_" | "position_" | "rateLimitPerUser_" | "rawRecipients" | "recipients" | "rtcRegion" | "safetyWarnings" | "template" | "themeColor" | "threadMetadata" | "topic_" | "totalMessageSent" | "type" | "userLimit_" | "version" | "videoQualityMode";
|
||||
|
||||
export type ChannelRecordOwnProperties<ChannelRecord extends ChannelRecordBase> = Pick<ChannelRecord, ChannelRecordOwnPropertyKeys>;
|
||||
export type ChannelRecordOwnProperties<Channel extends ChannelRecordBase> = Pick<Channel, ChannelRecordOwnPropertyKeys>;
|
||||
|
||||
export abstract class ChannelRecordBase {
|
||||
export declare abstract class ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
||||
|
@ -34,7 +34,7 @@ export abstract class ChannelRecordBase {
|
|||
computeLurkerPermissionsAllowList(): /* Permissions */ bigint | undefined;
|
||||
get flags(): ChannelFlags;
|
||||
getApplicationId(): this["application_id"];
|
||||
getDefaultLayout(): FormLayout;
|
||||
getDefaultLayout(): ForumLayout;
|
||||
getDefaultSortOrder(): ThreadSortOrder;
|
||||
getGuildId(): this["guild_id"];
|
||||
hasFlag(flag: ChannelFlags): boolean;
|
||||
|
@ -84,11 +84,8 @@ export abstract class ChannelRecordBase {
|
|||
availableTags?: ForumTag[] | undefined;
|
||||
bitrate_?: number | undefined;
|
||||
defaultAutoArchiveDuration?: number | undefined;
|
||||
defaultForumLayout?: FormLayout | undefined;
|
||||
defaultReactionEmoji?: {
|
||||
emojiId: string | null;
|
||||
emojiName: string | null;
|
||||
} | undefined;
|
||||
defaultForumLayout?: ForumLayout | undefined;
|
||||
defaultReactionEmoji?: ForumDefaultReactionEmoji | undefined;
|
||||
defaultSortOrder?: ThreadSortOrder | Nullish;
|
||||
defaultThreadRateLimitPerUser?: number | undefined;
|
||||
flags_: ChannelFlags;
|
||||
|
@ -132,6 +129,7 @@ export abstract class ChannelRecordBase {
|
|||
userLimit_?: number | undefined;
|
||||
version?: number | undefined;
|
||||
videoQualityMode?: VideoQualityMode | undefined;
|
||||
/** @todo This seems to have been removed. */
|
||||
voiceBackgroundDisplay?: { type: VoiceCallBackgroundType.EMPTY; }
|
||||
| { resourceId: string; type: VoiceCallBackgroundType.GRADIENT; }
|
||||
| Nullish;
|
||||
|
@ -145,18 +143,23 @@ export interface ForumTag {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export const enum FormLayout {
|
||||
export enum ForumLayout {
|
||||
DEFAULT = 0,
|
||||
LIST = 1,
|
||||
GRID = 2,
|
||||
}
|
||||
|
||||
export const enum ThreadSortOrder {
|
||||
export interface ForumDefaultReactionEmoji {
|
||||
emojiId: string | null;
|
||||
emojiName: string | null;
|
||||
}
|
||||
|
||||
export enum ThreadSortOrder {
|
||||
LATEST_ACTIVITY = 0,
|
||||
CREATION_DATE = 1,
|
||||
}
|
||||
|
||||
export const enum ChannelFlags {
|
||||
export enum ChannelFlags {
|
||||
GUILD_FEED_REMOVED = 1 << 0,
|
||||
PINNED = 1 << 1,
|
||||
ACTIVE_CHANNELS_REMOVED = 1 << 2,
|
||||
|
@ -183,13 +186,14 @@ export interface ThreadMember {
|
|||
muted: boolean;
|
||||
}
|
||||
|
||||
export const enum ThreadMemberFlags {
|
||||
export enum ThreadMemberFlags {
|
||||
HAS_INTERACTED = 1 << 0,
|
||||
ALL_MESSAGES = 1 << 1,
|
||||
ONLY_MENTIONS = 1 << 2,
|
||||
NO_MESSAGES = 1 << 3,
|
||||
}
|
||||
|
||||
/** @todo This may just be a user object from the API. */
|
||||
export interface ChannelRecipient {
|
||||
avatar: string | null;
|
||||
avatar_decoration_data: SnakeCasedProperties<AvatarDecorationData> | null;
|
||||
|
@ -210,7 +214,7 @@ export interface SafetyWarning {
|
|||
}
|
||||
|
||||
// Original name: SafetyWarningTypes
|
||||
export const enum SafetyWarningType {
|
||||
export enum SafetyWarningType {
|
||||
STRANGER_DANGER = 1,
|
||||
INAPPROPRIATE_CONVERSATION_TIER_1 = 2,
|
||||
INAPPROPRIATE_CONVERSATION_TIER_2 = 3,
|
||||
|
@ -226,7 +230,7 @@ export interface ThreadMetadata {
|
|||
}
|
||||
|
||||
// Original name: ChannelTypes
|
||||
export const enum ChannelType {
|
||||
export enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
DM = 1,
|
||||
GUILD_VOICE = 2,
|
||||
|
@ -244,13 +248,14 @@ export const enum ChannelType {
|
|||
UNKNOWN = 10_000,
|
||||
}
|
||||
|
||||
export const enum VideoQualityMode {
|
||||
export enum VideoQualityMode {
|
||||
AUTO = 1,
|
||||
FULL = 2,
|
||||
}
|
||||
|
||||
// Original name: VoiceCallBackgroundTypes
|
||||
export const enum VoiceCallBackgroundType {
|
||||
/** @todo This seems to have been removed. */
|
||||
export enum VoiceCallBackgroundType {
|
||||
EMPTY = 0,
|
||||
GRADIENT = 1,
|
||||
}
|
|
@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
|
|||
|
||||
export type ForumChannelRecord = GuildForumChannelRecord | GuildMediaChannelRecord;
|
||||
|
||||
export abstract class ForumChannelRecordBase extends ChannelRecordBase {
|
||||
export declare abstract class ForumChannelRecordBase extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
||||
|
@ -63,10 +63,10 @@ export abstract class ForumChannelRecordBase extends ChannelRecordBase {
|
|||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
||||
export class GuildForumChannelRecord extends ForumChannelRecordBase {
|
||||
export declare class GuildForumChannelRecord extends ForumChannelRecordBase {
|
||||
type: ChannelType.GUILD_FORUM;
|
||||
}
|
||||
|
||||
export class GuildMediaChannelRecord extends ForumChannelRecordBase {
|
||||
export declare class GuildMediaChannelRecord extends ForumChannelRecordBase {
|
||||
type: ChannelType.GUILD_MEDIA;
|
||||
}
|
|
@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
|
|||
|
||||
export type GuildTextualChannelRecord = GuildTextChannelRecord | GuildCategoryChannelRecord | GuildAnnouncementChannelRecord | GuildStoreChannelRecord | GuildDirectoryChannelRecord;
|
||||
|
||||
export abstract class GuildTextualChannelRecordBase extends ChannelRecordBase {
|
||||
export declare abstract class GuildTextualChannelRecordBase extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
||||
|
@ -63,11 +63,11 @@ export abstract class GuildTextualChannelRecordBase extends ChannelRecordBase {
|
|||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
||||
export class GuildTextChannelRecord extends GuildTextualChannelRecordBase {
|
||||
export declare class GuildTextChannelRecord extends GuildTextualChannelRecordBase {
|
||||
type: ChannelType.GUILD_TEXT;
|
||||
}
|
||||
|
||||
export class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase {
|
||||
export declare class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase {
|
||||
defaultAutoArchiveDuration: undefined;
|
||||
defaultThreadRateLimitPerUser: undefined;
|
||||
lastMessageId: undefined;
|
||||
|
@ -79,14 +79,14 @@ export class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase {
|
|||
type: ChannelType.GUILD_CATEGORY;
|
||||
}
|
||||
|
||||
export class GuildAnnouncementChannelRecord extends GuildTextualChannelRecordBase {
|
||||
export declare class GuildAnnouncementChannelRecord extends GuildTextualChannelRecordBase {
|
||||
type: ChannelType.GUILD_ANNOUNCEMENT;
|
||||
}
|
||||
|
||||
export class GuildStoreChannelRecord extends GuildTextualChannelRecordBase {
|
||||
export declare class GuildStoreChannelRecord extends GuildTextualChannelRecordBase {
|
||||
type: ChannelType.GUILD_STORE;
|
||||
}
|
||||
|
||||
export class GuildDirectoryChannelRecord extends GuildTextualChannelRecordBase {
|
||||
export declare class GuildDirectoryChannelRecord extends GuildTextualChannelRecordBase {
|
||||
type: ChannelType.GUILD_DIRECTORY;
|
||||
}
|
|
@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
|
|||
|
||||
export type GuildVocalChannelRecord = GuildVoiceChannelRecord | GuildStageVoiceChannelRecord;
|
||||
|
||||
export abstract class GuildVocalChannelRecordBase extends ChannelRecordBase {
|
||||
export declare abstract class GuildVocalChannelRecordBase extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
||||
|
@ -64,10 +64,10 @@ export abstract class GuildVocalChannelRecordBase extends ChannelRecordBase {
|
|||
voiceBackgroundDisplay: Defined<ChannelRecordBase["voiceBackgroundDisplay"]>;
|
||||
}
|
||||
|
||||
export class GuildVoiceChannelRecord extends GuildVocalChannelRecordBase {
|
||||
export declare class GuildVoiceChannelRecord extends GuildVocalChannelRecordBase {
|
||||
type: ChannelType.GUILD_VOICE;
|
||||
}
|
||||
|
||||
export class GuildStageVoiceChannelRecord extends GuildVocalChannelRecordBase {
|
||||
export declare class GuildStageVoiceChannelRecord extends GuildVocalChannelRecordBase {
|
||||
type: ChannelType.GUILD_STAGE_VOICE;
|
||||
}
|
|
@ -9,7 +9,7 @@ import type { ChannelRecipient, ChannelRecordBase, ChannelType } from "./Channel
|
|||
|
||||
export type PrivateChannelRecord = DMChannelRecord | GroupDMChannelRecord;
|
||||
|
||||
export abstract class PrivateChannelRecordBase extends ChannelRecordBase {
|
||||
export declare abstract class PrivateChannelRecordBase extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
||||
|
@ -68,7 +68,7 @@ export abstract class PrivateChannelRecordBase extends ChannelRecordBase {
|
|||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
||||
export class DMChannelRecord extends PrivateChannelRecordBase {
|
||||
export declare class DMChannelRecord extends PrivateChannelRecordBase {
|
||||
application_id: undefined;
|
||||
icon: undefined;
|
||||
name: "";
|
||||
|
@ -76,7 +76,7 @@ export class DMChannelRecord extends PrivateChannelRecordBase {
|
|||
type: ChannelType.DM;
|
||||
}
|
||||
|
||||
export class GroupDMChannelRecord extends PrivateChannelRecordBase {
|
||||
export declare class GroupDMChannelRecord extends PrivateChannelRecordBase {
|
||||
isMessageRequest: undefined;
|
||||
isMessageRequestTimestamp: undefined;
|
||||
ownerId: PrivateChannelRecordBase["ownerId"];
|
|
@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
|
|||
|
||||
type ThreadChannelType = ChannelType.ANNOUNCEMENT_THREAD | ChannelType.PUBLIC_THREAD | ChannelType.PRIVATE_THREAD;
|
||||
|
||||
export class ThreadChannelRecord<ChannelType extends ThreadChannelType = ThreadChannelType> extends ChannelRecordBase {
|
||||
export declare class ThreadChannelRecord<ChannelType extends ThreadChannelType = ThreadChannelType> extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
import type { Defined, Nullish } from "../../internal";
|
||||
import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
|
||||
|
||||
export class UnknownChannelRecord extends ChannelRecordBase {
|
||||
export declare class UnknownChannelRecord extends ChannelRecordBase {
|
||||
/** @todo */
|
||||
constructor(channelProperties: Record<string, any>);
|
||||
|
|
@ -9,7 +9,7 @@ import type { Nullish } from "../../internal";
|
|||
export type Emoji = UnicodeEmoji | GuildEmoji;
|
||||
|
||||
// Original name: Emoji
|
||||
export class UnicodeEmoji {
|
||||
export declare class UnicodeEmoji {
|
||||
constructor(emojiObject: UnicodeEmojiObject | UnicodeEmojiObjectDiversityChild);
|
||||
|
||||
get allNamesString(): string;
|
||||
|
@ -72,7 +72,7 @@ export interface GuildEmoji {
|
|||
}
|
||||
|
||||
// Original name: EmojiTypes
|
||||
export const enum EmojiType {
|
||||
export enum EmojiType {
|
||||
UNICODE = 0,
|
||||
GUILD = 1,
|
||||
}
|
|
@ -9,7 +9,7 @@ import type { CollectionChain } from "lodash";
|
|||
import type { Defined, Nullish } from "../../internal";
|
||||
import type { Emoji, EmojiType, GuildEmoji, UnicodeEmoji } from "./Emoji";
|
||||
|
||||
export class EmojiDisambiguations {
|
||||
export declare class EmojiDisambiguations {
|
||||
constructor(guildId: string | null);
|
||||
|
||||
static _lastInstance: EmojiDisambiguations | null;
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import type { GuildEmoji } from "./Emoji";
|
||||
|
||||
export class GuildEmojis {
|
||||
export declare class GuildEmojis {
|
||||
constructor(
|
||||
guildId: string,
|
||||
userId: string,
|
|
@ -19,6 +19,7 @@ export * from "./GuildRecord";
|
|||
export * from "./ImmutableRecord";
|
||||
export * from "./messages";
|
||||
export * from "./misc";
|
||||
export * from "./Permissions";
|
||||
export * from "./ReadState";
|
||||
export * from "./Role";
|
||||
export * from "./UserProfile";
|
|
@ -10,7 +10,7 @@ import type { MessageProperties, MessageRecord } from "./MessageRecord";
|
|||
|
||||
export type ChannelMessagesOwnProperties = Pick<ChannelMessages, "_after" | "_array" | "_before" | "_map" | "cached" | "channelId" | "error" | "focusTargetId" | "hasFetched" | "hasMoreAfter" | "hasMoreBefore" | "jumped" | "jumpedToPresent" | "jumpFlash" | "jumpReturnTargetId" | "jumpSequenceId" | "jumpTargetId" | "jumpTargetOffset" | "jumpType" | "loadingMore" | "ready" | "revealedMessageId">;
|
||||
|
||||
export class ChannelMessages {
|
||||
export declare class ChannelMessages {
|
||||
constructor(channelId: string);
|
||||
|
||||
static _channelMessages: { [channelId: string]: ChannelMessages; };
|
||||
|
@ -184,7 +184,7 @@ export class ChannelMessages {
|
|||
}
|
||||
|
||||
// Original name: JumpTypes
|
||||
export const enum JumpType {
|
||||
export enum JumpType {
|
||||
ANIMATED = "ANIMATED",
|
||||
INSTANT = "INSTANT",
|
||||
}
|
|
@ -13,7 +13,7 @@ export type InteractionRecordOwnProperties = Pick<InteractionRecord, "displayNam
|
|||
export type InteractionProperties = Omit<InteractionRecordOwnProperties, "displayName">
|
||||
& { name_localized?: string | Nullish; };
|
||||
|
||||
export class InteractionRecord<
|
||||
export declare class InteractionRecord<
|
||||
OwnProperties extends InteractionRecordOwnProperties = InteractionRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
constructor(interaction: InteractionProperties);
|
||||
|
@ -33,7 +33,7 @@ export class InteractionRecord<
|
|||
}
|
||||
|
||||
// Original name: InteractionTypes
|
||||
export const enum InteractionType {
|
||||
export enum InteractionType {
|
||||
PING = 1,
|
||||
APPLICATION_COMMAND = 2,
|
||||
MESSAGE_COMPONENT = 3,
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import type { MessageRecord } from "./MessageRecord";
|
||||
|
||||
export class MessageCache {
|
||||
export declare class MessageCache {
|
||||
constructor(isCacheBefore: boolean);
|
||||
|
||||
cache(messages: MessageRecord[], wasAtEdge?: boolean | undefined /* = false */): void;
|
|
@ -23,7 +23,7 @@ export type MessageProperties = Optional<MessageRecordOwnProperties, Nullish, "a
|
|||
& SnakeCasedProperties<Optional<Pick<MessageRecordOwnProperties, "applicationId" | "activityInstance" | "giftInfo" | "stickerItems" | "changelogId">, Nullish>>
|
||||
& Partial<Pick<MessageRecordOwnProperties, "giftInfo">>;
|
||||
|
||||
export class MessageRecord<
|
||||
export declare class MessageRecord<
|
||||
OwnProperties extends MessageRecordOwnProperties = MessageRecordOwnProperties
|
||||
> extends MinimalMessageRecord<OwnProperties> {
|
||||
constructor(messageProperties: MessageProperties);
|
||||
|
@ -95,8 +95,8 @@ export class MessageRecord<
|
|||
referralTrialOfferId: string | null;
|
||||
roleSubscriptionData: MessageRoleSubscriptionData | undefined;
|
||||
state: MessageStates;
|
||||
stickerItems: MessageStickerItem[];
|
||||
stickers: MessageSticker[];
|
||||
stickerItems: StickerItem[];
|
||||
stickers: Sticker[];
|
||||
tts: boolean;
|
||||
webhookId: string | null;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ export interface MessageActivity {
|
|||
}
|
||||
|
||||
// Original name: ActivityActionTypes
|
||||
export const enum ActivityActionType {
|
||||
export enum ActivityActionType {
|
||||
JOIN = 1,
|
||||
SPECTATE = 2,
|
||||
LISTEN = 3,
|
||||
|
@ -126,7 +126,7 @@ export interface CodedLink {
|
|||
type: CodedLinkType;
|
||||
}
|
||||
|
||||
export const enum CodedLinkType {
|
||||
export enum CodedLinkType {
|
||||
ACTIVITY_BOOKMARK = "ACTIVITY_BOOKMARK",
|
||||
APP_DIRECTORY_PROFILE = "APP_DIRECTORY_PROFILE",
|
||||
BUILD_OVERRIDE = "BUILD_OVERRIDE",
|
||||
|
@ -197,7 +197,7 @@ export interface MessagePollAnswer {
|
|||
}
|
||||
|
||||
// Original name: PollLayoutTypes
|
||||
export const enum PollLayoutType {
|
||||
export enum PollLayoutType {
|
||||
UNKNOWN = 0,
|
||||
DEFAULT = 1,
|
||||
IMAGE_ONLY_ANSWERS = 2,
|
||||
|
@ -228,7 +228,7 @@ export interface MessagePurchaseNotification {
|
|||
type: PurchaseNotificationType;
|
||||
}
|
||||
|
||||
export const enum PurchaseNotificationType {
|
||||
export enum PurchaseNotificationType {
|
||||
GUILD_PRODUCT = 0,
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ export interface MessageVoteReactionCountDetails {
|
|||
}
|
||||
|
||||
// Original name: ReactionTypes
|
||||
export const enum ReactionType {
|
||||
export enum ReactionType {
|
||||
NORMAL = 0,
|
||||
BURST = 1,
|
||||
VOTE = 2,
|
||||
|
@ -293,42 +293,51 @@ export interface MessageRoleSubscriptionData {
|
|||
total_months_subscribed: number;
|
||||
}
|
||||
|
||||
export const enum MessageStates {
|
||||
export enum MessageStates {
|
||||
SEND_FAILED = "SEND_FAILED",
|
||||
SENDING = "SENDING",
|
||||
SENT = "SENT",
|
||||
}
|
||||
|
||||
export interface MessageStickerItem {
|
||||
export interface StickerItem {
|
||||
format_type: StickerFormat;
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export const enum StickerFormat {
|
||||
export enum StickerFormat {
|
||||
PNG = 1,
|
||||
APNG = 2,
|
||||
LOTTIE = 3,
|
||||
GIF = 4,
|
||||
}
|
||||
|
||||
export interface MessageSticker {
|
||||
export type Sticker = StandardSticker | GuildSticker;
|
||||
|
||||
export interface StickerBase {
|
||||
asset?: "";
|
||||
available?: boolean;
|
||||
description: string | null;
|
||||
format_type: StickerFormat;
|
||||
guild_id?: string;
|
||||
id: string;
|
||||
name: string;
|
||||
pack_id?: string;
|
||||
sort_value?: number;
|
||||
tags: string;
|
||||
type: MetaStickerType;
|
||||
/** @todo This is not a UserRecord; it's a user object from the API. */
|
||||
user?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const enum MetaStickerType {
|
||||
export interface StandardSticker extends StickerBase {
|
||||
pack_id: string;
|
||||
sort_value: number;
|
||||
}
|
||||
|
||||
export interface GuildSticker extends StickerBase {
|
||||
/** @todo May actually not be optional. */
|
||||
available?: boolean;
|
||||
guild_id: string;
|
||||
/** @todo This is not a UserRecord; it's a user object from the API. */
|
||||
user: Record<string, any>;
|
||||
}
|
||||
|
||||
export enum MetaStickerType {
|
||||
STANDARD = 1,
|
||||
GUILD = 2,
|
||||
}
|
|
@ -12,7 +12,7 @@ export type MessageSnapshotRecordOwnProperties = Pick<MessageSnapshotRecord, "gu
|
|||
export type MessageSnapshotProperties = Pick<MessageSnapshotRecordOwnProperties, "guild">
|
||||
& { message: MinimalMessageProperties; };
|
||||
|
||||
export class MessageSnapshotRecord<
|
||||
export declare class MessageSnapshotRecord<
|
||||
OwnProperties extends MessageSnapshotRecordOwnProperties = MessageSnapshotRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
constructor(messageSnapshotProperties: MessageSnapshotProperties);
|
|
@ -14,7 +14,7 @@ export type MinimalMessageRecordOwnProperties = Pick<MinimalMessageRecord, "atta
|
|||
|
||||
export type MinimalMessageProperties = Optional<MinimalMessageRecordOwnProperties, Nullish, "channel_id", true>;
|
||||
|
||||
export class MinimalMessageRecord<
|
||||
export declare class MinimalMessageRecord<
|
||||
OwnProperties extends MinimalMessageRecordOwnProperties = MinimalMessageRecordOwnProperties
|
||||
> extends ImmutableRecord<OwnProperties> {
|
||||
constructor(minimalMessageProperties: MinimalMessageProperties);
|
||||
|
@ -50,7 +50,7 @@ export interface MessageAttachment {
|
|||
width?: number | null;
|
||||
}
|
||||
|
||||
export const enum MessageAttachmentFlags {
|
||||
export enum MessageAttachmentFlags {
|
||||
IS_CLIP = 1 << 0,
|
||||
IS_THUMBNAIL = 1 << 1,
|
||||
IS_REMIX = 1 << 2,
|
||||
|
@ -95,7 +95,7 @@ export interface MessageLinkButtonComponent extends MessageButtonComponentBase {
|
|||
}
|
||||
|
||||
// Original name: ButtonStyle
|
||||
export const enum MessageButtonComponentStyle {
|
||||
export enum MessageButtonComponentStyle {
|
||||
PRIMARY = 1,
|
||||
SECONDARY = 2,
|
||||
SUCCESS = 3,
|
||||
|
@ -132,7 +132,7 @@ export interface MessageSelectComponentMenuOption<
|
|||
}
|
||||
|
||||
// Original name: SelectOptionType
|
||||
export const enum MessageSelectComponentOptionType {
|
||||
export enum MessageSelectComponentOptionType {
|
||||
STRING = 1,
|
||||
USER = 2,
|
||||
ROLE = 3,
|
||||
|
@ -176,7 +176,7 @@ export interface MessageSelectComponentDefaultValue<
|
|||
}
|
||||
|
||||
// Original name: SnowflakeSelectDefaultValueTypes
|
||||
export const enum MessageSelectComponentDefaultValueType {
|
||||
export enum MessageSelectComponentDefaultValueType {
|
||||
CHANNEL = "channel",
|
||||
ROLE = "role",
|
||||
USER = "user",
|
||||
|
@ -196,7 +196,7 @@ export interface MessageTextInputComponent extends MessageComponentBase {
|
|||
}
|
||||
|
||||
// Original name: TextComponentStyle
|
||||
export const enum MessageTextInputComponentStyle {
|
||||
export enum MessageTextInputComponentStyle {
|
||||
SMALL = 1,
|
||||
PARAGRAPH = 2,
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ export interface MessageMediaGalleryComponentItem {
|
|||
width: number;
|
||||
}
|
||||
|
||||
export const enum ContentScanFlags {
|
||||
export enum ContentScanFlags {
|
||||
EXPLICIT = 1,
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ export interface MessageSeparatorComponent extends MessageComponentBase {
|
|||
type: MessageComponentType.SEPARATOR;
|
||||
}
|
||||
|
||||
export const enum SeparatorSpacingSize {
|
||||
export enum SeparatorSpacingSize {
|
||||
SMALL = 1,
|
||||
LARGE = 2,
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ export interface MessageComponentGuildEmoji {
|
|||
|
||||
// Original name: ComponentType
|
||||
// Renamed to avoid name conflicts with ComponentType from React.
|
||||
export const enum MessageComponentType {
|
||||
export enum MessageComponentType {
|
||||
ACTION_ROW = 1,
|
||||
BUTTON = 2,
|
||||
STRING_SELECT = 3,
|
||||
|
@ -317,7 +317,7 @@ export interface MessageEmbedField {
|
|||
rawValue: string;
|
||||
}
|
||||
|
||||
export const enum MessageEmbedFlags {
|
||||
export enum MessageEmbedFlags {
|
||||
CONTAINS_EXPLICIT_MEDIA = 1 << 4,
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ export type MessageEmbedThumbnail = {
|
|||
});
|
||||
|
||||
// Original name: MessageEmbedTypes
|
||||
export const enum MessageEmbedType {
|
||||
export enum MessageEmbedType {
|
||||
APPLICATION_NEWS = "application_news",
|
||||
ARTICLE = "article",
|
||||
AUTO_MODERATION_MESSAGE = "auto_moderation_message",
|
||||
|
@ -392,7 +392,7 @@ export type MessageEmbedVideo = {
|
|||
url: string;
|
||||
});
|
||||
|
||||
export const enum MessageFlags {
|
||||
export enum MessageFlags {
|
||||
CROSSPOSTED = 1 << 0,
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
|
@ -402,6 +402,7 @@ export const enum MessageFlags {
|
|||
EPHEMERAL = 1 << 6,
|
||||
LOADING = 1 << 7,
|
||||
FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8,
|
||||
GUILD_FEED_HIDDEN = 1 << 9,
|
||||
SHOULD_SHOW_LINK_NOT_DISCORD_WARNING = 1 << 10,
|
||||
SUPPRESS_NOTIFICATIONS = 1 << 12,
|
||||
IS_VOICE_MESSAGE = 1 << 13,
|
||||
|
@ -410,7 +411,7 @@ export const enum MessageFlags {
|
|||
}
|
||||
|
||||
// Original name: MessageTypes
|
||||
export const enum MessageType {
|
||||
export enum MessageType {
|
||||
DEFAULT = 0,
|
||||
RECIPIENT_ADD = 1,
|
||||
RECIPIENT_REMOVE = 2,
|
||||
|
@ -458,4 +459,5 @@ export const enum MessageType {
|
|||
VOICE_HANGOUT_INVITE = 45,
|
||||
POLL_RESULT = 46,
|
||||
CHANGELOG = 47,
|
||||
NITRO_NOTIFICATION = 48,
|
||||
}
|
|
@ -4,6 +4,11 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
/** @internal */
|
||||
export type Bivariant<T extends (...args: any[]) => unknown>
|
||||
// eslint-disable-next-line @typescript-eslint/method-signature-style
|
||||
= { _(...args: Parameters<T>): ReturnType<T>; }["_"];
|
||||
|
||||
/** @internal */
|
||||
export type Defined<T> = Exclude<T, undefined>;
|
||||
|
|
@ -9,9 +9,9 @@ import type { ApplicationRecord, ApplicationType } from "../general/ApplicationR
|
|||
import type { Nullish } from "../internal";
|
||||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
|
||||
export type ApplicationStoreAction = ExtractAction<FluxAction, "APPLICATIONS_FETCH" | "APPLICATIONS_FETCH_FAIL" | "APPLICATIONS_FETCH_SUCCESS" | "APPLICATION_FETCH" | "APPLICATION_FETCH_FAIL" | "APPLICATION_FETCH_SUCCESS" | "APPLICATION_SUBSCRIPTIONS_FETCH_ENTITLEMENTS_SUCCESS" | "BILLING_PAYMENTS_FETCH_SUCCESS" | "ENTITLEMENTS_FETCH_FOR_USER_SUCCESS" | "ENTITLEMENTS_GIFTABLE_FETCH_SUCCESS" | "GIFT_CODE_RESOLVE_SUCCESS" | "GUILD_APPLICATIONS_FETCH_SUCCESS" | "GUILD_SETTINGS_LOADED_INTEGRATIONS" | "INVITE_RESOLVE_SUCCESS" | "LIBRARY_FETCH_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOGOUT" | "OVERLAY_INITIALIZE" | "PAYMENT_UPDATE" | "STORE_LISTING_FETCH_SUCCESS" | "USER_RECENT_GAMES_FETCH_SUCCESS">;
|
||||
export type ApplicationStoreAction = ExtractAction<FluxAction, "APPLICATION_FETCH" | "APPLICATION_FETCH_FAIL" | "APPLICATION_FETCH_SUCCESS" | "APPLICATION_SUBSCRIPTIONS_FETCH_ENTITLEMENTS_SUCCESS" | "APPLICATIONS_FETCH" | "APPLICATIONS_FETCH_FAIL" | "APPLICATIONS_FETCH_SUCCESS" | "BILLING_PAYMENTS_FETCH_SUCCESS" | "ENTITLEMENTS_FETCH_FOR_USER_SUCCESS" | "ENTITLEMENTS_GIFTABLE_FETCH_SUCCESS" | "GIFT_CODE_RESOLVE_SUCCESS" | "GUILD_APPLICATIONS_FETCH_SUCCESS" | "GUILD_SETTINGS_LOADED_INTEGRATIONS" | "INVITE_RESOLVE_SUCCESS" | "LIBRARY_FETCH_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOGOUT" | "OVERLAY_INITIALIZE" | "PAYMENT_UPDATE" | "STORE_LISTING_FETCH_SUCCESS" | "USER_RECENT_GAMES_FETCH_SUCCESS">;
|
||||
|
||||
export class ApplicationStore<Action extends FluxAction = ApplicationStoreAction> extends FluxStore<Action> {
|
||||
export declare class ApplicationStore<Action extends FluxAction = ApplicationStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "ApplicationStore";
|
||||
|
||||
_getAllApplications(): ApplicationRecord[];
|
|
@ -13,7 +13,7 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type ChannelStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC" | "CACHE_LOADED" | "CACHE_LOADED_LAZY" | "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_RECIPIENT_ADD" | "CHANNEL_RECIPIENT_REMOVE" | "CHANNEL_UPDATES" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_FEED_FETCH_SUCCESS" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_CHANNELS" | "LOAD_MESSAGES_AROUND_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOGOUT" | "MOD_VIEW_SEARCH_FINISH" | "OVERLAY_INITIALIZE" | "SEARCH_FINISH" | "THREAD_CREATE" | "THREAD_DELETE" | "THREAD_LIST_SYNC" | "THREAD_UPDATE">;
|
||||
|
||||
export class ChannelStore<Action extends FluxAction = ChannelStoreAction> extends FluxStore<Action> {
|
||||
export declare class ChannelStore<Action extends FluxAction = ChannelStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "ChannelStore";
|
||||
|
||||
getAllThreadsForParent(channelId: string): ThreadChannelRecord[];
|
|
@ -15,7 +15,7 @@ export interface DraftStoreState {
|
|||
|
||||
export type DraftStoreAction = ExtractAction<FluxAction, "CHANNEL_DELETE" | "CONNECTION_OPEN" | "DRAFT_CHANGE" | "DRAFT_CLEAR" | "DRAFT_SAVE" | "GUILD_DELETE" | "LOGOUT" | "MULTI_ACCOUNT_REMOVE_ACCOUNT" | "THREAD_CREATE" | "THREAD_DELETE" | "THREAD_SETTINGS_DRAFT_CHANGE">;
|
||||
|
||||
export class DraftStore<
|
||||
export declare class DraftStore<
|
||||
Constructor extends GenericConstructor = typeof DraftStore,
|
||||
State extends DraftStoreState = DraftStoreState,
|
||||
Action extends FluxAction = DraftStoreAction
|
|
@ -22,7 +22,7 @@ export interface EmojiStoreState {
|
|||
|
||||
export type EmojiStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC" | "CACHED_EMOJIS_LOADED" | "CONNECTION_OPEN" | "EMOJI_AUTOSUGGESTION_UPDATE" | "EMOJI_TRACK_USAGE" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_EMOJIS_UPDATE" | "GUILD_MEMBER_UPDATE" | "GUILD_ROLE_CREATE" | "GUILD_ROLE_UPDATE" | "GUILD_UPDATE" | "MESSAGE_REACTION_ADD" | "TOP_EMOJIS_FETCH_SUCCESS" | "USER_SETTINGS_PROTO_UPDATE">;
|
||||
|
||||
export class EmojiStore<
|
||||
export declare class EmojiStore<
|
||||
Constructor extends GenericConstructor = typeof EmojiStore,
|
||||
State extends EmojiStoreState = EmojiStoreState,
|
||||
Action extends FluxAction = EmojiStoreAction
|
||||
|
@ -34,7 +34,7 @@ export class EmojiStore<
|
|||
get diversitySurrogate(): string;
|
||||
get emojiFrecencyWithoutFetchingLatest(): Frecency<string, Emoji>;
|
||||
getCustomEmojiById(emojiId: string): GuildEmoji | undefined;
|
||||
getDisambiguatedEmojiContext(guildId?: string | Nullish): EmojiDisambiguations | undefined;
|
||||
getDisambiguatedEmojiContext(guildId?: string | Nullish): EmojiDisambiguations;
|
||||
getEmojiAutosuggestion(channel?: ChannelRecord): Emoji[];
|
||||
getGuildEmoji(guildId: string): GuildEmoji[];
|
||||
getGuilds(): { [guildId: string]: GuildEmojis; };
|
||||
|
@ -70,7 +70,7 @@ export interface GuildTopEmojisMetadata {
|
|||
topEmojisTTL: number;
|
||||
}
|
||||
|
||||
export const enum EmojiIntention {
|
||||
export enum EmojiIntention {
|
||||
REACTION = 0,
|
||||
STATUS = 1,
|
||||
COMMUNITY_CONTENT = 2,
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import type { ExtractAction, FluxAction } from "../flux/fluxActions";
|
||||
import type { ChannelType, GuildChannelRecord, GuildSelectableChannelRecord } from "../general/channels/ChannelRecord";
|
||||
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";
|
||||
|
@ -13,7 +13,7 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type GuildChannelStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC" | "CACHE_LOADED_LAZY" | "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_SELECT" | "CHANNEL_UPDATES" | "CONNECTION_OPEN" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBER_UPDATE" | "GUILD_ROLE_CREATE" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_UPDATE" | "GUILD_UPDATE" | "IMPERSONATE_STOP" | "IMPERSONATE_UPDATE" | "OVERLAY_INITIALIZE" | "VOICE_CHANNEL_SELECT" | "VOICE_CHANNEL_STATUS_UPDATE" | "VOICE_STATE_UPDATES">;
|
||||
|
||||
export class GuildChannelStore<Action extends FluxAction = GuildChannelStoreAction> extends FluxStore<Action> {
|
||||
export declare class GuildChannelStore<Action extends FluxAction = GuildChannelStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "GuildChannelStore";
|
||||
|
||||
getAllGuilds(): { [guildId: string]: GuildChannels | undefined; };
|
||||
|
@ -22,33 +22,33 @@ export class GuildChannelStore<Action extends FluxAction = GuildChannelStoreActi
|
|||
guild: string,
|
||||
searchVocal?: SearchVocal /* = false */,
|
||||
permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */
|
||||
): GuildChannelFromSearchVocal<SearchVocal>;
|
||||
): ChannelFromSearchVocal<SearchVocal> | null;
|
||||
getDirectoryChannelIds(guildId: string): string[];
|
||||
getFirstChannel<SearchVocal extends boolean | undefined = undefined>(
|
||||
guildId: string,
|
||||
predicate: (
|
||||
value: GuildChannelFromSearchVocal<SearchVocal>,
|
||||
value: ChannelFromSearchVocal<SearchVocal>,
|
||||
index: number,
|
||||
array: GuildChannelFromSearchVocal<SearchVocal>[]
|
||||
array: ChannelFromSearchVocal<SearchVocal>[]
|
||||
) => unknown,
|
||||
searchVocal?: SearchVocal /* = false */
|
||||
): GuildChannelFromSearchVocal<SearchVocal> | null;
|
||||
): ChannelFromSearchVocal<SearchVocal> | null;
|
||||
getFirstChannelOfType<Type extends GuildChannelType>(
|
||||
guildId: string,
|
||||
predicate: (
|
||||
value: GuildChannelFromType<Type>,
|
||||
value: ChannelFromGuildChannelType<Type>,
|
||||
index: number,
|
||||
array: GuildChannelFromType<Type>[]
|
||||
array: ChannelFromGuildChannelType<Type>[]
|
||||
) => unknown,
|
||||
type: Type
|
||||
): GuildChannelFromType<Type> | null;
|
||||
): ChannelFromGuildChannelType<Type> | null;
|
||||
getSelectableChannelIds(guildId: string): string[];
|
||||
getSelectableChannels(guildId: string): GuildChannel<GuildSelectableChannelRecord>[];
|
||||
getSFWDefaultChannel<SearchVocal extends boolean | undefined = undefined>(
|
||||
guild: string,
|
||||
searchVocal?: SearchVocal /* = false */,
|
||||
permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */
|
||||
): GuildChannelFromSearchVocal<SearchVocal>;
|
||||
): ChannelFromSearchVocal<SearchVocal> | null;
|
||||
getTextChannelNameDisambiguations(guildId?: string | Nullish): {
|
||||
[channelId: string]: { id: string; name: string; };
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ export interface GuildChannels {
|
|||
}
|
||||
|
||||
// Does not actually exist.
|
||||
export const enum GuildChannelType {
|
||||
export enum GuildChannelType {
|
||||
CATEGORY = ChannelType.GUILD_CATEGORY,
|
||||
SELECTABLE = "SELECTABLE",
|
||||
VOCAL = "VOCAL",
|
||||
|
@ -81,10 +81,13 @@ export interface GuildChannel<Channel extends GuildChannelRecord = GuildChannelR
|
|||
comparator: number;
|
||||
}
|
||||
|
||||
type GuildChannelFromSearchVocal<SearchVocal extends boolean | undefined>
|
||||
= GuildChannel<GuildSelectableChannelRecord> | (SearchVocal extends true
|
||||
? GuildChannel<GuildVocalChannelRecord>
|
||||
type ChannelFromSearchVocal<SearchVocal extends boolean | undefined>
|
||||
= GuildSelectableChannelRecord | (SearchVocal extends true
|
||||
? GuildVocalChannelRecord
|
||||
: never);
|
||||
|
||||
type GuildChannelFromType<Type extends GuildChannelType>
|
||||
= GuildChannels[Type] extends (infer Channel)[] ? Channel : never;
|
||||
type ChannelFromGuildChannelType<Type extends GuildChannelType> = {
|
||||
[GuildChannelType.CATEGORY]: GuildCategoryChannelRecord;
|
||||
[GuildChannelType.SELECTABLE]: GuildSelectableChannelRecord;
|
||||
[GuildChannelType.VOCAL]: GuildVocalChannelRecord;
|
||||
}[Type];
|
|
@ -9,9 +9,9 @@ import type { GuildMember } from "../general/GuildMember";
|
|||
import type { Nullish } from "../internal";
|
||||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
|
||||
export type GuildMemberStoreAction = ExtractAction<FluxAction, "CACHE_LOADED" | "CLEAR_PENDING_CHANNEL_AND_ROLE_UPDATES" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBERS_CHUNK_BATCH" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_PROFILE_UPDATE" | "GUILD_MEMBER_REMOVE" | "GUILD_MEMBER_UPDATE" | "GUILD_MEMBER_UPDATE_LOCAL" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_MEMBER_ADD" | "GUILD_ROLE_MEMBER_REMOVE" | "GUILD_ROLE_UPDATE" | "IMPERSONATE_STOP" | "IMPERSONATE_UPDATE" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_FORUM_POSTS" | "LOAD_MESSAGES_AROUND_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_PINNED_MESSAGES_SUCCESS" | "LOAD_RECENT_MENTIONS_SUCCESS" | "LOCAL_MESSAGES_LOADED" | "MEMBER_SAFETY_GUILD_MEMBER_SEARCH_SUCCESS" | "MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MOD_VIEW_SEARCH_FINISH" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "SEARCH_FINISH" | "THREAD_MEMBERS_UPDATE" | "THREAD_MEMBER_LIST_UPDATE">;
|
||||
export type GuildMemberStoreAction = ExtractAction<FluxAction, "CACHE_LOADED" | "CLEAR_PENDING_CHANNEL_AND_ROLE_UPDATES" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_PROFILE_UPDATE" | "GUILD_MEMBER_REMOVE" | "GUILD_MEMBER_UPDATE" | "GUILD_MEMBER_UPDATE_LOCAL" | "GUILD_MEMBERS_CHUNK_BATCH" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_MEMBER_ADD" | "GUILD_ROLE_MEMBER_REMOVE" | "GUILD_ROLE_UPDATE" | "IMPERSONATE_STOP" | "IMPERSONATE_UPDATE" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_FORUM_POSTS" | "LOAD_MESSAGES_AROUND_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_PINNED_MESSAGES_SUCCESS" | "LOAD_RECENT_MENTIONS_SUCCESS" | "LOCAL_MESSAGES_LOADED" | "MEMBER_SAFETY_GUILD_MEMBER_SEARCH_SUCCESS" | "MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MOD_VIEW_SEARCH_FINISH" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "SEARCH_FINISH" | "THREAD_MEMBER_LIST_UPDATE" | "THREAD_MEMBERS_UPDATE">;
|
||||
|
||||
export class GuildMemberStore<Action extends FluxAction = GuildMemberStoreAction> extends FluxStore<Action> {
|
||||
export declare class GuildMemberStore<Action extends FluxAction = GuildMemberStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "GuildMemberStore";
|
||||
|
||||
getCommunicationDisabledUserMap(): { [userId: string]: string; };
|
|
@ -12,7 +12,7 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type GuildStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC" | "CACHE_LOADED" | "CACHE_LOADED_LAZY" | "CONNECTION_OPEN" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_GEO_RESTRICTED" | "GUILD_MEMBER_ADD" | "GUILD_ROLE_CREATE" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_UPDATE" | "GUILD_SETTINGS_SUBMIT_SUCCESS" | "GUILD_UPDATE" | "OVERLAY_INITIALIZE">;
|
||||
|
||||
export class GuildStore<Action extends FluxAction = GuildStoreAction> extends FluxStore<Action> {
|
||||
export declare class GuildStore<Action extends FluxAction = GuildStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "GuildStore";
|
||||
|
||||
getAllGuildsRoles(): { [guildId: string]: { [roleId: string]: Role; }; };
|
|
@ -10,9 +10,9 @@ import type { MessageRecord } from "../general/messages/MessageRecord";
|
|||
import type { Nullish } from "../internal";
|
||||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
|
||||
export type MessageStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC_CHANNEL_MESSAGES" | "CACHE_LOADED" | "CHANNEL_DELETE" | "CLEAR_MESSAGES" | "CONNECTION_OPEN" | "GUILD_DELETE" | "GUILD_MEMBERS_CHUNK_BATCH" | "LOAD_MESSAGES" | "LOAD_MESSAGES_FAILURE" | "LOAD_MESSAGES_SUCCESS" | "LOAD_MESSAGES_SUCCESS_CACHED" | "LOAD_MESSAGE_INTERACTION_DATA_SUCCESS" | "LOCAL_MESSAGES_LOADED" | "LOCAL_MESSAGE_CREATE" | "LOGOUT" | "MESSAGE_CREATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_EDIT_FAILED_AUTOMOD" | "MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT" | "MESSAGE_REACTION_ADD" | "MESSAGE_REACTION_ADD_MANY" | "MESSAGE_REACTION_REMOVE" | "MESSAGE_REACTION_REMOVE_ALL" | "MESSAGE_REACTION_REMOVE_EMOJI" | "MESSAGE_REVEAL" | "MESSAGE_SEND_FAILED" | "MESSAGE_SEND_FAILED_AUTOMOD" | "MESSAGE_UPDATE" | "OVERLAY_INITIALIZE" | "RELATIONSHIP_ADD" | "RELATIONSHIP_REMOVE" | "THREAD_CREATE_LOCAL" | "THREAD_DELETE" | "THREAD_MEMBER_LIST_UPDATE" | "TRUNCATE_MESSAGES" | "UPLOAD_FAIL" | "UPLOAD_START">;
|
||||
export type MessageStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC_CHANNEL_MESSAGES" | "CACHE_LOADED" | "CHANNEL_DELETE" | "CLEAR_MESSAGES" | "CONNECTION_OPEN" | "GUILD_DELETE" | "GUILD_MEMBERS_CHUNK_BATCH" | "LOAD_MESSAGE_INTERACTION_DATA_SUCCESS" | "LOAD_MESSAGES" | "LOAD_MESSAGES_FAILURE" | "LOAD_MESSAGES_SUCCESS" | "LOAD_MESSAGES_SUCCESS_CACHED" | "LOCAL_MESSAGE_CREATE" | "LOCAL_MESSAGES_LOADED" | "LOGOUT" | "MESSAGE_CREATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_EDIT_FAILED_AUTOMOD" | "MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT" | "MESSAGE_REACTION_ADD" | "MESSAGE_REACTION_ADD_MANY" | "MESSAGE_REACTION_REMOVE" | "MESSAGE_REACTION_REMOVE_ALL" | "MESSAGE_REACTION_REMOVE_EMOJI" | "MESSAGE_REVEAL" | "MESSAGE_SEND_FAILED" | "MESSAGE_SEND_FAILED_AUTOMOD" | "MESSAGE_UPDATE" | "OVERLAY_INITIALIZE" | "RELATIONSHIP_ADD" | "RELATIONSHIP_REMOVE" | "THREAD_CREATE_LOCAL" | "THREAD_DELETE" | "THREAD_MEMBER_LIST_UPDATE" | "TRUNCATE_MESSAGES" | "UPLOAD_FAIL" | "UPLOAD_START">;
|
||||
|
||||
export class MessageStore<Action extends FluxAction = MessageStoreAction> extends FluxStore<Action> {
|
||||
export declare class MessageStore<Action extends FluxAction = MessageStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "MessageStore";
|
||||
|
||||
focusedMessageId(channelId: string): string | undefined;
|
|
@ -15,9 +15,10 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type PermissionStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC" | "CACHE_LOADED" | "CACHE_LOADED_LAZY" | "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_UPDATES" | "CONNECTION_CLOSED" | "CONNECTION_OPEN" | "CURRENT_USER_UPDATE" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_FEED_FETCH_SUCCESS" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_UPDATE" | "GUILD_ROLE_CREATE" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_UPDATE" | "GUILD_UPDATE" | "IMPERSONATE_STOP" | "IMPERSONATE_UPDATE" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOGOUT" | "MOD_VIEW_SEARCH_FINISH" | "OVERLAY_INITIALIZE" | "SEARCH_FINISH" | "STAGE_INSTANCE_CREATE" | "STAGE_INSTANCE_DELETE" | "STAGE_INSTANCE_UPDATE" | "THREAD_CREATE" | "THREAD_LIST_SYNC" | "THREAD_MEMBERS_UPDATE" | "THREAD_MEMBER_UPDATE" | "THREAD_UPDATE">;
|
||||
|
||||
export class PermissionStore<Action extends FluxAction = PermissionStoreAction> extends FluxStore<Action> {
|
||||
export declare class PermissionStore<Action extends FluxAction = PermissionStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "PermissionStore";
|
||||
|
||||
/** Always returns false for private (non-guild) channels. */
|
||||
can(
|
||||
permissions: /* Permissions */ bigint,
|
||||
context?: GuildRecord | ChannelRecord | Nullish,
|
|
@ -9,9 +9,9 @@ import type { Activity } from "../general/Activity";
|
|||
import type { Nullish } from "../internal";
|
||||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
|
||||
export type PresenceStoreAction = ExtractAction<FluxAction, "ACTIVITY_METADATA_UPDATE" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBER_REMOVE" | "OVERLAY_INITIALIZE" | "PRESENCES_REPLACE" | "PRESENCE_UPDATES" | "SELF_PRESENCE_STORE_UPDATE" | "THREAD_MEMBERS_UPDATE" | "THREAD_MEMBER_LIST_UPDATE">;
|
||||
export type PresenceStoreAction = ExtractAction<FluxAction, "ACTIVITY_METADATA_UPDATE" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_MEMBER_REMOVE" | "OVERLAY_INITIALIZE" | "PRESENCE_UPDATES" | "PRESENCES_REPLACE" | "SELF_PRESENCE_STORE_UPDATE" | "THREAD_MEMBER_LIST_UPDATE" | "THREAD_MEMBERS_UPDATE">;
|
||||
|
||||
export class PresenceStore<Action extends FluxAction = PresenceStoreAction> extends FluxStore<Action> {
|
||||
export declare class PresenceStore<Action extends FluxAction = PresenceStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "PresenceStore";
|
||||
|
||||
findActivity<T extends Activity>(
|
||||
|
@ -68,15 +68,16 @@ export class PresenceStore<Action extends FluxAction = PresenceStoreAction> exte
|
|||
export type ClientStatusMap = Partial<Record<ClientType, StatusType>>;
|
||||
|
||||
// Original name: ClientTypes
|
||||
export const enum ClientType {
|
||||
export enum ClientType {
|
||||
DESKTOP = "desktop",
|
||||
EMBEDDED = "embedded", // Undocumented
|
||||
MOBILE = "mobile",
|
||||
UNKNOWN = "unknown",
|
||||
WEB = "web",
|
||||
}
|
||||
|
||||
// Original name: StatusTypes
|
||||
export const enum StatusType {
|
||||
export enum StatusType {
|
||||
DND = "dnd",
|
||||
IDLE = "idle",
|
||||
INVISIBLE = "invisible",
|
|
@ -12,9 +12,9 @@ import type { Nullish } from "../internal";
|
|||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
import type { BasicPermissionsObject } from "./PermissionStore";
|
||||
|
||||
export type ReadStateStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC_CHANNEL_MESSAGES" | "BULK_ACK" | "CACHE_LOADED" | "CHANNEL_ACK" | "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_LOCAL_ACK" | "CHANNEL_PINS_ACK" | "CHANNEL_PINS_UPDATE" | "CHANNEL_RTC_UPDATE_CHAT_OPEN" | "CHANNEL_SELECT" | "CLEAR_OLDEST_UNREAD_MESSAGE" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "CURRENT_USER_UPDATE" | "DECAY_READ_STATES" | "DISABLE_AUTOMATIC_ACK" | "DRAWER_CLOSE" | "DRAWER_OPEN" | "ENABLE_AUTOMATIC_ACK" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_FEATURE_ACK" | "GUILD_SCHEDULED_EVENT_CREATE" | "GUILD_SCHEDULED_EVENT_DELETE" | "GUILD_SCHEDULED_EVENT_UPDATE" | "GUILD_UPDATE" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOGOUT" | "MESSAGE_ACK" | "MESSAGE_CREATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_REQUEST_ACK" | "MESSAGE_REQUEST_CLEAR_ACK" | "MOD_VIEW_SEARCH_FINISH" | "NOTIFICATION_CENTER_ITEMS_ACK" | "NOTIFICATION_CENTER_ITEM_CREATE" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "RELATIONSHIP_ADD" | "RELATIONSHIP_REMOVE" | "RESORT_THREADS" | "SEARCH_FINISH" | "THREAD_CREATE" | "THREAD_DELETE" | "THREAD_LIST_SYNC" | "THREAD_MEMBERS_UPDATE" | "THREAD_MEMBER_UPDATE" | "THREAD_UPDATE" | "TRY_ACK" | "UPDATE_CHANNEL_DIMENSIONS" | "USER_NON_CHANNEL_ACK" | "VOICE_CHANNEL_SELECT" | "WINDOW_FOCUS">;
|
||||
export type ReadStateStoreAction = ExtractAction<FluxAction, "BACKGROUND_SYNC_CHANNEL_MESSAGES" | "BULK_ACK" | "CACHE_LOADED" | "CHANNEL_ACK" | "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_LOCAL_ACK" | "CHANNEL_PINS_ACK" | "CHANNEL_PINS_UPDATE" | "CHANNEL_RTC_UPDATE_CHAT_OPEN" | "CHANNEL_SELECT" | "CLEAR_OLDEST_UNREAD_MESSAGE" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "CURRENT_USER_UPDATE" | "DECAY_READ_STATES" | "DISABLE_AUTOMATIC_ACK" | "DRAWER_CLOSE" | "DRAWER_OPEN" | "ENABLE_AUTOMATIC_ACK" | "GUILD_CREATE" | "GUILD_DELETE" | "GUILD_FEATURE_ACK" | "GUILD_SCHEDULED_EVENT_CREATE" | "GUILD_SCHEDULED_EVENT_DELETE" | "GUILD_SCHEDULED_EVENT_UPDATE" | "GUILD_UPDATE" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOGOUT" | "MESSAGE_ACK" | "MESSAGE_CREATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_REQUEST_ACK" | "MESSAGE_REQUEST_CLEAR_ACK" | "MOD_VIEW_SEARCH_FINISH" | "NOTIFICATION_CENTER_ITEM_CREATE" | "NOTIFICATION_CENTER_ITEMS_ACK" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "RELATIONSHIP_ADD" | "RELATIONSHIP_REMOVE" | "RESORT_THREADS" | "SEARCH_FINISH" | "THREAD_CREATE" | "THREAD_DELETE" | "THREAD_LIST_SYNC" | "THREAD_MEMBER_UPDATE" | "THREAD_MEMBERS_UPDATE" | "THREAD_UPDATE" | "TRY_ACK" | "UPDATE_CHANNEL_DIMENSIONS" | "USER_NON_CHANNEL_ACK" | "VOICE_CHANNEL_SELECT" | "WINDOW_FOCUS">;
|
||||
|
||||
export class ReadStateStore<Action extends FluxAction = ReadStateStoreAction> extends FluxStore<Action> {
|
||||
export declare class ReadStateStore<Action extends FluxAction = ReadStateStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "ReadStateStore";
|
||||
|
||||
ackMessageId(id: string, type?: ReadStateType | undefined /* = ReadStateType.CHANNEL */): string | null;
|
|
@ -9,10 +9,11 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type RelationshipStoreAction = ExtractAction<FluxAction, "CONNECTION_OPEN" | "OVERLAY_INITIALIZE" | "RELATIONSHIP_ADD" | "RELATIONSHIP_PENDING_INCOMING_REMOVED" | "RELATIONSHIP_REMOVE" | "RELATIONSHIP_UPDATE">;
|
||||
|
||||
export class RelationshipStore<Action extends FluxAction = RelationshipStoreAction> extends FluxStore<Action> {
|
||||
export declare class RelationshipStore<Action extends FluxAction = RelationshipStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "RelationshipStore";
|
||||
|
||||
getFriendCount(): number;
|
||||
/** @todo May eventually be renamed to `getFriendIds`. */
|
||||
getFriendIDs(): string[];
|
||||
getNickname(userId: string): string | undefined;
|
||||
getOutgoingCount(): number;
|
||||
|
@ -28,7 +29,7 @@ export class RelationshipStore<Action extends FluxAction = RelationshipStoreActi
|
|||
}
|
||||
|
||||
// Original name: RelationshipTypes
|
||||
export const enum RelationshipType {
|
||||
export enum RelationshipType {
|
||||
NONE = 0,
|
||||
FRIEND = 1,
|
||||
BLOCKED = 2,
|
|
@ -10,7 +10,7 @@ import type { FluxStore } from "./abstract/FluxStore";
|
|||
|
||||
export type SelectedChannelStoreAction = ExtractAction<FluxAction, "CHANNEL_CREATE" | "CHANNEL_DELETE" | "CHANNEL_FOLLOWER_CREATED" | "CHANNEL_SELECT" | "CHANNEL_UPDATES" | "CONNECTION_CLOSED" | "CONNECTION_OPEN" | "GUILD_CREATE" | "GUILD_DELETE" | "LOGOUT" | "OVERLAY_INITIALIZE" | "THREAD_DELETE" | "VOICE_CHANNEL_SELECT" | "VOICE_STATE_UPDATES">;
|
||||
|
||||
export class SelectedChannelStore<Action extends FluxAction = SelectedChannelStoreAction> extends FluxStore<Action> {
|
||||
export declare class SelectedChannelStore<Action extends FluxAction = SelectedChannelStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "SelectedChannelStore";
|
||||
|
||||
getChannelId(guildId?: string | Nullish): string | undefined;
|
|
@ -16,7 +16,7 @@ export interface SelectedGuildStoreState {
|
|||
|
||||
export type SelectedGuildStoreAction = ExtractAction<FluxAction, "CHANNEL_SELECT" | "CONNECTION_OPEN" | "GUILD_DELETE" | "GUILD_MEMBER_REMOVE" | "LOGOUT" | "OVERLAY_INITIALIZE">;
|
||||
|
||||
export class SelectedGuildStore<
|
||||
export declare class SelectedGuildStore<
|
||||
Constructor extends GenericConstructor = typeof SelectedGuildStore,
|
||||
State extends SelectedGuildStoreState = SelectedGuildStoreState,
|
||||
Action extends FluxAction = SelectedGuildStoreAction
|
|
@ -20,7 +20,7 @@ export interface UserProfileStoreSnapshotData {
|
|||
|
||||
export type UserProfileStoreAction = ExtractAction<FluxAction, "CACHE_LOADED_LAZY" | "GUILD_DELETE" | "GUILD_JOIN" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_REMOVE" | "GUILD_MEMBER_UPDATE" | "LOGOUT" | "MUTUAL_FRIENDS_FETCH_FAILURE" | "MUTUAL_FRIENDS_FETCH_START" | "MUTUAL_FRIENDS_FETCH_SUCCESS" | "USER_PROFILE_ACCESSIBILITY_TOOLTIP_VIEWED" | "USER_PROFILE_FETCH_FAILURE" | "USER_PROFILE_FETCH_START" | "USER_PROFILE_FETCH_SUCCESS" | "USER_PROFILE_UPDATE_FAILURE" | "USER_PROFILE_UPDATE_START" | "USER_PROFILE_UPDATE_SUCCESS" | "USER_UPDATE">;
|
||||
|
||||
export class UserProfileStore<
|
||||
export declare class UserProfileStore<
|
||||
Constructor extends GenericConstructor = typeof UserProfileStore
|
||||
> extends FluxSnapshotStore<Constructor, UserProfileStoreSnapshotData, UserProfileStoreAction> {
|
||||
constructor();
|
|
@ -13,9 +13,9 @@ export interface UserStoreSnapshotData {
|
|||
users: [UserRecord] | [];
|
||||
}
|
||||
|
||||
export type UserStoreAction = ExtractAction<FluxAction, "AUDIT_LOG_FETCH_NEXT_PAGE_SUCCESS" | "AUDIT_LOG_FETCH_SUCCESS" | "CACHE_LOADED" | "CHANNEL_CREATE" | "CHANNEL_RECIPIENT_ADD" | "CHANNEL_RECIPIENT_REMOVE" | "CHANNEL_UPDATES" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "CURRENT_USER_UPDATE" | "FAMILY_CENTER_INITIAL_LOAD" | "FAMILY_CENTER_LINKED_USERS_FETCH_SUCCESS" | "FAMILY_CENTER_REQUEST_LINK_SUCCESS" | "FAMILY_CENTER_TEEN_ACTIVITY_FETCH_SUCCESS" | "FAMILY_CENTER_TEEN_ACTIVITY_MORE_FETCH_SUCCESS" | "FETCH_PRIVATE_CHANNEL_INTEGRATIONS_SUCCESS" | "FRIEND_SUGGESTION_CREATE" | "GIFT_CODE_RESOLVE_SUCCESS" | "GUILD_APPLIED_BOOSTS_FETCH_SUCCESS" | "GUILD_BAN_ADD" | "GUILD_BAN_REMOVE" | "GUILD_CREATE" | "GUILD_FEED_FETCH_SUCCESS" | "GUILD_JOIN_REQUEST_CREATE" | "GUILD_JOIN_REQUEST_UPDATE" | "GUILD_MEMBERS_CHUNK_BATCH" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_LIST_UPDATE" | "GUILD_MEMBER_UPDATE" | "GUILD_SCHEDULED_EVENT_USERS_FETCH_SUCCESS" | "GUILD_SETTINGS_LOADED_BANS" | "GUILD_SETTINGS_LOADED_BANS_BATCH" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_FORUM_POSTS" | "LOAD_FRIEND_SUGGESTIONS_SUCCESS" | "LOAD_MESSAGES_AROUND_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_MESSAGE_REQUESTS_SUPPLEMENTAL_DATA_SUCCESS" | "LOAD_NOTIFICATION_CENTER_ITEMS_SUCCESS" | "LOAD_PINNED_MESSAGES_SUCCESS" | "LOAD_RECENT_MENTIONS_SUCCESS" | "LOAD_RELATIONSHIPS_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOCAL_MESSAGES_LOADED" | "MEMBER_SAFETY_GUILD_MEMBER_SEARCH_SUCCESS" | "MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MOD_VIEW_SEARCH_FINISH" | "NOTIFICATION_CENTER_ITEM_CREATE" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "PRESENCE_UPDATES" | "PRIVATE_CHANNEL_INTEGRATION_CREATE" | "PRIVATE_CHANNEL_INTEGRATION_UPDATE" | "RELATIONSHIP_ADD" | "SEARCH_FINISH" | "THREAD_LIST_SYNC" | "THREAD_MEMBERS_UPDATE" | "THREAD_MEMBER_LIST_UPDATE" | "UPDATE_CLIENT_PREMIUM_TYPE" | "USER_UPDATE">;
|
||||
export type UserStoreAction = ExtractAction<FluxAction, "AUDIT_LOG_FETCH_NEXT_PAGE_SUCCESS" | "AUDIT_LOG_FETCH_SUCCESS" | "CACHE_LOADED" | "CHANNEL_CREATE" | "CHANNEL_RECIPIENT_ADD" | "CHANNEL_RECIPIENT_REMOVE" | "CHANNEL_UPDATES" | "CONNECTION_OPEN" | "CONNECTION_OPEN_SUPPLEMENTAL" | "CURRENT_USER_UPDATE" | "FAMILY_CENTER_INITIAL_LOAD" | "FAMILY_CENTER_LINKED_USERS_FETCH_SUCCESS" | "FAMILY_CENTER_REQUEST_LINK_SUCCESS" | "FAMILY_CENTER_TEEN_ACTIVITY_FETCH_SUCCESS" | "FAMILY_CENTER_TEEN_ACTIVITY_MORE_FETCH_SUCCESS" | "FETCH_PRIVATE_CHANNEL_INTEGRATIONS_SUCCESS" | "FRIEND_SUGGESTION_CREATE" | "GIFT_CODE_RESOLVE_SUCCESS" | "GUILD_APPLIED_BOOSTS_FETCH_SUCCESS" | "GUILD_BAN_ADD" | "GUILD_BAN_REMOVE" | "GUILD_CREATE" | "GUILD_FEED_FETCH_SUCCESS" | "GUILD_JOIN_REQUEST_CREATE" | "GUILD_JOIN_REQUEST_UPDATE" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_LIST_UPDATE" | "GUILD_MEMBER_UPDATE" | "GUILD_MEMBERS_CHUNK_BATCH" | "GUILD_SCHEDULED_EVENT_USERS_FETCH_SUCCESS" | "GUILD_SETTINGS_LOADED_BANS" | "GUILD_SETTINGS_LOADED_BANS_BATCH" | "LOAD_ARCHIVED_THREADS_SUCCESS" | "LOAD_FORUM_POSTS" | "LOAD_FRIEND_SUGGESTIONS_SUCCESS" | "LOAD_MESSAGE_REQUESTS_SUPPLEMENTAL_DATA_SUCCESS" | "LOAD_MESSAGES_AROUND_SUCCESS" | "LOAD_MESSAGES_SUCCESS" | "LOAD_NOTIFICATION_CENTER_ITEMS_SUCCESS" | "LOAD_PINNED_MESSAGES_SUCCESS" | "LOAD_RECENT_MENTIONS_SUCCESS" | "LOAD_RELATIONSHIPS_SUCCESS" | "LOAD_THREADS_SUCCESS" | "LOCAL_MESSAGES_LOADED" | "MEMBER_SAFETY_GUILD_MEMBER_SEARCH_SUCCESS" | "MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MOD_VIEW_SEARCH_FINISH" | "NOTIFICATION_CENTER_ITEM_CREATE" | "OVERLAY_INITIALIZE" | "PASSIVE_UPDATE_V2" | "PRESENCE_UPDATES" | "PRIVATE_CHANNEL_INTEGRATION_CREATE" | "PRIVATE_CHANNEL_INTEGRATION_UPDATE" | "RELATIONSHIP_ADD" | "SEARCH_FINISH" | "THREAD_LIST_SYNC" | "THREAD_MEMBER_LIST_UPDATE" | "THREAD_MEMBERS_UPDATE" | "UPDATE_CLIENT_PREMIUM_TYPE" | "USER_UPDATE">;
|
||||
|
||||
export class UserStore<
|
||||
export declare class UserStore<
|
||||
Constructor extends GenericConstructor = typeof UserStore
|
||||
> extends FluxSnapshotStore<Constructor, UserStoreSnapshotData, UserStoreAction> {
|
||||
constructor();
|
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { ExtractAction, FluxAction } from "../flux";
|
||||
import type { ExtractAction, FluxAction } from "../flux/fluxActions";
|
||||
import type { FluxStore } from "./abstract/FluxStore";
|
||||
|
||||
export type WindowStoreAction = ExtractAction<FluxAction, "WINDOW_FOCUS" | "WINDOW_FULLSCREEN_CHANGE" | "WINDOW_INIT" | "WINDOW_RESIZED" | "WINDOW_UNLOAD" | "WINDOW_VISIBILITY_CHANGE">;
|
||||
|
||||
export class WindowStore<Action extends FluxAction = WindowStoreAction> extends FluxStore<Action> {
|
||||
export declare class WindowStore<Action extends FluxAction = WindowStoreAction> extends FluxStore<Action> {
|
||||
static displayName: "WindowStore";
|
||||
|
||||
getFocusedWindowId(): string | null;
|
|
@ -4,14 +4,14 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { FluxActionHandlerMap } from "../../flux/fluxActionHandlers";
|
||||
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
|
||||
import type { FluxAction } from "../../flux/fluxActions";
|
||||
import type { FluxDispatcher } from "../../flux/FluxDispatcher";
|
||||
import type { GenericConstructor, Nullish } from "../../internal";
|
||||
import type { FluxStore } from "./FluxStore";
|
||||
|
||||
// Original name: PersistedStore
|
||||
export abstract class FluxPersistedStore<
|
||||
export declare abstract class FluxPersistedStore<
|
||||
Constructor extends GenericConstructor = GenericConstructor,
|
||||
State = unknown,
|
||||
Action extends FluxAction = FluxAction
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { FluxActionHandlerMap } from "../../flux/fluxActionHandlers";
|
||||
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
|
||||
import type { ExcludeAction, ExtractAction, FluxAction } from "../../flux/fluxActions";
|
||||
import type { GenericConstructor } from "../../internal";
|
||||
import type { FluxStore } from "./FluxStore";
|
||||
|
@ -19,7 +19,7 @@ type CacheActionType = "CLEAR_CACHES" | "WRITE_CACHES";
|
|||
export type FluxSnapshotStoreAction = ExcludeAction<FluxAction, CacheActionType>;
|
||||
|
||||
// Original name: SnapshotStore
|
||||
export abstract class FluxSnapshotStore<
|
||||
export declare abstract class FluxSnapshotStore<
|
||||
Constructor extends GenericConstructor = GenericConstructor,
|
||||
SnapshotData = unknown,
|
||||
Action extends FluxSnapshotStoreAction = FluxSnapshotStoreAction
|
|
@ -4,17 +4,17 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { FluxActionHandlerMap } from "../../flux/fluxActionHandlers";
|
||||
import type { FluxActionHandlerMap } from "../../flux/FluxActionHandlersGraph";
|
||||
import type { FluxAction } from "../../flux/fluxActions";
|
||||
import type { FluxDispatchBand, FluxDispatcher } from "../../flux/FluxDispatcher";
|
||||
import type { Nullish } from "../../internal";
|
||||
import type { Bivariant, Nullish } from "../../internal";
|
||||
|
||||
// Original name: Store
|
||||
export abstract class FluxStore<Action extends FluxAction = FluxAction> {
|
||||
export declare abstract class FluxStore<Action extends FluxAction = FluxAction> {
|
||||
constructor(
|
||||
dispatcher: FluxDispatcher,
|
||||
actionHandlers: FluxActionHandlerMap<Action>,
|
||||
dispatchBand?: FluxDispatchBand | Nullish
|
||||
actionHandlers?: FluxActionHandlerMap<Action> | Nullish,
|
||||
dispatchBand?: FluxDispatchBand | Nullish /* = dispatcher._defaultBand */
|
||||
);
|
||||
|
||||
static destroy(): void;
|
||||
|
@ -34,7 +34,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
|
|||
): void;
|
||||
registerActionHandlers(
|
||||
actionHandlers: FluxActionHandlerMap<Action>,
|
||||
dispatchBand?: FluxDispatchBand | Nullish
|
||||
dispatchBand?: FluxDispatchBand | Nullish /* = this._dispatcher._defaultBand */
|
||||
): void;
|
||||
syncWith(
|
||||
stores: FluxStore[],
|
||||
|
@ -48,7 +48,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
|
|||
_dispatcher: FluxDispatcher;
|
||||
_dispatchToken: string;
|
||||
_isInitialized: boolean;
|
||||
_mustEmitChanges: ((action: Action) => boolean) | Nullish;
|
||||
_mustEmitChanges: Bivariant<((action: Action) => boolean)> | Nullish;
|
||||
_reactChangeCallbacks: FluxChangeListeners;
|
||||
_syncWiths: {
|
||||
func: FluxSyncWithFunction;
|
||||
|
@ -64,7 +64,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
|
|||
export type FluxSyncWithFunction = () => boolean | undefined;
|
||||
|
||||
// Original name: ChangeListeners
|
||||
export class FluxChangeListeners {
|
||||
export declare class FluxChangeListeners {
|
||||
has(listener: FluxChangeListener): boolean;
|
||||
hasAny(): boolean;
|
||||
invokeAll(): void;
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
"noEmit": true,
|
||||
|
||||
"isolatedModules": true,
|
||||
|
||||
"lib": [
|
||||
"ES2019",
|
||||
"ES2020.BigInt",
|
||||
|
|
|
@ -16,18 +16,18 @@
|
|||
"sideEffects": false,
|
||||
"types": "./index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/lodash": "~4.17.4",
|
||||
"@types/lodash": "~4.17.5",
|
||||
"@types/node": "^18.19.34",
|
||||
"@types/react": "~18.2.79",
|
||||
"@types/react-dom": "~18.2.25",
|
||||
"@vencord/discord-types": "workspace:^",
|
||||
"discord-types": "^1.3.26",
|
||||
"discord-types": "^1.3.3",
|
||||
"standalone-electron-types": "^1.0.0",
|
||||
"type-fest": "^4.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"fs-extra": "^11.2.0",
|
||||
"tsx": "^4.13.3"
|
||||
"tsx": "^4.15.4"
|
||||
}
|
||||
}
|
||||
|
|
1069
pnpm-lock.yaml
1069
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue