1
// type.d.ts (global scope)
declare global{
    interface Array{
        customFunc(args)=>any;
    }
}
// type.ts 
Array.prototype.customFunc = (...args) => {
        return 
}

PS:在这个基础上对泛型进行补充会让这更perfect


windivi
11 声望0 粉丝

change is origin , time is key?