Closed zhanghongyong123456 closed 2 months ago
Hi, I'm not sure about this specific syntax and way of extending an enum,
but if you would like to add a new public ComputeProvider that could benefit everyon (eg. a public cloud API service provider, or an open-source platform that we can run locally) let me know and I will add it
if this is regarding ComfyUI, I have added a new provider for this (ComputeProvider.COMFYUI
)
when i use
extend-compute-provider.tx
import { ComputeProvider } from '@aitube/clapper-services'
declare module '@aitube/clapper-services' { export enum ComputeProvider { MyComputeProvider = 'xiaosi', } }
console.log('打印扩展是否生效', ComputeProvider.MyComputeProvider)
in main.tsx test: import '@/store/extend-compute-provider' import('@aitube/clapper-services') .then((module) => { console.log(module); // 输出整个模块对象 console.log(module.ComputeProvider); // output ComputeProvider console.log(module.ComputeProvider?.MyComputeProvider, '模块导入成功'); / }) .catch((error) => { console.error('模块导入失败:', error); });
output is undefined
What should I do