From 3d8be71f34cdf338c10363c39e31ca9c1360aa02 Mon Sep 17 00:00:00 2001 From: Federico Di Leo <38290480+FedeIlLeone@users.noreply.github.com> Date: Wed, 5 Jul 2023 23:06:09 +0200 Subject: [PATCH] fix: lock file version (#506) * fix: lock file version * feat(types): update to build 210578 * feat(types): update parser * fix: cspell * feat(types): update messages module --- cspell.json | 1 + pnpm-lock.yaml | 2 +- src/renderer/modules/common/constants.ts | 1 + src/renderer/modules/common/flux.ts | 6 +++--- src/renderer/modules/common/messages.ts | 7 ++++--- src/renderer/modules/common/parser.ts | 14 ++++++++++++++ src/renderer/modules/common/users.ts | 1 + src/renderer/modules/components/Text.tsx | 4 ++++ 8 files changed, 29 insertions(+), 7 deletions(-) diff --git a/cspell.json b/cspell.json index 91742a07b..d07002b60 100644 --- a/cspell.json +++ b/cspell.json @@ -37,6 +37,7 @@ "LOCALAPPDATA", "logname", "Millis", + "notif", "notrack", "outfile", "popout", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3513edc6f..91daa10c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true diff --git a/src/renderer/modules/common/constants.ts b/src/renderer/modules/common/constants.ts index b7511c241..cbb28e3aa 100644 --- a/src/renderer/modules/common/constants.ts +++ b/src/renderer/modules/common/constants.ts @@ -56,6 +56,7 @@ export const UserFlags = getExportsForProps>(Constants, [ "SPAMMER", ])!; +// ThemeColor export const CSSVariables = await waitForProps>( "TEXT_NORMAL", "BACKGROUND_PRIMARY", diff --git a/src/renderer/modules/common/flux.ts b/src/renderer/modules/common/flux.ts index 984a3861d..0df23b114 100644 --- a/src/renderer/modules/common/flux.ts +++ b/src/renderer/modules/common/flux.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { FluxDispatcher as Dispatcher } from "./fluxDispatcher"; +import type { Band, FluxDispatcher as Dispatcher } from "./fluxDispatcher"; import { waitForProps } from "../webpack"; type DispatchToken = string; @@ -55,7 +55,7 @@ declare class Callbacks { } export declare class Store { - public constructor(dispatcher: Dispatcher, actions?: ActionHandlerRecord, band?: number); + public constructor(dispatcher: Dispatcher, actions?: ActionHandlerRecord, band?: Band); public static destroy(): void; public static getAll(): Store[]; @@ -85,7 +85,7 @@ export declare class Store { public removeChangeListener(listener: Callback): void; public removeReactChangeListener(listener: Callback): void; - public registerActionHandlers(actions: ActionHandlerRecord, band?: number): void; + public registerActionHandlers(actions: ActionHandlerRecord, band?: Band): void; // eslint-disable-next-line @typescript-eslint/naming-convention public __getLocalVars?(): Record; diff --git a/src/renderer/modules/common/messages.ts b/src/renderer/modules/common/messages.ts index ae9a44482..4bb761c68 100644 --- a/src/renderer/modules/common/messages.ts +++ b/src/renderer/modules/common/messages.ts @@ -32,7 +32,7 @@ interface InviteSuggestion { isFiltered: boolean; } -interface FetchMessageOptions { +interface FetchMessagesOptions { channelId: string; /** Snowflake */ before?: string; @@ -53,7 +53,7 @@ interface FetchMessageOptions { truncate?: boolean; } -type FetchMessagesCachedOptions = Omit; +type FetchMessagesCachedOptions = Omit; interface FocusMessageOptions { channelId: string; @@ -354,7 +354,8 @@ export interface MessageActions { limit: number, localFetchComplete: LocalFetchComplete, ) => Promise; - fetchMessages: (options: FetchMessageOptions) => Promise; + fetchMessages: (options: FetchMessagesOptions) => Promise; + fetchNewLocalMessages: (channelId: string, limit: number) => Promise; focusMessage: (options: FocusMessageOptions) => void; getSendMessageOptionsForReply: ( options: SendMessageForReplyOptions, diff --git a/src/renderer/modules/common/parser.ts b/src/renderer/modules/common/parser.ts index 07bf451ec..37772c45e 100644 --- a/src/renderer/modules/common/parser.ts +++ b/src/renderer/modules/common/parser.ts @@ -65,6 +65,20 @@ type ParseFn = ( export interface Parser { defaultRules: DefaultRules; guildEventRules: Omit; + notifCenterV2MessagePreviewRules: Omit< + DefaultRules, + | "paragraph" + | "newline" + | "strong" + | "codeBlock" + | "inlineCode" + | "u" + | "link" + | "url" + | "autolink" + | "list" + | "heading" + >; parse: ParseFn; parseAutoModerationSystemMessage: ParseFn; parseAutoModerationSystemMessageToAST: ParseFn; diff --git a/src/renderer/modules/common/users.ts b/src/renderer/modules/common/users.ts index d1261a66f..7335369dc 100644 --- a/src/renderer/modules/common/users.ts +++ b/src/renderer/modules/common/users.ts @@ -24,6 +24,7 @@ export interface GuildMemberStore { getMemberIds: (guildId?: string) => string[]; getMemberRoleWithPendingUpdates: (guildId: string, userId: string) => string[]; getMembers: (guildId?: string) => GuildMember[]; + getMemberVersion: () => number; getMutableAllGuildsAndMembers: () => Record>; getNick: (guildId?: string, userId?: string) => string | null; getNicknameGuildsMapping: (userId: string) => Record; diff --git a/src/renderer/modules/components/Text.tsx b/src/renderer/modules/components/Text.tsx index 1fd61aadc..be89ddb98 100644 --- a/src/renderer/modules/components/Text.tsx +++ b/src/renderer/modules/components/Text.tsx @@ -56,6 +56,10 @@ export type Variant = | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" + | "redesign/message-preview/normal" + | "redesign/message-preview/medium" + | "redesign/message-preview/semibold" + | "redesign/message-preview/bold" | "display-sm" | "display-md" | "display-lg"