JavaScript/typescript/类型:修订间差异
来自康健生活
| 第17行: | 第17行: | ||
}) | }) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== ...params: any[] == | |||
可变参数 | |||
<syntaxhighlight lang="javascript"> | |||
interface HttpFetchInterface { | |||
fetch(...params: any[]): Promise<object>; | |||
} | |||
async fetch (username:string, password:string, httpMethod?:string): Promise<object>{</syntaxhighlight> | |||