@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
48 lines (47 loc) • 1.71 kB
TypeScript
import type { Collection } from "../../interfaces/models/Collection";
import type { Entity } from "../../interfaces/models/Entity";
export interface UseCollectionsActionsValues {
openCollection: (collection: Collection) => void;
goBack: () => void;
goToRoot: () => void;
fetchRootCollection: ({ projectId }: {
projectId: string;
}) => Promise<void>;
fetchSubCollections: ({ projectId, collectionId }: {
projectId: string;
collectionId: string;
}) => Promise<void>;
createCollection: ({ projectId, parentCollectionId, collectionName }: {
projectId: string;
parentCollectionId: string;
collectionName: string;
}) => Promise<void>;
updateCollection: ({ projectId, collectionId, update }: {
projectId: string;
collectionId: string;
update: Partial<{
name: string;
}>;
}) => Promise<void>;
deleteCollection: ({ projectId, collection }: {
projectId: string;
collection: Collection;
}) => Promise<void>;
addToCollection: ({ projectId, collectionId, entity }: {
projectId: string;
collectionId: string;
entity: Entity;
}) => Promise<void>;
removeFromCollection: ({ projectId, collectionId, entityId }: {
projectId: string;
collectionId: string;
entityId: string;
}) => Promise<void>;
resetCollections: () => void;
}
/**
* Redux-powered hook that provides all collection actions
* This replaces the individual hooks and provides a centralized way to manage collections
*/
export declare function useCollectionsActions(): UseCollectionsActionsValues;
export default useCollectionsActions;