@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
41 lines (40 loc) • 4.47 kB
TypeScript
import { GuidValue, IPersistedPost, IPostBaseContext, IPostBaseWithContext, ReactionType, ResolvedUserIdentity } from "../models";
import { PostService } from "../services/PostService";
import { Store } from "./Store";
import { UserIdentityStore } from "./UserIdentityStore";
export declare class PostStore<TPostType extends IPostBaseWithContext<TContextType>, TContextType extends IPostBaseContext> extends Store {
postService: PostService<TContextType>;
userIdentityStore: UserIdentityStore;
constructor();
posts: import("./Store").StoreState<{
[topicId: string]: IPersistedPost<TPostType>[];
}>;
userHash: {
[principalName: string]: ResolvedUserIdentity;
};
topPostsIds: {
[postId: string]: string;
};
topPostLastActivity: {
[topPostId: string]: string;
};
getters: {
topPosts: (topicId: string) => IPersistedPost<TPostType>[];
replies: (topicId: string, id: string) => IPersistedPost<TPostType>[];
post: (topicId: string, id: string) => IPersistedPost<TPostType>;
posts: (topicIds: Array<string>) => IPersistedPost<IPostBaseWithContext<TContextType>>[];
};
mutations: {};
actions: {
toggleLike: import("./Store").StoreAction<unknown, (persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (result: IPersistedPost<IPostBaseWithContext<TContextType>>, persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (failureReason: any, persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => Promise<IPersistedPost<IPostBaseWithContext<TContextType>>>>;
socialReacts: import("./Store").StoreAction<unknown, (postToReact: IPersistedPost<TPostType>, isReacts: boolean, reactionType: ReactionType) => void, (result: IPersistedPost<IPostBaseWithContext<TContextType>>, postToReact: IPersistedPost<TPostType>, isReacts: boolean, reactionType: ReactionType) => void, (failureReason: any, postToReact: IPersistedPost<TPostType>, isReacts: boolean, reactionType: ReactionType) => void, (postToReact: IPersistedPost<TPostType>, isReacts: boolean, reactionType: ReactionType) => Promise<IPersistedPost<IPostBaseWithContext<TContextType>>>>;
createPost: import("./Store").StoreAction<unknown, (post: TPostType, currentUser: ResolvedUserIdentity) => void, (result: IPersistedPost<TPostType>, post: TPostType, currentUser: ResolvedUserIdentity) => void, (failureReason: any, post: TPostType, currentUser: ResolvedUserIdentity) => void, (post: TPostType, currentUser: ResolvedUserIdentity) => Promise<IPersistedPost<TPostType>>>;
deletePost: import("./Store").StoreAction<unknown, (persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (result: IPersistedPost<TPostType>, persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (failureReason: any, persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => void, (persistedPost: IPersistedPost<TPostType>, currentUser: ResolvedUserIdentity) => Promise<IPersistedPost<TPostType>>>;
updatePost: import("./Store").StoreAction<unknown, (persistedPost: IPersistedPost<TPostType>) => void, (result: IPersistedPost<TPostType>, persistedPost: IPersistedPost<TPostType>) => void, (failureReason: any, persistedPost: IPersistedPost<TPostType>) => void, (persistedPost: IPersistedPost<TPostType>) => Promise<IPersistedPost<TPostType>>>;
loadData: import("./Store").StoreAction<unknown, (omniaServiceId: GuidValue, postTypeId: GuidValue, topicIds: GuidValue[], currentUser: ResolvedUserIdentity) => void, (result: any[], omniaServiceId: GuidValue, postTypeId: GuidValue, topicIds: GuidValue[], currentUser: ResolvedUserIdentity) => void, (failureReason: any, omniaServiceId: GuidValue, postTypeId: GuidValue, topicIds: GuidValue[], currentUser: ResolvedUserIdentity) => void, (omniaServiceId: GuidValue, postTypeId: GuidValue, topicIds: Array<GuidValue>, currentUser: ResolvedUserIdentity) => Promise<any[]>>;
};
calculateTopPostLastActivity(posts: IPersistedPost<IPostBaseWithContext<TContextType>>[]): void;
getSortedPosts(persistedPosts: Array<IPersistedPost<IPostBaseWithContext<TContextType>>>): IPersistedPost<IPostBaseWithContext<TContextType>>[];
onActivated(): void;
onDisposing(): void;
}