muben's recent timeline updates
muben

muben

V2EX member #636001, joined on 2023-06-27 10:44:11 +08:00
muben's recent replies
Mar 5
Replied to a topic by lewin18 OpenClaw openclaw 搭建好了却不知道用来干嘛
吹的人都是骗小白买课的
Dec 4, 2024
Replied to a topic by jeremye TypeScript 请教一个 TS 问题,不知能否实现
```ts
interface Options<T extends any> {
a: () => T;
b: (p: T) => void;
}

type ConfigType<T extends Record<string, Options<any>>> = {
[K in keyof T]: {
a: () => T[K]['a'];
b: (p: ReturnType<T[K]['a']>) => void;
};
};

function defineConfig<T extends Record<string, Options<any>>>(options: T): ConfigType<T> {
return options;
}

const config = defineConfig({
item1: {
a: () => ({ id: 1 }),
b: (params) => {}, // params 类型是 { id: number }
},
item2: {
a: () => ({ name: '1' }),
b: (params) => {}, // params 类型是 { name: string }
},
});

config.item1.b({ id: 1 }); // ok
config.item1.b({ name: '1' }); // error

config.item2.b({ id: 1 }); // error
config.item2.b({ name: '1' }); // ok
```
Nov 18, 2024
Replied to a topic by gdw1986 macOS 大家现在都用什么输入法?
mac 微信、win QQ 、安卓 讯飞
银行推销会不会自动给机主贷款
m2 pro 现在有点溢价,不如再加点上 m3 pro
14 寸模具压得住 m3 max 吗
毛都没,还在每个人桌子边上摆块牌子,我的是好好编程,努力赚钱
Sep 27, 2023
Replied to a topic by cusuanan Windows Win11 史诗级更新,状态栏窗口不再合并
就是要他堆叠显示才舒服啊,比起这个我更希望右键菜单改回 win10 的样子
@AscenZ xm5 可以再等等,参考 xm4 发售后半年就跌了 800
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3762 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 00:40 · PVG 08:40 · LAX 17:40 · JFK 20:40
♥ Do have faith in what you're doing.