diff --git a/index.d.ts b/index.d.ts index edcbd18..c412b07 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,26 +1,26 @@ -type TStatus = '9000' | '8000' | '4000' | '5000' | '6001' | '6002'; +export type AlipayResultCode = '9000' | '8000' | '4000' | '5000' | '6001' | '6002'; -interface IResult { - resultStatus: TStatus; +export interface AlipayResult { + resultStatus: AlipayResultCode; result: string; memo: string; } declare namespace Alipay { - function authWithInfo(infoStr: string): IResult; + function authWithInfo(infoStr: string): Promise; // 设置沙箱模式 function setAlipaySandbox(isSandbox: boolean): void - function pay(infoStr: string): IResult; + function pay(infoStr: string): Promise; - function payInterceptorWithUrl(infoStr: string): { - resultCode: TStatus; + function payInterceptorWithUrl(infoStr: string): Promise<{ + resultCode: AlipayResultCode; returnUrl: string; - }; + }>; function sign(infoStr: string): string; } -export = Alipay; \ No newline at end of file +export = Alipay;