ChannelAffinitiesStore
This commit is contained in:
parent
6eb61b0482
commit
3d4b9d5099
3 changed files with 24 additions and 0 deletions
21
packages/discord-types/src/stores/ChannelAffinitiesStore.d.ts
vendored
Normal file
21
packages/discord-types/src/stores/ChannelAffinitiesStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface ChannelAffinity {
|
||||
channelId: string;
|
||||
score: number;
|
||||
}
|
||||
|
||||
export interface ChannelAffinitiesState {
|
||||
channelAffinities: ChannelAffinity[];
|
||||
lastFetched: number;
|
||||
}
|
||||
|
||||
export class ChannelAffinitiesStore extends FluxStore {
|
||||
compare(firstChannelId: string, secondChannelId: string): number;
|
||||
getChannelAffinities(): ChannelAffinity[];
|
||||
getChannelAffinitiesMap(): Map<string, ChannelAffinity>;
|
||||
getChannelAffinity(channelId: string): ChannelAffinity | undefined;
|
||||
getState(): ChannelAffinitiesState;
|
||||
isFetching(): boolean;
|
||||
shouldFetch(): boolean | undefined;
|
||||
}
|
||||
1
packages/discord-types/src/stores/index.d.ts
vendored
1
packages/discord-types/src/stores/index.d.ts
vendored
|
|
@ -11,6 +11,7 @@ export * from "./AuthorizedAppsStore";
|
|||
export * from "./AuthSessionsStore";
|
||||
export * from "./BasicGuildStore";
|
||||
export * from "./CallStore";
|
||||
export * from "./ChannelAffinitiesStore";
|
||||
export * from "./ChannelMemberStore";
|
||||
export * from "./ChannelRTCStore";
|
||||
export * from "./ChannelSectionStore";
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ export let GuildAvailabilityStore: t.GuildAvailabilityStore;
|
|||
export let UserGuildJoinRequestStore: t.UserGuildJoinRequestStore;
|
||||
export let BasicGuildStore: t.BasicGuildStore;
|
||||
export let GuildProfileStore: t.GuildProfileStore;
|
||||
export let ChannelAffinitiesStore: t.ChannelAffinitiesStore;
|
||||
|
||||
/**
|
||||
* @see jsdoc of {@link t.useStateFromStores}
|
||||
|
|
@ -189,6 +190,7 @@ waitForStore("GuildAvailabilityStore", m => GuildAvailabilityStore = m);
|
|||
waitForStore("UserGuildJoinRequestStore", m => UserGuildJoinRequestStore = m);
|
||||
waitForStore("BasicGuildStore", m => BasicGuildStore = m);
|
||||
waitForStore("GuildProfileStore", m => GuildProfileStore = m);
|
||||
waitForStore("ChannelAffinitiesV2Store", m => ChannelAffinitiesStore = m);
|
||||
waitForStore("ThemeStore", m => {
|
||||
ThemeStore = m;
|
||||
// Importing this directly causes all webpack commons to be imported, which can easily cause circular dependencies.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue