Coloring
Coloring
其实是需要知道`makeCustomer`想要返回什么,因为类型其实也是可以继承的,这就代表`T`可能会提供更多的属性或方法。比如我有一个继承了`User`类型的`MyUser`类型,它是能够作为参数传入的,`T`也就变成了`MyUser`,而现在的`makeCustomer`只是返回了`User`类型。 ```ts interface MyUser extends User { age: number } function makeCustomer(u: T): T { // Error(TS 编译器版本:v4.4.2) // Type '{ id: number; kind: string; }' is not assignable to...
> > ```ts > > interface Example { > > a: string; > > b: string | number; > > c: () => void; > > d: {}; > >...
```ts function f(a: string, b: string): string function f(a: number, b: number): number function f(a: string | number, b: string | number) { if (typeof a === 'string') { return...
```ts interface Foo { [key: string]: any [key: number]: any bar(): void } type GetKey = V1 extends V2 ? never : V2 type RemoveIndexSignature = { // GetKey 中只要有一个是...
> Makes sense — could you link to the Space you are trying to load or provide us a quick repro? Reproduce repo: https://huggingface.co/spaces/Coloring/gradio_load_test
可以自己写一个 plugin 处理: plugin.ts ```ts import type { IApi } from 'father'; import { addLoader, ILoaderItem } from 'father/dist/builder/bundless/loaders'; export default async (api: IApi) => { const loaders: ILoaderItem[] =...
> 想了解下,如果是在传入前 自己先做format 传入string 和 现在诉求想传入对象后,组件提供 数据 format 的区别在于哪里哈 在用 messageRender 渲染的时候会很麻烦,message 只会传当前的 content 回来,其实在 messageRender 中返回当前的 bubbleProps 感觉也行,不过这样就需要用户单独再 bubbleProps 上挂一个无关的属性用来取值了。
> 有 typing 效果,但是完全没有 autoScroll 效果会是什么原因呢 看了下,如果 messageRender 的内容是一个高度较高的元素,此时的自动滚动很大概率会失效。
I have met the same problem. This issue has been closed, did you find a solution?