react-playmakers
Version:
React wrapper providing utilities for PlayMakers integration
30 lines (29 loc) • 1.35 kB
TypeScript
import { CategoryParentType, CategoryPostResponseType, CategoryType } from "../types/categories.types";
type CategoryRenameMethod = (name: string) => Promise<CategoryPostResponseType>;
type CategoryCreateMethod = (name: string, parentId?: string, projectId?: string) => Promise<CategoryPostResponseType>;
type CategoryDeleteMethod = () => Promise<void>;
interface UseCategoryReturn extends Partial<CategoryType> {
category: CategoryType | null;
parents: CategoryParentType[];
fetched: boolean;
rename: CategoryRenameMethod;
create: CategoryCreateMethod;
delete: CategoryDeleteMethod;
}
export declare const useCategory: (categoryId?: string) => UseCategoryReturn;
type CategoriesFetchMoreMethod = (refresh?: boolean) => Promise<void>;
type CategoriesCreateMethod = (name: string, parentId?: string) => Promise<CategoryPostResponseType>;
type CategoriesFetchMethod = (quiet?: boolean) => Promise<CategoryType[]>;
interface UseCategoriesReturn {
categories: CategoryType[];
create: CategoriesCreateMethod;
fetched: boolean;
hasMore: boolean;
currentPage: number;
fetchMore: CategoriesFetchMoreMethod;
refetch: CategoriesFetchMethod;
}
export declare const useCategories: (projectId: string | undefined, params?: {
[key: string]: any;
}) => UseCategoriesReturn;
export {};