Split sort event

The sort event bundled networks and channels for no reason at all.
They share none of the actual logic, so combining them just makes
the typing poor but serves no benefit.
This commit is contained in:
Reto Brunner 2024-03-24 16:39:26 +01:00
commit 0067c30273
5 changed files with 72 additions and 84 deletions

View file

@ -1,5 +1,5 @@
import {SharedMention} from "./mention";
import {ChanState, InitClientChan} from "./chan";
import {ChanState, InitClientChan, SharedChan} from "./chan";
import {SharedNetwork} from "./network";
import {SharedMsg, ClientMessage, LinkPreview} from "./msg";
import {SharedUser} from "./user";
@ -67,10 +67,11 @@ interface ServerToClientEvents {
"sign-out": NoPayloadEventHandler;
sync_sort: EventHandler<
| {type: "networks"; order: string[]; target: string}
| {type: "channels"; order: number[]; target: string}
>;
"sync_sort:networks": EventHandler<{order: SharedNetwork["uuid"][]}>;
"sync_sort:channels": EventHandler<{
network: SharedNetwork["uuid"];
order: SharedChan["id"][];
}>;
topic: EventHandler<{chan: number; topic: string}>;
@ -134,7 +135,11 @@ interface ClientToServerEvents {
"sessions:get": NoPayloadEventHandler;
sort: EventHandler<{type: string; order: any; target?: string}>;
"sort:networks": EventHandler<{order: SharedNetwork["uuid"][]}>;
"sort:channels": EventHandler<{
network: SharedNetwork["uuid"];
order: SharedChan["id"][];
}>;
"mentions:dismiss": (msgId: number) => void;
"mentions:dismiss_all": NoPayloadEventHandler;