import ICategory, { ICategoryPricingRule } from '../../Interfaces/Category'; import Space from '../Space'; import { IIndexedCategory } from '../../Interfaces/Algolia'; import { BaseServiceClass } from '../baseService'; import IDeclination from '../../Interfaces/Declination'; export default class Category extends BaseServiceClass { static fetchCategories: ({ app, api }: { readonly app: string; readonly api: string; }) => Promise; static getCategoryFromCategorySlug: (slug: string, categories: Category[]) => Category | string; data: () => ICategory; parent: () => Promise; hasParent: () => boolean; getHierarchicalOrderBasedOnCategories: (categories: Category[], order?: number) => number; /** * @deprecated use [space.categories.getTree]{@link space.categories.getTree} function instead * @param categories * @param level * @param parent */ private _getTreeOld; getLastIndex: () => Promise; private _getAtLastIndex; save: (partialCategory?: Partial) => Promise; private _updateDependancies; private _uploadImages; getParentTree: (parents?: string[]) => Promise; getParentTreeSync: (categories: Category[], parents?: string[], useIdOnly?: boolean) => string[]; hasCostPriceRule: () => false | ICategoryPricingRule | undefined; private calcPriceToUse; costPriceRule: (price: number, decli: IDeclination, action: 'buy' | 'sell') => number; static removeCategoryFromProductWithCategory: (category: ICategory, space: Space) => Promise; }