/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see .
*/
import type {ChannelID, MessageID, UserID} from '~/BrandedTypes';
import type {Channel} from '~/Models';
export interface PrivateChannelSummary {
channelId: ChannelID;
isGroupDm: boolean;
channelType: number | null;
lastMessageId: MessageID | null;
open: boolean;
}
export interface IUserChannelRepository {
listPrivateChannels(userId: UserID): Promise>;
deleteAllPrivateChannels(userId: UserID): Promise;
listPrivateChannelSummaries(userId: UserID): Promise>;
listHistoricalDmChannelIds(userId: UserID): Promise>;
recordHistoricalDmChannel(userId: UserID, channelId: ChannelID, isGroupDm: boolean): Promise;
findExistingDmState(user1Id: UserID, user2Id: UserID): Promise;
createDmChannelAndState(user1Id: UserID, user2Id: UserID, channelId: ChannelID): Promise;
isDmChannelOpen(userId: UserID, channelId: ChannelID): Promise;
openDmForUser(userId: UserID, channelId: ChannelID, isGroupDm?: boolean): Promise;
closeDmForUser(userId: UserID, channelId: ChannelID): Promise;
getPinnedDms(userId: UserID): Promise>;
getPinnedDmsWithDetails(userId: UserID): Promise>;
addPinnedDm(userId: UserID, channelId: ChannelID): Promise>;
removePinnedDm(userId: UserID, channelId: ChannelID): Promise>;
deletePinnedDmsByUserId(userId: UserID): Promise;
deleteAllReadStates(userId: UserID): Promise;
}