import { config } from '@/config'; import type { Component } from 'vue'; export interface ITool { name: string; path: string; description: string; keywords: string[]; component: () => Promise; icon: Component; redirectFrom?: string[]; isNew: boolean; } export interface ToolCategory { name: string; icon: Component; components: ITool[]; } type WithOptional = Omit & Partial>; export function defineTool( tool: WithOptional, { newTools }: { newTools: string[] } = { newTools: config.tools.newTools }, ) { const isNew = newTools.includes(tool.name); return { isNew, ...tool, }; }