JavaScript/typescript/类型:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第20行: 第20行:
可变参数
可变参数


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="typescript">
interface HttpFetchInterface {
interface HttpFetchInterface {
   fetch(...params: any[]): Promise<object>;
   fetch(...params: any[]): Promise<object>;
}
}
async fetch (username:string, password:string, httpMethod?:string): Promise<object>{</syntaxhighlight>
async fetch (username:string, password:string, httpMethod?:string): Promise<object>{</syntaxhighlight>