@vencord/discord-types 1.0.0

This commit is contained in:
ryan-0324 2024-06-14 22:43:09 -04:00 committed by GitHub
parent f5bed654ba
commit 2090f62412
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 1017 additions and 881 deletions

View file

@ -49,38 +49,39 @@
}, },
"devDependencies": { "devDependencies": {
"@types/chrome": "^0.0.246", "@types/chrome": "^0.0.246",
"@types/diff": "^5.0.3", "@types/diff": "^5.2.1",
"@types/lodash": "~4.17.4", "@types/html-minifier-terser": "^7.0.2",
"@types/lodash": "~4.17.5",
"@types/node": "^18.19.34", "@types/node": "^18.19.34",
"@types/react": "~18.2.79", "@types/react": "~18.2.79",
"@types/react-dom": "~18.2.25", "@types/react-dom": "~18.2.25",
"@types/yazl": "^2.4.2", "@types/yazl": "^2.4.5",
"@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.12.0", "@typescript-eslint/parser": "^7.13.0",
"@vencord/discord-types": "workspace:^", "@vencord/discord-types": "workspace:^",
"diff": "^5.1.0", "diff": "^5.2.0",
"discord-types": "^1.3.26", "discord-types": "^1.3.3",
"esbuild": "^0.15.18", "esbuild": "^0.15.18",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-path-alias": "^1.1.0", "eslint-plugin-path-alias": "^1.1.0",
"eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-unused-imports": "^3.2.0", "eslint-plugin-unused-imports": "^3.2.0",
"highlight.js": "11.7.0", "highlight.js": "11.8.0",
"html-minifier-terser": "^7.2.0", "html-minifier-terser": "^7.2.0",
"moment": "2.22.2", "moment": "2.22.2",
"puppeteer-core": "^19.11.1", "puppeteer-core": "^19.11.1",
"standalone-electron-types": "^1.0.0", "standalone-electron-types": "^1.0.0",
"stylelint": "^15.6.0", "stylelint": "^15.11.0",
"stylelint-config-standard": "^33.0.0", "stylelint-config-standard": "^33.0.0",
"ts-patch": "^3.1.2", "ts-patch": "^3.2.0",
"tsx": "^4.13.3", "tsx": "^4.15.4",
"type-fest": "^4.20.0", "type-fest": "^4.20.0",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"typescript-transform-paths": "^3.4.7", "typescript-transform-paths": "^3.4.7",
"zip-local": "^0.3.5" "zip-local": "^0.3.5"
}, },
"packageManager": "pnpm@9.2.0", "packageManager": "pnpm@9.3.0",
"pnpm": { "pnpm": {
"patchedDependencies": { "patchedDependencies": {
"eslint-plugin-path-alias@1.1.0": "patches/eslint-plugin-path-alias@1.1.0.patch", "eslint-plugin-path-alias@1.1.0": "patches/eslint-plugin-path-alias@1.1.0.patch",

View file

@ -1,13 +1,15 @@
import stylistic from "@stylistic/eslint-plugin"; import stylistic from "@stylistic/eslint-plugin";
import checkFile from "eslint-plugin-check-file";
import eslintPluginHeaders from "eslint-plugin-headers"; import eslintPluginHeaders from "eslint-plugin-headers";
import eslintPluginImport from "eslint-plugin-import-x"; import eslintPluginImport from "eslint-plugin-import-x";
import simpleImportSort from "eslint-plugin-simple-import-sort"; import simpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginUnicorn from "eslint-plugin-unicorn"; import eslintPluginUnicorn from "eslint-plugin-unicorn";
import unusedImports from "eslint-plugin-unused-imports";
import tseslint from "typescript-eslint"; import tseslint from "typescript-eslint";
export default tseslint.config( export default tseslint.config(
{ {
files: ["**/*.mjs", "**/*.ts"], files: ["**/*.?(c|m)[jt]s?(x)"],
languageOptions: { languageOptions: {
parser: tseslint.parser, parser: tseslint.parser,
parserOptions: { parserOptions: {
@ -19,10 +21,12 @@ export default tseslint.config(
plugins: { plugins: {
"@stylistic": stylistic, "@stylistic": stylistic,
"@typescript-eslint": tseslint.plugin, "@typescript-eslint": tseslint.plugin,
"check-file": checkFile,
headers: eslintPluginHeaders, headers: eslintPluginHeaders,
import: eslintPluginImport, import: eslintPluginImport,
"simple-import-sort": simpleImportSort, "simple-import-sort": simpleImportSort,
unicorn: eslintPluginUnicorn, unicorn: eslintPluginUnicorn,
"unused-imports": unusedImports,
}, },
rules: { rules: {
"@stylistic/array-bracket-newline": ["error", "consistent"], "@stylistic/array-bracket-newline": ["error", "consistent"],
@ -49,7 +53,7 @@ export default tseslint.config(
"@stylistic/no-extra-semi": "error", "@stylistic/no-extra-semi": "error",
"@stylistic/no-floating-decimal": "error", "@stylistic/no-floating-decimal": "error",
"@stylistic/no-multi-spaces": "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-trailing-spaces": "error",
"@stylistic/no-whitespace-before-property": "error", "@stylistic/no-whitespace-before-property": "error",
"@stylistic/object-curly-newline": "error", "@stylistic/object-curly-newline": "error",
@ -94,7 +98,10 @@ export default tseslint.config(
} }
}], }],
"@typescript-eslint/method-signature-style": "error", "@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-enum-values": "error",
"@typescript-eslint/no-duplicate-type-constituents": "error", "@typescript-eslint/no-duplicate-type-constituents": "error",
"@typescript-eslint/no-empty-interface": "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-arguments": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error", "@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "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/no-useless-empty-export": "error",
"@typescript-eslint/prefer-function-type": "error", "@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }], "@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/extensions": "error",
"import/first": "error", "import/first": "error",
"import/newline-after-import": ["error", { considerComments: true }], "import/newline-after-import": ["error", { considerComments: true }],
"import/no-absolute-path": "error", "import/no-absolute-path": "error",
"import/no-duplicates": "error", "import/no-duplicates": "error",
"import/no-empty-named-blocks": "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-relative-packages": "error",
"import/no-self-import": "error", "import/no-self-import": "error",
"import/no-unassigned-import": "error", "import/no-unassigned-import": "error",
@ -131,18 +134,25 @@ export default tseslint.config(
"simple-import-sort/exports": "error", "simple-import-sort/exports": "error",
"simple-import-sort/imports": ["error", { groups: [["^[^.]"]] }], "simple-import-sort/imports": ["error", { groups: [["^[^.]"]] }],
"unicorn/escape-case": "error", "unicorn/escape-case": "error",
"unicorn/filename-case": ["error", { cases: { camelCase: true, pascalCase: true } }],
"unicorn/no-hex-escape": "error", "unicorn/no-hex-escape": "error",
"unicorn/no-zero-fractions": "error", "unicorn/no-zero-fractions": "error",
"unicorn/number-literal-case": "error", "unicorn/number-literal-case": "error",
"unicorn/numeric-separators-style": ["error", { number: { minimumDigits: 0 } }], "unicorn/numeric-separators-style": ["error", { number: { minimumDigits: 0 } }],
"unicorn/prefer-export-from": ["error", { ignoreUsedVariables: true }], "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: { rules: {
"@typescript-eslint/prefer-enum-initializers": "error", "@typescript-eslint/prefer-enum-initializers": "error",
"check-file/filename-blocklist": ["error", { "!**/!(*.d).ts": "!(*.d).ts" }],
"headers/header-format": ["error", { "headers/header-format": ["error", {
source: "string", source: "string",
content: [ content: [
@ -158,13 +168,25 @@ export default tseslint.config(
} }
}], }],
"import/no-default-export": "error", "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-globals": ["error", "_", "JSX", "React"],
"no-restricted-syntax": [ "no-restricted-syntax": [
"error", "error",
"ImportDeclaration[importKind=value]", ":expression:not([declare=true] *, [type=/^TS/] *, ExportAllDeclaration *, ImportDeclaration *)",
"TSEnumDeclaration[const=false]", "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 }],
}
},
); );

View file

@ -1,6 +1,6 @@
{ {
"name": "@vencord/discord-types", "name": "@vencord/discord-types",
"version": "0.0.0-development", "version": "1.0.0",
"description": "", "description": "",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"author": "Vencord", "author": "Vencord",
@ -9,6 +9,7 @@
"url": "https://github.com/Vendicated/Vencord.git", "url": "https://github.com/Vendicated/Vencord.git",
"directory": "packages/discord-types" "directory": "packages/discord-types"
}, },
"main": "./src/index.ts",
"files": ["src"], "files": ["src"],
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
@ -17,10 +18,9 @@
"test-ts": "tsc --noEmit" "test-ts": "tsc --noEmit"
}, },
"sideEffects": false, "sideEffects": false,
"types": "./src/index.d.ts",
"dependencies": { "dependencies": {
"@types/events": "~3.0.3", "@types/events": "~3.0.3",
"@types/lodash": "~4.17.4", "@types/lodash": "~4.17.5",
"@types/react": "~18.2.79", "@types/react": "~18.2.79",
"dependency-graph": "0.9.0", "dependency-graph": "0.9.0",
"moment": "2.22.2", "moment": "2.22.2",
@ -29,12 +29,14 @@
"devDependencies": { "devDependencies": {
"@eslint-types/unicorn": "^52.0.0", "@eslint-types/unicorn": "^52.0.0",
"@stylistic/eslint-plugin": "^2.1.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-headers": "^1.1.2",
"eslint-plugin-import-x": "^0.5.1", "eslint-plugin-import-x": "^0.5.1",
"eslint-plugin-simple-import-sort": "^12.1.0", "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": "^5.4.5",
"typescript-eslint": "^8.0.0-alpha.28" "typescript-eslint": "^8.0.0-alpha.30"
} }
} }

View file

@ -5,41 +5,14 @@
*/ */
import type { DepGraph } from "dependency-graph"; import type { DepGraph } from "dependency-graph";
import type { UnionToIntersection } from "type-fest";
import type { Nullish } from "../internal"; 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"; 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 // Original name: ActionHandlersGraph
export class FluxActionHandlersGraph { export declare class FluxActionHandlersGraph {
_addToBand(dispatchToken: string, dispatchBand: FluxDispatchBand): void; _addToBand(dispatchToken: string, dispatchBand: FluxDispatchBand): void;
_bandToken(dispatchBand: FluxDispatchBand): string; _bandToken(dispatchBand: FluxDispatchBand): string;
_computeOrderedActionHandlers<ActionType extends FluxActionType>( _computeOrderedActionHandlers<ActionType extends FluxActionType>(
@ -50,7 +23,7 @@ export class FluxActionHandlersGraph {
_validateDependencies(fromDispatchToken: string, toDispatchToken: string): void; _validateDependencies(fromDispatchToken: string, toDispatchToken: string): void;
addDependencies(fromDispatchToken: string, toDispatchTokens: string[]): void; addDependencies(fromDispatchToken: string, toDispatchTokens: string[]): void;
createToken(): string; createToken(): string;
getOrderedActionHandlers<ActionType extends FluxActionType>({ type }: { getOrderedActionHandlers<ActionType extends FluxActionType>(partialAction: {
type: ActionType; type: ActionType;
}): FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>>; }): FluxOrderedActionHandlers<ExtractAction<FluxAction, ActionType>>;
register<Action extends FluxAction>( register<Action extends FluxAction>(
@ -58,7 +31,7 @@ export class FluxActionHandlersGraph {
actionHandlers: FluxActionHandlerMap<Action>, actionHandlers: FluxActionHandlerMap<Action>,
storeDidChange: FluxActionHandler<Action>, storeDidChange: FluxActionHandler<Action>,
dispatchBand: FluxDispatchBand, dispatchBand: FluxDispatchBand,
dispatchToken?: string | undefined dispatchToken?: string | undefined /* = this.createToken() */
): string; ): string;
_dependencyGraph: DepGraph<FluxActionHandlersGraphNode>; _dependencyGraph: DepGraph<FluxActionHandlersGraphNode>;
@ -68,3 +41,28 @@ export class FluxActionHandlersGraph {
}; };
_orderedCallbackTokens: string[] | Nullish; _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>;
}[];

View 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;
}

View 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];

View file

@ -5,11 +5,12 @@
*/ */
import type { Nullish } from "../internal"; import type { Nullish } from "../internal";
import type { FluxActionHandler, FluxActionHandlerMap, FluxActionHandlersGraph } from "./fluxActionHandlers"; import type { FluxActionHandlerMap, FluxActionHandlersGraph } from "./FluxActionHandlersGraph";
import type { ExtractAction, FluxAction, FluxActionLogger, FluxActionType } from "./fluxActions"; import type { FluxActionLogger } from "./FluxActionLogger";
import type { ExtractAction, FluxAction, FluxActionHandler, FluxActionType } from "./fluxActions";
// Original name: Dispatcher // Original name: Dispatcher
export class FluxDispatcher { export declare class FluxDispatcher {
constructor( constructor(
defaultBand?: FluxDispatchBand | undefined /* = FluxDispatchBand.EARLY */, defaultBand?: FluxDispatchBand | undefined /* = FluxDispatchBand.EARLY */,
actionLogger?: FluxActionLogger | Nullish, actionLogger?: FluxActionLogger | Nullish,
@ -32,8 +33,8 @@ export class FluxDispatcher {
storeName: string, storeName: string,
actionHandlers: FluxActionHandlerMap<Action>, actionHandlers: FluxActionHandlerMap<Action>,
storeDidChange: FluxActionHandler<Action>, storeDidChange: FluxActionHandler<Action>,
dispatchBand?: FluxDispatchBand | Nullish, dispatchBand?: FluxDispatchBand | Nullish, /* = this._defaultBand */
dispatchToken?: string | undefined dispatchToken?: string | undefined /* = this._actionHandlers.createToken() */
): string; ): string;
subscribe<ActionType extends FluxActionType>( subscribe<ActionType extends FluxActionType>(
actionType: ActionType, actionType: ActionType,
@ -56,12 +57,12 @@ export class FluxDispatcher {
}; };
_waitQueue: (() => void)[]; _waitQueue: (() => void)[];
actionLogger: FluxActionLogger; actionLogger: FluxActionLogger;
functionCache: FluxActionHandlerMap; functionCache: Partial<FluxActionHandlerMap>;
} }
// Original name: DispatchBand // Original name: DispatchBand
// Enum keys made screaming snake case for consistency. // Enum keys made screaming snake case for consistency.
export const enum FluxDispatchBand { export enum FluxDispatchBand {
EARLY = 0, EARLY = 0,
DATABASE = 1, DATABASE = 1,
DEFAULT = 2, DEFAULT = 2,

View file

@ -7,7 +7,7 @@
import type { FluxStore, FluxSyncWithFunction } from "../stores/abstract/FluxStore"; import type { FluxStore, FluxSyncWithFunction } from "../stores/abstract/FluxStore";
// Original name: Emitter // Original name: Emitter
export class FluxEmitter { export declare class FluxEmitter {
batched<T>(callback: () => T): T; batched<T>(callback: () => T): T;
destroy(): void; destroy(): void;
emit(): void; emit(): void;
@ -17,8 +17,9 @@ export class FluxEmitter {
getIsPaused(): boolean; getIsPaused(): boolean;
injectBatchEmitChanges(batchEmitChanges: () => unknown): void; injectBatchEmitChanges(batchEmitChanges: () => unknown): void;
markChanged(store: FluxStore): void; markChanged(store: FluxStore): void;
/** If timeout is omitted, Emitter will pause until resume is called. */
pause(timeout?: number | undefined): void; pause(timeout?: number | undefined): void;
resume(shouldEmit?: boolean | undefined): void; resume(shouldEmit?: boolean | undefined /* = true */): void;
changedStores: Set<FluxStore>; changedStores: Set<FluxStore>;
changeSentinel: number; changeSentinel: number;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -4,7 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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 "./fluxActions";
export * from "./FluxDispatcher"; export * from "./FluxDispatcher";
export * from "./FluxEmitter"; export * from "./FluxEmitter";

View file

@ -14,6 +14,7 @@ export interface Activity {
emoji?: ActivityEmoji; emoji?: ActivityEmoji;
flags?: ActivityFlags; flags?: ActivityFlags;
id: string; id: string;
metadata?: Record<string, any>;
name: string; name: string;
party?: ActivityParty; party?: ActivityParty;
platform?: ActivityGamePlatform; platform?: ActivityGamePlatform;
@ -45,7 +46,7 @@ export interface ActivityGuildEmoji {
name: string; name: string;
} }
export const enum ActivityFlags { export enum ActivityFlags {
INSTANCE = 1 << 0, INSTANCE = 1 << 0,
JOIN = 1 << 1, JOIN = 1 << 1,
SYNC = 1 << 4, SYNC = 1 << 4,
@ -61,7 +62,7 @@ export interface ActivityParty {
} }
// Original name: ActivityGamePlatforms // Original name: ActivityGamePlatforms
export const enum ActivityGamePlatform { export enum ActivityGamePlatform {
ANDROID = "android", ANDROID = "android",
DESKTOP = "desktop", DESKTOP = "desktop",
EMBEDDED = "embedded", EMBEDDED = "embedded",
@ -72,7 +73,7 @@ export const enum ActivityGamePlatform {
XBOX = "xbox", XBOX = "xbox",
} }
export const enum ActivityPlatform { export enum ActivityPlatform {
DESKTOP = "desktop", DESKTOP = "desktop",
MOBILE = "mobile", MOBILE = "mobile",
} }
@ -83,7 +84,7 @@ export interface ActivityTimestamps {
} }
// Original name: ActivityTypes // Original name: ActivityTypes
export const enum ActivityType { export enum ActivityType {
PLAYING = 0, PLAYING = 0,
STREAMING = 1, STREAMING = 1,
LISTENING = 2, LISTENING = 2,

View file

@ -26,13 +26,13 @@ export type ApplicationCommand<CommandType extends ApplicationCommandType = Appl
version: string; version: string;
} & (CommandType extends ApplicationCommandType.CHAT ? { options?: ApplicationCommandOption[]; } : {}); } & (CommandType extends ApplicationCommandType.CHAT ? { options?: ApplicationCommandOption[]; } : {});
export const enum InteractionContextType { export enum InteractionContextType {
GUILD = 0, GUILD = 0,
BOT_DM = 1, BOT_DM = 1,
PRIVATE_CHANNEL = 2, PRIVATE_CHANNEL = 2,
} }
export const enum ApplicationCommandType { export enum ApplicationCommandType {
CHAT = 1, CHAT = 1,
USER = 2, USER = 2,
MESSAGE = 3, MESSAGE = 3,
@ -125,7 +125,7 @@ export interface ApplicationCommandAttachmentOption extends ApplicationCommandNo
type: ApplicationCommandOptionType.ATTACHMENT; type: ApplicationCommandOptionType.ATTACHMENT;
} }
export const enum ApplicationCommandOptionType { export enum ApplicationCommandOptionType {
SUB_COMMAND = 1, SUB_COMMAND = 1,
SUB_COMMAND_GROUP = 2, SUB_COMMAND_GROUP = 2,
STRING = 3, STRING = 3,

View file

@ -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 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 OwnProperties extends ApplicationRecordOwnProperties = ApplicationRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
/** @todo */ /** @todo */
@ -85,7 +85,7 @@ export interface EmbeddedActivityConfig {
} }
// Original name: EmbeddedActivitySupportedPlatforms // Original name: EmbeddedActivitySupportedPlatforms
export const enum EmbeddedActivitySupportedPlatform { export enum EmbeddedActivitySupportedPlatform {
ANDROID = "android", ANDROID = "android",
IOS = "ios", IOS = "ios",
WEB = "web", WEB = "web",
@ -99,13 +99,13 @@ export interface EmbeddedActivityClientPlatformConfig {
} }
// Original name: EmbeddedActivityLabelTypes // Original name: EmbeddedActivityLabelTypes
export const enum EmbeddedActivityLabelType { export enum EmbeddedActivityLabelType {
NONE = 0, NONE = 0,
NEW = 1, NEW = 1,
UPDATED = 2, UPDATED = 2,
} }
export const enum OrientationLockState { export enum OrientationLockState {
UNLOCKED = 1, UNLOCKED = 1,
PORTRAIT = 2, PORTRAIT = 2,
LANDSCAPE = 3, LANDSCAPE = 3,
@ -118,7 +118,7 @@ export interface ApplicationExecutable {
os: string; os: string;
} }
export const enum ApplicationIntegrationType { export enum ApplicationIntegrationType {
GUILD_INSTALL = 0, GUILD_INSTALL = 0,
USER_INSTALL = 1, USER_INSTALL = 1,
} }
@ -128,7 +128,8 @@ export interface ApplicationIntegrationTypeConfig {
} }
// Original name: OAuth2Scopes // Original name: OAuth2Scopes
export const enum OAuth2Scope { export enum OAuth2Scope {
ACCOUNT_GLOBAL_NAME_UPDATE = "account.global_name.update",
ACTIVITIES_READ = "activities.read", ACTIVITIES_READ = "activities.read",
ACTIVITIES_WRITE = "activities.write", ACTIVITIES_WRITE = "activities.write",
APPLICATIONS_BUILDS_READ = "applications.builds.read", APPLICATIONS_BUILDS_READ = "applications.builds.read",
@ -144,6 +145,7 @@ export const enum OAuth2Scope {
DM_CHANNELS_MESSAGES_WRITE = "dm_channels.messages.write", DM_CHANNELS_MESSAGES_WRITE = "dm_channels.messages.write",
DM_CHANNELS_READ = "dm_channels.read", DM_CHANNELS_READ = "dm_channels.read",
EMAIL = "email", EMAIL = "email",
GATEWAY_CONNECT = "gateway.connect",
GDM_JOIN = "gdm.join", GDM_JOIN = "gdm.join",
GUILDS = "guilds", GUILDS = "guilds",
GUILDS_JOIN = "guilds.join", GUILDS_JOIN = "guilds.join",
@ -151,6 +153,7 @@ export const enum OAuth2Scope {
IDENTIFY = "identify", IDENTIFY = "identify",
MESSAGES_READ = "messages.read", MESSAGES_READ = "messages.read",
OPENID = "openid", OPENID = "openid",
PAYMENT_SOURCES_COUNTRY_CODE = "payment_sources.country_code",
PRESENCES_READ = "presences.read", PRESENCES_READ = "presences.read",
PRESENCES_WRITE = "presences.write", PRESENCES_WRITE = "presences.write",
RELATIONSHIPS_READ = "relationships.read", RELATIONSHIPS_READ = "relationships.read",
@ -175,7 +178,7 @@ export interface ApplicationInstallParams {
scopes: OAuth2Scope[]; scopes: OAuth2Scope[];
} }
export const enum ApplicationFlags { export enum ApplicationFlags {
EMBEDDED_RELEASED = 1 << 1, EMBEDDED_RELEASED = 1 << 1,
EMBEDDED_IAP = 1 << 3, EMBEDDED_IAP = 1 << 3,
APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE = 1 << 6, APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE = 1 << 6,
@ -191,13 +194,13 @@ export const enum ApplicationFlags {
SOCIAL_LAYER_INTEGRATION = 1 << 27, SOCIAL_LAYER_INTEGRATION = 1 << 27,
} }
export const enum ApplicationOverlayMethodFlags { export enum ApplicationOverlayMethodFlags {
DEFAULT = 0, DEFAULT = 0,
OUT_OF_PROCESS = 1 << 0, OUT_OF_PROCESS = 1 << 0,
} }
// Original name: ApplicationTypes // Original name: ApplicationTypes
export const enum ApplicationType { export enum ApplicationType {
GAME = 1, GAME = 1,
TICKETED_EVENTS = 3, TICKETED_EVENTS = 3,
GUILD_ROLE_SUBSCRIPTIONS = 4, GUILD_ROLE_SUBSCRIPTIONS = 4,

View file

@ -28,7 +28,7 @@ export interface Clan {
wildcardDescriptors: string[]; wildcardDescriptors: string[];
} }
export const enum ClanBadgeKind { export enum ClanBadgeKind {
SWORD = 0, SWORD = 0,
WATER_DROP = 1, WATER_DROP = 1,
SKULL = 2, SKULL = 2,
@ -52,7 +52,7 @@ export const enum ClanBadgeKind {
WIND = 20, WIND = 20,
} }
export const enum ClanBannerKind { export enum ClanBannerKind {
NIGHT_SKY = 0, NIGHT_SKY = 0,
CASTLE = 1, CASTLE = 1,
WORLD_MAP = 2, WORLD_MAP = 2,
@ -65,7 +65,7 @@ export const enum ClanBannerKind {
} }
// Original name: ClanPlaystyles // Original name: ClanPlaystyles
export const enum ClanPlaystyle { export enum ClanPlaystyle {
NONE = 0, NONE = 0,
SOCIAL = 1, SOCIAL = 1,
CASUAL = 2, CASUAL = 2,

View file

@ -8,7 +8,7 @@ import type { ImmutableRecord } from "./ImmutableRecord";
export type CompanyRecordOwnProperties = Pick<CompanyRecord, "id" | "name">; export type CompanyRecordOwnProperties = Pick<CompanyRecord, "id" | "name">;
export class CompanyRecord< export declare class CompanyRecord<
OwnProperties extends CompanyRecordOwnProperties = CompanyRecordOwnProperties OwnProperties extends CompanyRecordOwnProperties = CompanyRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
constructor(companyProperties: CompanyRecordOwnProperties); constructor(companyProperties: CompanyRecordOwnProperties);

View file

@ -11,7 +11,7 @@ export type Draft<Type extends DraftType = DraftType>
: never; : never;
// Enum keys made screaming snake case for consistency. // Enum keys made screaming snake case for consistency.
export const enum DraftType { export enum DraftType {
CHANNEL_MESSAGE = 0, CHANNEL_MESSAGE = 0,
THREAD_SETTINGS = 1, THREAD_SETTINGS = 1,
FIRST_THREAD_MESSAGE = 2, FIRST_THREAD_MESSAGE = 2,

View file

@ -6,7 +6,7 @@
import type { Nullish } from "../internal"; 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: { constructor(options: {
afterCompute: Frecency<Key, Value>["afterCompute"]; afterCompute: Frecency<Key, Value>["afterCompute"];
computeBonus: Frecency<Key, Value>["computeBonus"]; computeBonus: Frecency<Key, Value>["computeBonus"];

View file

@ -28,7 +28,7 @@ export interface GuildMember {
userId: string; userId: string;
} }
export const enum GuildMemberFlags { export enum GuildMemberFlags {
DID_REJOIN = 1 << 0, DID_REJOIN = 1 << 0,
COMPLETED_ONBOARDING = 1 << 1, COMPLETED_ONBOARDING = 1 << 1,
BYPASSES_VERIFICATION = 1 << 2, BYPASSES_VERIFICATION = 1 << 2,

View file

@ -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 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 OwnProperties extends GuildRecordOwnProperties = GuildRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
/** @todo */ /** @todo */
@ -22,8 +22,8 @@ export class GuildRecord<
canHaveRaidActivityAlerts(): boolean; canHaveRaidActivityAlerts(): boolean;
getApplicationId(): string | null; getApplicationId(): string | null;
getEveryoneRoleId(): string; getEveryoneRoleId(): string;
getIconSource(iconSize?: number | undefined, canAnimate?: boolean | undefined): IconSource; getIconSource(iconSize?: number | undefined, canAnimate?: boolean | undefined /* = false */): IconSource;
getIconURL(iconSize?: number | undefined, canAnimate?: boolean | undefined): string; getIconURL(iconSize?: number | undefined, canAnimate?: boolean | undefined /* = false */): string;
getMaxEmojiSlots(): number; getMaxEmojiSlots(): number;
getMaxRoleSubscriptionEmojiSlots(): number; getMaxRoleSubscriptionEmojiSlots(): number;
getMaxSoundboardSlots(): number; getMaxSoundboardSlots(): number;
@ -76,7 +76,7 @@ export class GuildRecord<
} }
// Original name: UserNotificationSettings // Original name: UserNotificationSettings
export const enum UserNotificationSetting { export enum UserNotificationSetting {
ALL_MESSAGES = 0, ALL_MESSAGES = 0,
ONLY_MENTIONS = 1, ONLY_MENTIONS = 1,
NO_MESSAGES = 2, NO_MESSAGES = 2,
@ -84,18 +84,18 @@ export const enum UserNotificationSetting {
} }
// Original name: GuildExplicitContentFilterTypes // Original name: GuildExplicitContentFilterTypes
export const enum GuildExplicitContentFilterType { export enum GuildExplicitContentFilterType {
DISABLED = 0, DISABLED = 0,
MEMBERS_WITHOUT_ROLES = 1, MEMBERS_WITHOUT_ROLES = 1,
ALL_MEMBERS = 2, ALL_MEMBERS = 2,
} }
// Original name: GuildFeatures // Original name: GuildFeatures
export const enum GuildFeature { export enum GuildFeature {
ANIMATED_BANNER = "ANIMATED_BANNER", ANIMATED_BANNER = "ANIMATED_BANNER",
ANIMATED_ICON = "ANIMATED_ICON", ANIMATED_ICON = "ANIMATED_ICON",
AUTOMOD_TRIGGER_USER_PROFILE = "AUTOMOD_TRIGGER_USER_PROFILE",
AUTO_MODERATION = "AUTO_MODERATION", AUTO_MODERATION = "AUTO_MODERATION",
AUTOMOD_TRIGGER_USER_PROFILE = "AUTOMOD_TRIGGER_USER_PROFILE",
BANNER = "BANNER", BANNER = "BANNER",
BURST_REACTIONS = "BURST_REACTIONS", BURST_REACTIONS = "BURST_REACTIONS",
CHANNEL_ICON_EMOJIS_GENERATED = "CHANNEL_ICON_EMOJIS_GENERATED", CHANNEL_ICON_EMOJIS_GENERATED = "CHANNEL_ICON_EMOJIS_GENERATED",
@ -131,14 +131,15 @@ export const enum GuildFeature {
HAS_DIRECTORY_ENTRY = "HAS_DIRECTORY_ENTRY", HAS_DIRECTORY_ENTRY = "HAS_DIRECTORY_ENTRY",
HUB = "HUB", HUB = "HUB",
INTERNAL_EMPLOYEE_ONLY = "INTERNAL_EMPLOYEE_ONLY", INTERNAL_EMPLOYEE_ONLY = "INTERNAL_EMPLOYEE_ONLY",
INVITES_DISABLED = "INVITES_DISABLED",
INVITE_SPLASH = "INVITE_SPLASH", INVITE_SPLASH = "INVITE_SPLASH",
INVITES_DISABLED = "INVITES_DISABLED",
LINKED_TO_HUB = "LINKED_TO_HUB", LINKED_TO_HUB = "LINKED_TO_HUB",
MEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED", MEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED",
MORE_EMOJI = "MORE_EMOJI", MORE_EMOJI = "MORE_EMOJI",
MORE_SOUNDBOARD = "MORE_SOUNDBOARD",
MORE_STICKERS = "MORE_STICKERS", MORE_STICKERS = "MORE_STICKERS",
NEWS = "NEWS",
NEW_THREAD_PERMISSIONS = "NEW_THREAD_PERMISSIONS", NEW_THREAD_PERMISSIONS = "NEW_THREAD_PERMISSIONS",
NEWS = "NEWS",
NON_COMMUNITY_RAID_ALERTS = "NON_COMMUNITY_RAID_ALERTS", NON_COMMUNITY_RAID_ALERTS = "NON_COMMUNITY_RAID_ALERTS",
PARTNERED = "PARTNERED", PARTNERED = "PARTNERED",
PREVIEW_ENABLED = "PREVIEW_ENABLED", PREVIEW_ENABLED = "PREVIEW_ENABLED",
@ -164,19 +165,19 @@ export const enum GuildFeature {
} }
// Original name: GuildHubTypes // Original name: GuildHubTypes
export const enum GuildHubType { export enum GuildHubType {
DEFAULT = 0, DEFAULT = 0,
HIGH_SCHOOL = 1, HIGH_SCHOOL = 1,
COLLEGE = 2, COLLEGE = 2,
} }
// Original name: MFALevels // Original name: MFALevels
export const enum MFALevel { export enum MFALevel {
NONE = 0, NONE = 0,
ELEVATED = 1, ELEVATED = 1,
} }
export const enum GuildNSFWContentLevel { export enum GuildNSFWContentLevel {
DEFAULT = 0, DEFAULT = 0,
EXPLICIT = 1, EXPLICIT = 1,
SAFE = 2, SAFE = 2,
@ -184,14 +185,14 @@ export const enum GuildNSFWContentLevel {
} }
// Original name: BoostedGuildTiers // Original name: BoostedGuildTiers
export const enum BoostedGuildTier { export enum BoostedGuildTier {
NONE = 0, NONE = 0,
TIER_1 = 1, TIER_1 = 1,
TIER_2 = 2, TIER_2 = 2,
TIER_3 = 3, TIER_3 = 3,
} }
export const enum SystemChannelFlags { export enum SystemChannelFlags {
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0, SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1, SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2, SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,
@ -202,7 +203,7 @@ export const enum SystemChannelFlags {
} }
// Original name: VerificationLevels // Original name: VerificationLevels
export const enum VerificationLevel { export enum VerificationLevel {
NONE = 0, NONE = 0,
LOW = 1, LOW = 1,
MEDIUM = 2, MEDIUM = 2,

View file

@ -6,7 +6,7 @@
// Original name: Record // Original name: Record
// Renamed to avoid name conflicts with TypeScripts's Record utility type. // 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; merge(collection: Partial<OwnProperties>): this;
set<Key extends keyof OwnProperties>(key: Key, value: OwnProperties[Key]): this; set<Key extends keyof OwnProperties>(key: Key, value: OwnProperties[Key]): this;
toJS(): OwnProperties; toJS(): OwnProperties;

View file

@ -6,7 +6,7 @@
/* /*
// bigint enums are not yet possible: https://github.com/microsoft/TypeScript/issues/37783 // 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, CREATE_INSTANT_INVITE = 1n << 0n,
KICK_MEMBERS = 1n << 1n, KICK_MEMBERS = 1n << 1n,
BAN_MEMBERS = 1n << 2n, BAN_MEMBERS = 1n << 2n,
@ -57,6 +57,7 @@ export const enum Permissions {
USE_CLYDE_AI = 1n << 47n, USE_CLYDE_AI = 1n << 47n,
SET_VOICE_CHANNEL_STATUS = 1n << 48n, SET_VOICE_CHANNEL_STATUS = 1n << 48n,
SEND_POLLS = 1n << 49n, SEND_POLLS = 1n << 49n,
USE_EXTERNAL_APPS = 1n << 50n,
} }
*/ */
@ -71,7 +72,7 @@ export interface PermissionOverwrite {
type: PermissionOverwriteType; type: PermissionOverwriteType;
} }
export const enum PermissionOverwriteType { export enum PermissionOverwriteType {
ROLE = 0, ROLE = 0,
MEMBER = 1, MEMBER = 1,
} }

View file

@ -8,7 +8,7 @@ import type { Nullish, Optional } from "../internal";
import type { BasicPermissionsObject } from "../stores/PermissionStore"; import type { BasicPermissionsObject } from "../stores/PermissionStore";
import type { GuildChannelRecord } from "./channels/ChannelRecord"; 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(channelId: string, type?: ChannelIdReadStateType | undefined);
constructor(userId: string, type: UserIdReadStateType); constructor(userId: string, type: UserIdReadStateType);
constructor(guildId: string, type: GuildIdReadStateType); constructor(guildId: string, type: GuildIdReadStateType);
@ -175,7 +175,7 @@ export interface GuildChannelOverride {
muted: boolean; muted: boolean;
} }
export const enum ChannelNotificationSettingsFlags { export enum ChannelNotificationSettingsFlags {
UNREADS_ONLY_MENTIONS = 1 << 9, UNREADS_ONLY_MENTIONS = 1 << 9,
UNREADS_ALL_MESSAGES = 1 << 10, UNREADS_ALL_MESSAGES = 1 << 10,
FAVORITED = 1 << 11, FAVORITED = 1 << 11,
@ -197,7 +197,7 @@ export interface ReadStateSnapshot {
unread: boolean; unread: boolean;
} }
export const enum ReadStateFlags { export enum ReadStateFlags {
IS_GUILD_CHANNEL = 1 << 0, IS_GUILD_CHANNEL = 1 << 0,
IS_THREAD = 1 << 1, 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; export type GuildIdReadStateType = ReadStateType.GUILD_EVENT | ReadStateType.GUILD_HOME | ReadStateType.GUILD_ONBOARDING_QUESTION;
// Original name: ReadStateTypes // Original name: ReadStateTypes
export const enum ReadStateType { export enum ReadStateType {
CHANNEL = 0, CHANNEL = 0,
GUILD_EVENT = 1, GUILD_EVENT = 1,
NOTIFICATION_CENTER = 2, NOTIFICATION_CENTER = 2,

View file

@ -17,17 +17,19 @@ export interface Role {
originalPosition: number; originalPosition: number;
permissions: /* Permissions */ bigint; permissions: /* Permissions */ bigint;
position: number; position: number;
tags: { tags: RoleTags;
unicodeEmoji: string | null;
}
export enum RoleFlags {
IN_PROMPT = 1,
}
export interface RoleTags {
available_for_purchase?: null; available_for_purchase?: null;
bot_id?: string; bot_id?: string;
guild_connections?: null; guild_connections?: null;
integration_id?: string; integration_id?: string;
premium_subscriber?: null; premium_subscriber?: null;
subscription_listing_id?: string; subscription_listing_id?: string;
};
unicodeEmoji: string | null;
}
export const enum RoleFlags {
IN_PROMPT = 1,
} }

View file

@ -81,7 +81,7 @@ export interface ProfileConnectedAccountData {
} }
// Original name: PlatformTypes // Original name: PlatformTypes
export const enum PlatformType { export enum PlatformType {
AMAZON_MUSIC = "amazon-music", AMAZON_MUSIC = "amazon-music",
BATTLENET = "battlenet", BATTLENET = "battlenet",
BUNGIE = "bungie", BUNGIE = "bungie",

View file

@ -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 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 OwnProperties extends UserRecordOwnProperties = UserRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
/** @todo */ /** @todo */
@ -26,13 +26,13 @@ export class UserRecord<
get createdAt(): Date; get createdAt(): Date;
getAvatarSource( getAvatarSource(
guildId?: string | Nullish, guildId?: string | Nullish,
canAnimate?: boolean | undefined, canAnimate?: boolean | undefined /* = false */,
avatarSize?: number | undefined avatarSize?: number | undefined /* = 128 */
): IconSource; ): IconSource;
getAvatarURL( getAvatarURL(
guildId?: string | Nullish, guildId?: string | Nullish,
avatarSize?: number | undefined, avatarSize?: number | undefined /* = 128 */,
canAnimate?: boolean | undefined canAnimate?: boolean | undefined /* = false */
): string; ): string;
hasAvatarForGuild(guildId?: string | Nullish): boolean; hasAvatarForGuild(guildId?: string | Nullish): boolean;
hasDisabledPremium(): boolean; hasDisabledPremium(): boolean;
@ -97,7 +97,7 @@ export interface UserClanData {
tag: string | null; tag: string | null;
} }
export const enum UserFlags { export enum UserFlags {
STAFF = 1 << 0, STAFF = 1 << 0,
PARTNER = 1 << 1, PARTNER = 1 << 1,
HYPESQUAD = 1 << 2, HYPESQUAD = 1 << 2,
@ -124,10 +124,10 @@ export const enum UserFlags {
} }
// Original name: PremiumTypes // Original name: PremiumTypes
export const enum UserPremiumType { export enum UserPremiumType {
/** Nitro Classic */ /** Nitro Classic */
TIER_1 = 1, TIER_1 = 1,
/** Nitro */ /** Nitro Standard */
TIER_2 = 2, TIER_2 = 2,
/** Nitro Basic */ /** Nitro Basic */
TIER_0 = 3, TIER_0 = 3,

View file

@ -19,13 +19,13 @@ export type ChannelRecord = GuildChannelRecord | PrivateChannelRecord | ThreadCh
export type GuildChannelRecord = GuildTextualChannelRecord | GuildVocalChannelRecord | ForumChannelRecord; 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"; 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 */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);
@ -34,7 +34,7 @@ export abstract class ChannelRecordBase {
computeLurkerPermissionsAllowList(): /* Permissions */ bigint | undefined; computeLurkerPermissionsAllowList(): /* Permissions */ bigint | undefined;
get flags(): ChannelFlags; get flags(): ChannelFlags;
getApplicationId(): this["application_id"]; getApplicationId(): this["application_id"];
getDefaultLayout(): FormLayout; getDefaultLayout(): ForumLayout;
getDefaultSortOrder(): ThreadSortOrder; getDefaultSortOrder(): ThreadSortOrder;
getGuildId(): this["guild_id"]; getGuildId(): this["guild_id"];
hasFlag(flag: ChannelFlags): boolean; hasFlag(flag: ChannelFlags): boolean;
@ -84,11 +84,8 @@ export abstract class ChannelRecordBase {
availableTags?: ForumTag[] | undefined; availableTags?: ForumTag[] | undefined;
bitrate_?: number | undefined; bitrate_?: number | undefined;
defaultAutoArchiveDuration?: number | undefined; defaultAutoArchiveDuration?: number | undefined;
defaultForumLayout?: FormLayout | undefined; defaultForumLayout?: ForumLayout | undefined;
defaultReactionEmoji?: { defaultReactionEmoji?: ForumDefaultReactionEmoji | undefined;
emojiId: string | null;
emojiName: string | null;
} | undefined;
defaultSortOrder?: ThreadSortOrder | Nullish; defaultSortOrder?: ThreadSortOrder | Nullish;
defaultThreadRateLimitPerUser?: number | undefined; defaultThreadRateLimitPerUser?: number | undefined;
flags_: ChannelFlags; flags_: ChannelFlags;
@ -132,6 +129,7 @@ export abstract class ChannelRecordBase {
userLimit_?: number | undefined; userLimit_?: number | undefined;
version?: number | undefined; version?: number | undefined;
videoQualityMode?: VideoQualityMode | undefined; videoQualityMode?: VideoQualityMode | undefined;
/** @todo This seems to have been removed. */
voiceBackgroundDisplay?: { type: VoiceCallBackgroundType.EMPTY; } voiceBackgroundDisplay?: { type: VoiceCallBackgroundType.EMPTY; }
| { resourceId: string; type: VoiceCallBackgroundType.GRADIENT; } | { resourceId: string; type: VoiceCallBackgroundType.GRADIENT; }
| Nullish; | Nullish;
@ -145,18 +143,23 @@ export interface ForumTag {
name: string; name: string;
} }
export const enum FormLayout { export enum ForumLayout {
DEFAULT = 0, DEFAULT = 0,
LIST = 1, LIST = 1,
GRID = 2, GRID = 2,
} }
export const enum ThreadSortOrder { export interface ForumDefaultReactionEmoji {
emojiId: string | null;
emojiName: string | null;
}
export enum ThreadSortOrder {
LATEST_ACTIVITY = 0, LATEST_ACTIVITY = 0,
CREATION_DATE = 1, CREATION_DATE = 1,
} }
export const enum ChannelFlags { export enum ChannelFlags {
GUILD_FEED_REMOVED = 1 << 0, GUILD_FEED_REMOVED = 1 << 0,
PINNED = 1 << 1, PINNED = 1 << 1,
ACTIVE_CHANNELS_REMOVED = 1 << 2, ACTIVE_CHANNELS_REMOVED = 1 << 2,
@ -183,13 +186,14 @@ export interface ThreadMember {
muted: boolean; muted: boolean;
} }
export const enum ThreadMemberFlags { export enum ThreadMemberFlags {
HAS_INTERACTED = 1 << 0, HAS_INTERACTED = 1 << 0,
ALL_MESSAGES = 1 << 1, ALL_MESSAGES = 1 << 1,
ONLY_MENTIONS = 1 << 2, ONLY_MENTIONS = 1 << 2,
NO_MESSAGES = 1 << 3, NO_MESSAGES = 1 << 3,
} }
/** @todo This may just be a user object from the API. */
export interface ChannelRecipient { export interface ChannelRecipient {
avatar: string | null; avatar: string | null;
avatar_decoration_data: SnakeCasedProperties<AvatarDecorationData> | null; avatar_decoration_data: SnakeCasedProperties<AvatarDecorationData> | null;
@ -210,7 +214,7 @@ export interface SafetyWarning {
} }
// Original name: SafetyWarningTypes // Original name: SafetyWarningTypes
export const enum SafetyWarningType { export enum SafetyWarningType {
STRANGER_DANGER = 1, STRANGER_DANGER = 1,
INAPPROPRIATE_CONVERSATION_TIER_1 = 2, INAPPROPRIATE_CONVERSATION_TIER_1 = 2,
INAPPROPRIATE_CONVERSATION_TIER_2 = 3, INAPPROPRIATE_CONVERSATION_TIER_2 = 3,
@ -226,7 +230,7 @@ export interface ThreadMetadata {
} }
// Original name: ChannelTypes // Original name: ChannelTypes
export const enum ChannelType { export enum ChannelType {
GUILD_TEXT = 0, GUILD_TEXT = 0,
DM = 1, DM = 1,
GUILD_VOICE = 2, GUILD_VOICE = 2,
@ -244,13 +248,14 @@ export const enum ChannelType {
UNKNOWN = 10_000, UNKNOWN = 10_000,
} }
export const enum VideoQualityMode { export enum VideoQualityMode {
AUTO = 1, AUTO = 1,
FULL = 2, FULL = 2,
} }
// Original name: VoiceCallBackgroundTypes // Original name: VoiceCallBackgroundTypes
export const enum VoiceCallBackgroundType { /** @todo This seems to have been removed. */
export enum VoiceCallBackgroundType {
EMPTY = 0, EMPTY = 0,
GRADIENT = 1, GRADIENT = 1,
} }

View file

@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
export type ForumChannelRecord = GuildForumChannelRecord | GuildMediaChannelRecord; export type ForumChannelRecord = GuildForumChannelRecord | GuildMediaChannelRecord;
export abstract class ForumChannelRecordBase extends ChannelRecordBase { export declare abstract class ForumChannelRecordBase extends ChannelRecordBase {
/** @todo */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);
@ -63,10 +63,10 @@ export abstract class ForumChannelRecordBase extends ChannelRecordBase {
voiceBackgroundDisplay?: undefined; voiceBackgroundDisplay?: undefined;
} }
export class GuildForumChannelRecord extends ForumChannelRecordBase { export declare class GuildForumChannelRecord extends ForumChannelRecordBase {
type: ChannelType.GUILD_FORUM; type: ChannelType.GUILD_FORUM;
} }
export class GuildMediaChannelRecord extends ForumChannelRecordBase { export declare class GuildMediaChannelRecord extends ForumChannelRecordBase {
type: ChannelType.GUILD_MEDIA; type: ChannelType.GUILD_MEDIA;
} }

View file

@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
export type GuildTextualChannelRecord = GuildTextChannelRecord | GuildCategoryChannelRecord | GuildAnnouncementChannelRecord | GuildStoreChannelRecord | GuildDirectoryChannelRecord; export type GuildTextualChannelRecord = GuildTextChannelRecord | GuildCategoryChannelRecord | GuildAnnouncementChannelRecord | GuildStoreChannelRecord | GuildDirectoryChannelRecord;
export abstract class GuildTextualChannelRecordBase extends ChannelRecordBase { export declare abstract class GuildTextualChannelRecordBase extends ChannelRecordBase {
/** @todo */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);
@ -63,11 +63,11 @@ export abstract class GuildTextualChannelRecordBase extends ChannelRecordBase {
voiceBackgroundDisplay?: undefined; voiceBackgroundDisplay?: undefined;
} }
export class GuildTextChannelRecord extends GuildTextualChannelRecordBase { export declare class GuildTextChannelRecord extends GuildTextualChannelRecordBase {
type: ChannelType.GUILD_TEXT; type: ChannelType.GUILD_TEXT;
} }
export class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase { export declare class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase {
defaultAutoArchiveDuration: undefined; defaultAutoArchiveDuration: undefined;
defaultThreadRateLimitPerUser: undefined; defaultThreadRateLimitPerUser: undefined;
lastMessageId: undefined; lastMessageId: undefined;
@ -79,14 +79,14 @@ export class GuildCategoryChannelRecord extends GuildTextualChannelRecordBase {
type: ChannelType.GUILD_CATEGORY; type: ChannelType.GUILD_CATEGORY;
} }
export class GuildAnnouncementChannelRecord extends GuildTextualChannelRecordBase { export declare class GuildAnnouncementChannelRecord extends GuildTextualChannelRecordBase {
type: ChannelType.GUILD_ANNOUNCEMENT; type: ChannelType.GUILD_ANNOUNCEMENT;
} }
export class GuildStoreChannelRecord extends GuildTextualChannelRecordBase { export declare class GuildStoreChannelRecord extends GuildTextualChannelRecordBase {
type: ChannelType.GUILD_STORE; type: ChannelType.GUILD_STORE;
} }
export class GuildDirectoryChannelRecord extends GuildTextualChannelRecordBase { export declare class GuildDirectoryChannelRecord extends GuildTextualChannelRecordBase {
type: ChannelType.GUILD_DIRECTORY; type: ChannelType.GUILD_DIRECTORY;
} }

View file

@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
export type GuildVocalChannelRecord = GuildVoiceChannelRecord | GuildStageVoiceChannelRecord; export type GuildVocalChannelRecord = GuildVoiceChannelRecord | GuildStageVoiceChannelRecord;
export abstract class GuildVocalChannelRecordBase extends ChannelRecordBase { export declare abstract class GuildVocalChannelRecordBase extends ChannelRecordBase {
/** @todo */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);
@ -64,10 +64,10 @@ export abstract class GuildVocalChannelRecordBase extends ChannelRecordBase {
voiceBackgroundDisplay: Defined<ChannelRecordBase["voiceBackgroundDisplay"]>; voiceBackgroundDisplay: Defined<ChannelRecordBase["voiceBackgroundDisplay"]>;
} }
export class GuildVoiceChannelRecord extends GuildVocalChannelRecordBase { export declare class GuildVoiceChannelRecord extends GuildVocalChannelRecordBase {
type: ChannelType.GUILD_VOICE; type: ChannelType.GUILD_VOICE;
} }
export class GuildStageVoiceChannelRecord extends GuildVocalChannelRecordBase { export declare class GuildStageVoiceChannelRecord extends GuildVocalChannelRecordBase {
type: ChannelType.GUILD_STAGE_VOICE; type: ChannelType.GUILD_STAGE_VOICE;
} }

View file

@ -9,7 +9,7 @@ import type { ChannelRecipient, ChannelRecordBase, ChannelType } from "./Channel
export type PrivateChannelRecord = DMChannelRecord | GroupDMChannelRecord; export type PrivateChannelRecord = DMChannelRecord | GroupDMChannelRecord;
export abstract class PrivateChannelRecordBase extends ChannelRecordBase { export declare abstract class PrivateChannelRecordBase extends ChannelRecordBase {
/** @todo */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);
@ -68,7 +68,7 @@ export abstract class PrivateChannelRecordBase extends ChannelRecordBase {
voiceBackgroundDisplay?: undefined; voiceBackgroundDisplay?: undefined;
} }
export class DMChannelRecord extends PrivateChannelRecordBase { export declare class DMChannelRecord extends PrivateChannelRecordBase {
application_id: undefined; application_id: undefined;
icon: undefined; icon: undefined;
name: ""; name: "";
@ -76,7 +76,7 @@ export class DMChannelRecord extends PrivateChannelRecordBase {
type: ChannelType.DM; type: ChannelType.DM;
} }
export class GroupDMChannelRecord extends PrivateChannelRecordBase { export declare class GroupDMChannelRecord extends PrivateChannelRecordBase {
isMessageRequest: undefined; isMessageRequest: undefined;
isMessageRequestTimestamp: undefined; isMessageRequestTimestamp: undefined;
ownerId: PrivateChannelRecordBase["ownerId"]; ownerId: PrivateChannelRecordBase["ownerId"];

View file

@ -9,7 +9,7 @@ import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
type ThreadChannelType = ChannelType.ANNOUNCEMENT_THREAD | ChannelType.PUBLIC_THREAD | ChannelType.PRIVATE_THREAD; 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 */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);

View file

@ -7,7 +7,7 @@
import type { Defined, Nullish } from "../../internal"; import type { Defined, Nullish } from "../../internal";
import type { ChannelRecordBase, ChannelType } from "./ChannelRecord"; import type { ChannelRecordBase, ChannelType } from "./ChannelRecord";
export class UnknownChannelRecord extends ChannelRecordBase { export declare class UnknownChannelRecord extends ChannelRecordBase {
/** @todo */ /** @todo */
constructor(channelProperties: Record<string, any>); constructor(channelProperties: Record<string, any>);

View file

@ -9,7 +9,7 @@ import type { Nullish } from "../../internal";
export type Emoji = UnicodeEmoji | GuildEmoji; export type Emoji = UnicodeEmoji | GuildEmoji;
// Original name: Emoji // Original name: Emoji
export class UnicodeEmoji { export declare class UnicodeEmoji {
constructor(emojiObject: UnicodeEmojiObject | UnicodeEmojiObjectDiversityChild); constructor(emojiObject: UnicodeEmojiObject | UnicodeEmojiObjectDiversityChild);
get allNamesString(): string; get allNamesString(): string;
@ -72,7 +72,7 @@ export interface GuildEmoji {
} }
// Original name: EmojiTypes // Original name: EmojiTypes
export const enum EmojiType { export enum EmojiType {
UNICODE = 0, UNICODE = 0,
GUILD = 1, GUILD = 1,
} }

View file

@ -9,7 +9,7 @@ import type { CollectionChain } from "lodash";
import type { Defined, Nullish } from "../../internal"; import type { Defined, Nullish } from "../../internal";
import type { Emoji, EmojiType, GuildEmoji, UnicodeEmoji } from "./Emoji"; import type { Emoji, EmojiType, GuildEmoji, UnicodeEmoji } from "./Emoji";
export class EmojiDisambiguations { export declare class EmojiDisambiguations {
constructor(guildId: string | null); constructor(guildId: string | null);
static _lastInstance: EmojiDisambiguations | null; static _lastInstance: EmojiDisambiguations | null;

View file

@ -6,7 +6,7 @@
import type { GuildEmoji } from "./Emoji"; import type { GuildEmoji } from "./Emoji";
export class GuildEmojis { export declare class GuildEmojis {
constructor( constructor(
guildId: string, guildId: string,
userId: string, userId: string,

View file

@ -19,6 +19,7 @@ export * from "./GuildRecord";
export * from "./ImmutableRecord"; export * from "./ImmutableRecord";
export * from "./messages"; export * from "./messages";
export * from "./misc"; export * from "./misc";
export * from "./Permissions";
export * from "./ReadState"; export * from "./ReadState";
export * from "./Role"; export * from "./Role";
export * from "./UserProfile"; export * from "./UserProfile";

View file

@ -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 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); constructor(channelId: string);
static _channelMessages: { [channelId: string]: ChannelMessages; }; static _channelMessages: { [channelId: string]: ChannelMessages; };
@ -184,7 +184,7 @@ export class ChannelMessages {
} }
// Original name: JumpTypes // Original name: JumpTypes
export const enum JumpType { export enum JumpType {
ANIMATED = "ANIMATED", ANIMATED = "ANIMATED",
INSTANT = "INSTANT", INSTANT = "INSTANT",
} }

View file

@ -13,7 +13,7 @@ export type InteractionRecordOwnProperties = Pick<InteractionRecord, "displayNam
export type InteractionProperties = Omit<InteractionRecordOwnProperties, "displayName"> export type InteractionProperties = Omit<InteractionRecordOwnProperties, "displayName">
& { name_localized?: string | Nullish; }; & { name_localized?: string | Nullish; };
export class InteractionRecord< export declare class InteractionRecord<
OwnProperties extends InteractionRecordOwnProperties = InteractionRecordOwnProperties OwnProperties extends InteractionRecordOwnProperties = InteractionRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
constructor(interaction: InteractionProperties); constructor(interaction: InteractionProperties);
@ -33,7 +33,7 @@ export class InteractionRecord<
} }
// Original name: InteractionTypes // Original name: InteractionTypes
export const enum InteractionType { export enum InteractionType {
PING = 1, PING = 1,
APPLICATION_COMMAND = 2, APPLICATION_COMMAND = 2,
MESSAGE_COMPONENT = 3, MESSAGE_COMPONENT = 3,

View file

@ -6,7 +6,7 @@
import type { MessageRecord } from "./MessageRecord"; import type { MessageRecord } from "./MessageRecord";
export class MessageCache { export declare class MessageCache {
constructor(isCacheBefore: boolean); constructor(isCacheBefore: boolean);
cache(messages: MessageRecord[], wasAtEdge?: boolean | undefined /* = false */): void; cache(messages: MessageRecord[], wasAtEdge?: boolean | undefined /* = false */): void;

View file

@ -23,7 +23,7 @@ export type MessageProperties = Optional<MessageRecordOwnProperties, Nullish, "a
& SnakeCasedProperties<Optional<Pick<MessageRecordOwnProperties, "applicationId" | "activityInstance" | "giftInfo" | "stickerItems" | "changelogId">, Nullish>> & SnakeCasedProperties<Optional<Pick<MessageRecordOwnProperties, "applicationId" | "activityInstance" | "giftInfo" | "stickerItems" | "changelogId">, Nullish>>
& Partial<Pick<MessageRecordOwnProperties, "giftInfo">>; & Partial<Pick<MessageRecordOwnProperties, "giftInfo">>;
export class MessageRecord< export declare class MessageRecord<
OwnProperties extends MessageRecordOwnProperties = MessageRecordOwnProperties OwnProperties extends MessageRecordOwnProperties = MessageRecordOwnProperties
> extends MinimalMessageRecord<OwnProperties> { > extends MinimalMessageRecord<OwnProperties> {
constructor(messageProperties: MessageProperties); constructor(messageProperties: MessageProperties);
@ -95,8 +95,8 @@ export class MessageRecord<
referralTrialOfferId: string | null; referralTrialOfferId: string | null;
roleSubscriptionData: MessageRoleSubscriptionData | undefined; roleSubscriptionData: MessageRoleSubscriptionData | undefined;
state: MessageStates; state: MessageStates;
stickerItems: MessageStickerItem[]; stickerItems: StickerItem[];
stickers: MessageSticker[]; stickers: Sticker[];
tts: boolean; tts: boolean;
webhookId: string | null; webhookId: string | null;
} }
@ -107,7 +107,7 @@ export interface MessageActivity {
} }
// Original name: ActivityActionTypes // Original name: ActivityActionTypes
export const enum ActivityActionType { export enum ActivityActionType {
JOIN = 1, JOIN = 1,
SPECTATE = 2, SPECTATE = 2,
LISTEN = 3, LISTEN = 3,
@ -126,7 +126,7 @@ export interface CodedLink {
type: CodedLinkType; type: CodedLinkType;
} }
export const enum CodedLinkType { export enum CodedLinkType {
ACTIVITY_BOOKMARK = "ACTIVITY_BOOKMARK", ACTIVITY_BOOKMARK = "ACTIVITY_BOOKMARK",
APP_DIRECTORY_PROFILE = "APP_DIRECTORY_PROFILE", APP_DIRECTORY_PROFILE = "APP_DIRECTORY_PROFILE",
BUILD_OVERRIDE = "BUILD_OVERRIDE", BUILD_OVERRIDE = "BUILD_OVERRIDE",
@ -197,7 +197,7 @@ export interface MessagePollAnswer {
} }
// Original name: PollLayoutTypes // Original name: PollLayoutTypes
export const enum PollLayoutType { export enum PollLayoutType {
UNKNOWN = 0, UNKNOWN = 0,
DEFAULT = 1, DEFAULT = 1,
IMAGE_ONLY_ANSWERS = 2, IMAGE_ONLY_ANSWERS = 2,
@ -228,7 +228,7 @@ export interface MessagePurchaseNotification {
type: PurchaseNotificationType; type: PurchaseNotificationType;
} }
export const enum PurchaseNotificationType { export enum PurchaseNotificationType {
GUILD_PRODUCT = 0, GUILD_PRODUCT = 0,
} }
@ -280,7 +280,7 @@ export interface MessageVoteReactionCountDetails {
} }
// Original name: ReactionTypes // Original name: ReactionTypes
export const enum ReactionType { export enum ReactionType {
NORMAL = 0, NORMAL = 0,
BURST = 1, BURST = 1,
VOTE = 2, VOTE = 2,
@ -293,42 +293,51 @@ export interface MessageRoleSubscriptionData {
total_months_subscribed: number; total_months_subscribed: number;
} }
export const enum MessageStates { export enum MessageStates {
SEND_FAILED = "SEND_FAILED", SEND_FAILED = "SEND_FAILED",
SENDING = "SENDING", SENDING = "SENDING",
SENT = "SENT", SENT = "SENT",
} }
export interface MessageStickerItem { export interface StickerItem {
format_type: StickerFormat; format_type: StickerFormat;
id: string; id: string;
name: string; name: string;
} }
export const enum StickerFormat { export enum StickerFormat {
PNG = 1, PNG = 1,
APNG = 2, APNG = 2,
LOTTIE = 3, LOTTIE = 3,
GIF = 4, GIF = 4,
} }
export interface MessageSticker { export type Sticker = StandardSticker | GuildSticker;
export interface StickerBase {
asset?: ""; asset?: "";
available?: boolean;
description: string | null; description: string | null;
format_type: StickerFormat; format_type: StickerFormat;
guild_id?: string;
id: string; id: string;
name: string; name: string;
pack_id?: string;
sort_value?: number;
tags: string; tags: string;
type: MetaStickerType; 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, STANDARD = 1,
GUILD = 2, GUILD = 2,
} }

View file

@ -12,7 +12,7 @@ export type MessageSnapshotRecordOwnProperties = Pick<MessageSnapshotRecord, "gu
export type MessageSnapshotProperties = Pick<MessageSnapshotRecordOwnProperties, "guild"> export type MessageSnapshotProperties = Pick<MessageSnapshotRecordOwnProperties, "guild">
& { message: MinimalMessageProperties; }; & { message: MinimalMessageProperties; };
export class MessageSnapshotRecord< export declare class MessageSnapshotRecord<
OwnProperties extends MessageSnapshotRecordOwnProperties = MessageSnapshotRecordOwnProperties OwnProperties extends MessageSnapshotRecordOwnProperties = MessageSnapshotRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
constructor(messageSnapshotProperties: MessageSnapshotProperties); constructor(messageSnapshotProperties: MessageSnapshotProperties);

View file

@ -14,7 +14,7 @@ export type MinimalMessageRecordOwnProperties = Pick<MinimalMessageRecord, "atta
export type MinimalMessageProperties = Optional<MinimalMessageRecordOwnProperties, Nullish, "channel_id", true>; export type MinimalMessageProperties = Optional<MinimalMessageRecordOwnProperties, Nullish, "channel_id", true>;
export class MinimalMessageRecord< export declare class MinimalMessageRecord<
OwnProperties extends MinimalMessageRecordOwnProperties = MinimalMessageRecordOwnProperties OwnProperties extends MinimalMessageRecordOwnProperties = MinimalMessageRecordOwnProperties
> extends ImmutableRecord<OwnProperties> { > extends ImmutableRecord<OwnProperties> {
constructor(minimalMessageProperties: MinimalMessageProperties); constructor(minimalMessageProperties: MinimalMessageProperties);
@ -50,7 +50,7 @@ export interface MessageAttachment {
width?: number | null; width?: number | null;
} }
export const enum MessageAttachmentFlags { export enum MessageAttachmentFlags {
IS_CLIP = 1 << 0, IS_CLIP = 1 << 0,
IS_THUMBNAIL = 1 << 1, IS_THUMBNAIL = 1 << 1,
IS_REMIX = 1 << 2, IS_REMIX = 1 << 2,
@ -95,7 +95,7 @@ export interface MessageLinkButtonComponent extends MessageButtonComponentBase {
} }
// Original name: ButtonStyle // Original name: ButtonStyle
export const enum MessageButtonComponentStyle { export enum MessageButtonComponentStyle {
PRIMARY = 1, PRIMARY = 1,
SECONDARY = 2, SECONDARY = 2,
SUCCESS = 3, SUCCESS = 3,
@ -132,7 +132,7 @@ export interface MessageSelectComponentMenuOption<
} }
// Original name: SelectOptionType // Original name: SelectOptionType
export const enum MessageSelectComponentOptionType { export enum MessageSelectComponentOptionType {
STRING = 1, STRING = 1,
USER = 2, USER = 2,
ROLE = 3, ROLE = 3,
@ -176,7 +176,7 @@ export interface MessageSelectComponentDefaultValue<
} }
// Original name: SnowflakeSelectDefaultValueTypes // Original name: SnowflakeSelectDefaultValueTypes
export const enum MessageSelectComponentDefaultValueType { export enum MessageSelectComponentDefaultValueType {
CHANNEL = "channel", CHANNEL = "channel",
ROLE = "role", ROLE = "role",
USER = "user", USER = "user",
@ -196,7 +196,7 @@ export interface MessageTextInputComponent extends MessageComponentBase {
} }
// Original name: TextComponentStyle // Original name: TextComponentStyle
export const enum MessageTextInputComponentStyle { export enum MessageTextInputComponentStyle {
SMALL = 1, SMALL = 1,
PARAGRAPH = 2, PARAGRAPH = 2,
} }
@ -233,7 +233,7 @@ export interface MessageMediaGalleryComponentItem {
width: number; width: number;
} }
export const enum ContentScanFlags { export enum ContentScanFlags {
EXPLICIT = 1, EXPLICIT = 1,
} }
@ -243,7 +243,7 @@ export interface MessageSeparatorComponent extends MessageComponentBase {
type: MessageComponentType.SEPARATOR; type: MessageComponentType.SEPARATOR;
} }
export const enum SeparatorSpacingSize { export enum SeparatorSpacingSize {
SMALL = 1, SMALL = 1,
LARGE = 2, LARGE = 2,
} }
@ -266,7 +266,7 @@ export interface MessageComponentGuildEmoji {
// Original name: ComponentType // Original name: ComponentType
// Renamed to avoid name conflicts with ComponentType from React. // Renamed to avoid name conflicts with ComponentType from React.
export const enum MessageComponentType { export enum MessageComponentType {
ACTION_ROW = 1, ACTION_ROW = 1,
BUTTON = 2, BUTTON = 2,
STRING_SELECT = 3, STRING_SELECT = 3,
@ -317,7 +317,7 @@ export interface MessageEmbedField {
rawValue: string; rawValue: string;
} }
export const enum MessageEmbedFlags { export enum MessageEmbedFlags {
CONTAINS_EXPLICIT_MEDIA = 1 << 4, CONTAINS_EXPLICIT_MEDIA = 1 << 4,
} }
@ -356,7 +356,7 @@ export type MessageEmbedThumbnail = {
}); });
// Original name: MessageEmbedTypes // Original name: MessageEmbedTypes
export const enum MessageEmbedType { export enum MessageEmbedType {
APPLICATION_NEWS = "application_news", APPLICATION_NEWS = "application_news",
ARTICLE = "article", ARTICLE = "article",
AUTO_MODERATION_MESSAGE = "auto_moderation_message", AUTO_MODERATION_MESSAGE = "auto_moderation_message",
@ -392,7 +392,7 @@ export type MessageEmbedVideo = {
url: string; url: string;
}); });
export const enum MessageFlags { export enum MessageFlags {
CROSSPOSTED = 1 << 0, CROSSPOSTED = 1 << 0,
IS_CROSSPOST = 1 << 1, IS_CROSSPOST = 1 << 1,
SUPPRESS_EMBEDS = 1 << 2, SUPPRESS_EMBEDS = 1 << 2,
@ -402,6 +402,7 @@ export const enum MessageFlags {
EPHEMERAL = 1 << 6, EPHEMERAL = 1 << 6,
LOADING = 1 << 7, LOADING = 1 << 7,
FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8, FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8,
GUILD_FEED_HIDDEN = 1 << 9,
SHOULD_SHOW_LINK_NOT_DISCORD_WARNING = 1 << 10, SHOULD_SHOW_LINK_NOT_DISCORD_WARNING = 1 << 10,
SUPPRESS_NOTIFICATIONS = 1 << 12, SUPPRESS_NOTIFICATIONS = 1 << 12,
IS_VOICE_MESSAGE = 1 << 13, IS_VOICE_MESSAGE = 1 << 13,
@ -410,7 +411,7 @@ export const enum MessageFlags {
} }
// Original name: MessageTypes // Original name: MessageTypes
export const enum MessageType { export enum MessageType {
DEFAULT = 0, DEFAULT = 0,
RECIPIENT_ADD = 1, RECIPIENT_ADD = 1,
RECIPIENT_REMOVE = 2, RECIPIENT_REMOVE = 2,
@ -458,4 +459,5 @@ export const enum MessageType {
VOICE_HANGOUT_INVITE = 45, VOICE_HANGOUT_INVITE = 45,
POLL_RESULT = 46, POLL_RESULT = 46,
CHANGELOG = 47, CHANGELOG = 47,
NITRO_NOTIFICATION = 48,
} }

View file

@ -4,6 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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 */ /** @internal */
export type Defined<T> = Exclude<T, undefined>; export type Defined<T> = Exclude<T, undefined>;

View file

@ -9,9 +9,9 @@ import type { ApplicationRecord, ApplicationType } from "../general/ApplicationR
import type { Nullish } from "../internal"; import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore"; 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"; static displayName: "ApplicationStore";
_getAllApplications(): ApplicationRecord[]; _getAllApplications(): ApplicationRecord[];

View file

@ -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 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"; static displayName: "ChannelStore";
getAllThreadsForParent(channelId: string): ThreadChannelRecord[]; getAllThreadsForParent(channelId: string): ThreadChannelRecord[];

View file

@ -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 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, Constructor extends GenericConstructor = typeof DraftStore,
State extends DraftStoreState = DraftStoreState, State extends DraftStoreState = DraftStoreState,
Action extends FluxAction = DraftStoreAction Action extends FluxAction = DraftStoreAction

View file

@ -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 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, Constructor extends GenericConstructor = typeof EmojiStore,
State extends EmojiStoreState = EmojiStoreState, State extends EmojiStoreState = EmojiStoreState,
Action extends FluxAction = EmojiStoreAction Action extends FluxAction = EmojiStoreAction
@ -34,7 +34,7 @@ export class EmojiStore<
get diversitySurrogate(): string; get diversitySurrogate(): string;
get emojiFrecencyWithoutFetchingLatest(): Frecency<string, Emoji>; get emojiFrecencyWithoutFetchingLatest(): Frecency<string, Emoji>;
getCustomEmojiById(emojiId: string): GuildEmoji | undefined; getCustomEmojiById(emojiId: string): GuildEmoji | undefined;
getDisambiguatedEmojiContext(guildId?: string | Nullish): EmojiDisambiguations | undefined; getDisambiguatedEmojiContext(guildId?: string | Nullish): EmojiDisambiguations;
getEmojiAutosuggestion(channel?: ChannelRecord): Emoji[]; getEmojiAutosuggestion(channel?: ChannelRecord): Emoji[];
getGuildEmoji(guildId: string): GuildEmoji[]; getGuildEmoji(guildId: string): GuildEmoji[];
getGuilds(): { [guildId: string]: GuildEmojis; }; getGuilds(): { [guildId: string]: GuildEmojis; };
@ -70,7 +70,7 @@ export interface GuildTopEmojisMetadata {
topEmojisTTL: number; topEmojisTTL: number;
} }
export const enum EmojiIntention { export enum EmojiIntention {
REACTION = 0, REACTION = 0,
STATUS = 1, STATUS = 1,
COMMUNITY_CONTENT = 2, COMMUNITY_CONTENT = 2,

View file

@ -5,7 +5,7 @@
*/ */
import type { ExtractAction, FluxAction } from "../flux/fluxActions"; 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 { GuildCategoryChannelRecord } from "../general/channels/GuildTextualChannelRecord";
import type { GuildVocalChannelRecord } from "../general/channels/GuildVocalChannelRecord"; import type { GuildVocalChannelRecord } from "../general/channels/GuildVocalChannelRecord";
import type { Nullish } from "../internal"; 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 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"; static displayName: "GuildChannelStore";
getAllGuilds(): { [guildId: string]: GuildChannels | undefined; }; getAllGuilds(): { [guildId: string]: GuildChannels | undefined; };
@ -22,33 +22,33 @@ export class GuildChannelStore<Action extends FluxAction = GuildChannelStoreActi
guild: string, guild: string,
searchVocal?: SearchVocal /* = false */, searchVocal?: SearchVocal /* = false */,
permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */ permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */
): GuildChannelFromSearchVocal<SearchVocal>; ): ChannelFromSearchVocal<SearchVocal> | null;
getDirectoryChannelIds(guildId: string): string[]; getDirectoryChannelIds(guildId: string): string[];
getFirstChannel<SearchVocal extends boolean | undefined = undefined>( getFirstChannel<SearchVocal extends boolean | undefined = undefined>(
guildId: string, guildId: string,
predicate: ( predicate: (
value: GuildChannelFromSearchVocal<SearchVocal>, value: ChannelFromSearchVocal<SearchVocal>,
index: number, index: number,
array: GuildChannelFromSearchVocal<SearchVocal>[] array: ChannelFromSearchVocal<SearchVocal>[]
) => unknown, ) => unknown,
searchVocal?: SearchVocal /* = false */ searchVocal?: SearchVocal /* = false */
): GuildChannelFromSearchVocal<SearchVocal> | null; ): ChannelFromSearchVocal<SearchVocal> | null;
getFirstChannelOfType<Type extends GuildChannelType>( getFirstChannelOfType<Type extends GuildChannelType>(
guildId: string, guildId: string,
predicate: ( predicate: (
value: GuildChannelFromType<Type>, value: ChannelFromGuildChannelType<Type>,
index: number, index: number,
array: GuildChannelFromType<Type>[] array: ChannelFromGuildChannelType<Type>[]
) => unknown, ) => unknown,
type: Type type: Type
): GuildChannelFromType<Type> | null; ): ChannelFromGuildChannelType<Type> | null;
getSelectableChannelIds(guildId: string): string[]; getSelectableChannelIds(guildId: string): string[];
getSelectableChannels(guildId: string): GuildChannel<GuildSelectableChannelRecord>[]; getSelectableChannels(guildId: string): GuildChannel<GuildSelectableChannelRecord>[];
getSFWDefaultChannel<SearchVocal extends boolean | undefined = undefined>( getSFWDefaultChannel<SearchVocal extends boolean | undefined = undefined>(
guild: string, guild: string,
searchVocal?: SearchVocal /* = false */, searchVocal?: SearchVocal /* = false */,
permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */ permissions?: /* Permissions */ bigint | undefined /* = Permissions.VIEW_CHANNEL */
): GuildChannelFromSearchVocal<SearchVocal>; ): ChannelFromSearchVocal<SearchVocal> | null;
getTextChannelNameDisambiguations(guildId?: string | Nullish): { getTextChannelNameDisambiguations(guildId?: string | Nullish): {
[channelId: string]: { id: string; name: string; }; [channelId: string]: { id: string; name: string; };
}; };
@ -70,7 +70,7 @@ export interface GuildChannels {
} }
// Does not actually exist. // Does not actually exist.
export const enum GuildChannelType { export enum GuildChannelType {
CATEGORY = ChannelType.GUILD_CATEGORY, CATEGORY = ChannelType.GUILD_CATEGORY,
SELECTABLE = "SELECTABLE", SELECTABLE = "SELECTABLE",
VOCAL = "VOCAL", VOCAL = "VOCAL",
@ -81,10 +81,13 @@ export interface GuildChannel<Channel extends GuildChannelRecord = GuildChannelR
comparator: number; comparator: number;
} }
type GuildChannelFromSearchVocal<SearchVocal extends boolean | undefined> type ChannelFromSearchVocal<SearchVocal extends boolean | undefined>
= GuildChannel<GuildSelectableChannelRecord> | (SearchVocal extends true = GuildSelectableChannelRecord | (SearchVocal extends true
? GuildChannel<GuildVocalChannelRecord> ? GuildVocalChannelRecord
: never); : never);
type GuildChannelFromType<Type extends GuildChannelType> type ChannelFromGuildChannelType<Type extends GuildChannelType> = {
= GuildChannels[Type] extends (infer Channel)[] ? Channel : never; [GuildChannelType.CATEGORY]: GuildCategoryChannelRecord;
[GuildChannelType.SELECTABLE]: GuildSelectableChannelRecord;
[GuildChannelType.VOCAL]: GuildVocalChannelRecord;
}[Type];

View file

@ -9,9 +9,9 @@ import type { GuildMember } from "../general/GuildMember";
import type { Nullish } from "../internal"; import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore"; 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"; static displayName: "GuildMemberStore";
getCommunicationDisabledUserMap(): { [userId: string]: string; }; getCommunicationDisabledUserMap(): { [userId: string]: string; };

View file

@ -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 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"; static displayName: "GuildStore";
getAllGuildsRoles(): { [guildId: string]: { [roleId: string]: Role; }; }; getAllGuildsRoles(): { [guildId: string]: { [roleId: string]: Role; }; };

View file

@ -10,9 +10,9 @@ import type { MessageRecord } from "../general/messages/MessageRecord";
import type { Nullish } from "../internal"; import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore"; 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"; static displayName: "MessageStore";
focusedMessageId(channelId: string): string | undefined; focusedMessageId(channelId: string): string | undefined;

View file

@ -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 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"; static displayName: "PermissionStore";
/** Always returns false for private (non-guild) channels. */
can( can(
permissions: /* Permissions */ bigint, permissions: /* Permissions */ bigint,
context?: GuildRecord | ChannelRecord | Nullish, context?: GuildRecord | ChannelRecord | Nullish,

View file

@ -9,9 +9,9 @@ import type { Activity } from "../general/Activity";
import type { Nullish } from "../internal"; import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore"; 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"; static displayName: "PresenceStore";
findActivity<T extends Activity>( findActivity<T extends Activity>(
@ -68,15 +68,16 @@ export class PresenceStore<Action extends FluxAction = PresenceStoreAction> exte
export type ClientStatusMap = Partial<Record<ClientType, StatusType>>; export type ClientStatusMap = Partial<Record<ClientType, StatusType>>;
// Original name: ClientTypes // Original name: ClientTypes
export const enum ClientType { export enum ClientType {
DESKTOP = "desktop", DESKTOP = "desktop",
EMBEDDED = "embedded", // Undocumented
MOBILE = "mobile", MOBILE = "mobile",
UNKNOWN = "unknown", UNKNOWN = "unknown",
WEB = "web", WEB = "web",
} }
// Original name: StatusTypes // Original name: StatusTypes
export const enum StatusType { export enum StatusType {
DND = "dnd", DND = "dnd",
IDLE = "idle", IDLE = "idle",
INVISIBLE = "invisible", INVISIBLE = "invisible",

View file

@ -12,9 +12,9 @@ import type { Nullish } from "../internal";
import type { FluxStore } from "./abstract/FluxStore"; import type { FluxStore } from "./abstract/FluxStore";
import type { BasicPermissionsObject } from "./PermissionStore"; 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"; static displayName: "ReadStateStore";
ackMessageId(id: string, type?: ReadStateType | undefined /* = ReadStateType.CHANNEL */): string | null; ackMessageId(id: string, type?: ReadStateType | undefined /* = ReadStateType.CHANNEL */): string | null;

View file

@ -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 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"; static displayName: "RelationshipStore";
getFriendCount(): number; getFriendCount(): number;
/** @todo May eventually be renamed to `getFriendIds`. */
getFriendIDs(): string[]; getFriendIDs(): string[];
getNickname(userId: string): string | undefined; getNickname(userId: string): string | undefined;
getOutgoingCount(): number; getOutgoingCount(): number;
@ -28,7 +29,7 @@ export class RelationshipStore<Action extends FluxAction = RelationshipStoreActi
} }
// Original name: RelationshipTypes // Original name: RelationshipTypes
export const enum RelationshipType { export enum RelationshipType {
NONE = 0, NONE = 0,
FRIEND = 1, FRIEND = 1,
BLOCKED = 2, BLOCKED = 2,

View file

@ -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 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"; static displayName: "SelectedChannelStore";
getChannelId(guildId?: string | Nullish): string | undefined; getChannelId(guildId?: string | Nullish): string | undefined;

View file

@ -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 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, Constructor extends GenericConstructor = typeof SelectedGuildStore,
State extends SelectedGuildStoreState = SelectedGuildStoreState, State extends SelectedGuildStoreState = SelectedGuildStoreState,
Action extends FluxAction = SelectedGuildStoreAction Action extends FluxAction = SelectedGuildStoreAction

View file

@ -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 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 Constructor extends GenericConstructor = typeof UserProfileStore
> extends FluxSnapshotStore<Constructor, UserProfileStoreSnapshotData, UserProfileStoreAction> { > extends FluxSnapshotStore<Constructor, UserProfileStoreSnapshotData, UserProfileStoreAction> {
constructor(); constructor();

View file

@ -13,9 +13,9 @@ export interface UserStoreSnapshotData {
users: [UserRecord] | []; 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 Constructor extends GenericConstructor = typeof UserStore
> extends FluxSnapshotStore<Constructor, UserStoreSnapshotData, UserStoreAction> { > extends FluxSnapshotStore<Constructor, UserStoreSnapshotData, UserStoreAction> {
constructor(); constructor();

View file

@ -4,12 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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"; 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 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"; static displayName: "WindowStore";
getFocusedWindowId(): string | null; getFocusedWindowId(): string | null;

View file

@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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 { FluxAction } from "../../flux/fluxActions";
import type { FluxDispatcher } from "../../flux/FluxDispatcher"; import type { FluxDispatcher } from "../../flux/FluxDispatcher";
import type { GenericConstructor, Nullish } from "../../internal"; import type { GenericConstructor, Nullish } from "../../internal";
import type { FluxStore } from "./FluxStore"; import type { FluxStore } from "./FluxStore";
// Original name: PersistedStore // Original name: PersistedStore
export abstract class FluxPersistedStore< export declare abstract class FluxPersistedStore<
Constructor extends GenericConstructor = GenericConstructor, Constructor extends GenericConstructor = GenericConstructor,
State = unknown, State = unknown,
Action extends FluxAction = FluxAction Action extends FluxAction = FluxAction

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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 { ExcludeAction, ExtractAction, FluxAction } from "../../flux/fluxActions";
import type { GenericConstructor } from "../../internal"; import type { GenericConstructor } from "../../internal";
import type { FluxStore } from "./FluxStore"; import type { FluxStore } from "./FluxStore";
@ -19,7 +19,7 @@ type CacheActionType = "CLEAR_CACHES" | "WRITE_CACHES";
export type FluxSnapshotStoreAction = ExcludeAction<FluxAction, CacheActionType>; export type FluxSnapshotStoreAction = ExcludeAction<FluxAction, CacheActionType>;
// Original name: SnapshotStore // Original name: SnapshotStore
export abstract class FluxSnapshotStore< export declare abstract class FluxSnapshotStore<
Constructor extends GenericConstructor = GenericConstructor, Constructor extends GenericConstructor = GenericConstructor,
SnapshotData = unknown, SnapshotData = unknown,
Action extends FluxSnapshotStoreAction = FluxSnapshotStoreAction Action extends FluxSnapshotStoreAction = FluxSnapshotStoreAction

View file

@ -4,17 +4,17 @@
* SPDX-License-Identifier: GPL-3.0-or-later * 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 { FluxAction } from "../../flux/fluxActions";
import type { FluxDispatchBand, FluxDispatcher } from "../../flux/FluxDispatcher"; import type { FluxDispatchBand, FluxDispatcher } from "../../flux/FluxDispatcher";
import type { Nullish } from "../../internal"; import type { Bivariant, Nullish } from "../../internal";
// Original name: Store // Original name: Store
export abstract class FluxStore<Action extends FluxAction = FluxAction> { export declare abstract class FluxStore<Action extends FluxAction = FluxAction> {
constructor( constructor(
dispatcher: FluxDispatcher, dispatcher: FluxDispatcher,
actionHandlers: FluxActionHandlerMap<Action>, actionHandlers?: FluxActionHandlerMap<Action> | Nullish,
dispatchBand?: FluxDispatchBand | Nullish dispatchBand?: FluxDispatchBand | Nullish /* = dispatcher._defaultBand */
); );
static destroy(): void; static destroy(): void;
@ -34,7 +34,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
): void; ): void;
registerActionHandlers( registerActionHandlers(
actionHandlers: FluxActionHandlerMap<Action>, actionHandlers: FluxActionHandlerMap<Action>,
dispatchBand?: FluxDispatchBand | Nullish dispatchBand?: FluxDispatchBand | Nullish /* = this._dispatcher._defaultBand */
): void; ): void;
syncWith( syncWith(
stores: FluxStore[], stores: FluxStore[],
@ -48,7 +48,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
_dispatcher: FluxDispatcher; _dispatcher: FluxDispatcher;
_dispatchToken: string; _dispatchToken: string;
_isInitialized: boolean; _isInitialized: boolean;
_mustEmitChanges: ((action: Action) => boolean) | Nullish; _mustEmitChanges: Bivariant<((action: Action) => boolean)> | Nullish;
_reactChangeCallbacks: FluxChangeListeners; _reactChangeCallbacks: FluxChangeListeners;
_syncWiths: { _syncWiths: {
func: FluxSyncWithFunction; func: FluxSyncWithFunction;
@ -64,7 +64,7 @@ export abstract class FluxStore<Action extends FluxAction = FluxAction> {
export type FluxSyncWithFunction = () => boolean | undefined; export type FluxSyncWithFunction = () => boolean | undefined;
// Original name: ChangeListeners // Original name: ChangeListeners
export class FluxChangeListeners { export declare class FluxChangeListeners {
has(listener: FluxChangeListener): boolean; has(listener: FluxChangeListener): boolean;
hasAny(): boolean; hasAny(): boolean;
invokeAll(): void; invokeAll(): void;

View file

@ -11,6 +11,8 @@
"noEmit": true, "noEmit": true,
"isolatedModules": true,
"lib": [ "lib": [
"ES2019", "ES2019",
"ES2020.BigInt", "ES2020.BigInt",

View file

@ -16,18 +16,18 @@
"sideEffects": false, "sideEffects": false,
"types": "./index.d.ts", "types": "./index.d.ts",
"dependencies": { "dependencies": {
"@types/lodash": "~4.17.4", "@types/lodash": "~4.17.5",
"@types/node": "^18.19.34", "@types/node": "^18.19.34",
"@types/react": "~18.2.79", "@types/react": "~18.2.79",
"@types/react-dom": "~18.2.25", "@types/react-dom": "~18.2.25",
"@vencord/discord-types": "workspace:^", "@vencord/discord-types": "workspace:^",
"discord-types": "^1.3.26", "discord-types": "^1.3.3",
"standalone-electron-types": "^1.0.0", "standalone-electron-types": "^1.0.0",
"type-fest": "^4.20.0" "type-fest": "^4.20.0"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"tsx": "^4.13.3" "tsx": "^4.15.4"
} }
} }

File diff suppressed because it is too large Load diff