Skip to content

Commit acadeaa

Browse files
authored
Merge pull request #61 from alovajs/release/v1.4.x
fix(auth): correct the type of authentication module
2 parents 71c185f + d98b68b commit acadeaa

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

packages/scene-react/typings/index.d.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Method,
88
Progress,
99
RequestHookConfig,
10+
StatesHook,
1011
SuccessHandler,
1112
updateState,
1213
UseHookReturnType,
@@ -511,12 +512,13 @@ declare const accessAction: AccessAction;
511512
* @returns token认证拦截器函数
512513
*/
513514
export function createClientTokenAuthentication<
515+
SH extends StatesHook<any, any>,
514516
RA extends
515517
| AlovaRequestAdapter<any, any, any, any, any>
516518
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
517519
>(
518520
options: ClientTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
519-
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
521+
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;
520522

521523
/**
522524
* 创建服务端的token认证拦截器
@@ -542,12 +544,13 @@ export function createClientTokenAuthentication<
542544
* @returns token认证拦截器函数
543545
*/
544546
export function createServerTokenAuthentication<
547+
SH extends StatesHook<any, any>,
545548
RA extends
546549
| AlovaRequestAdapter<any, any, any, any, any>
547550
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
548551
>(
549552
options: ServerTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
550-
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
553+
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;
551554

552555
/**
553556
* 在一定条件下可以自动重新拉取数据,从而刷新页面,使用场景有:

packages/scene-svelte/typings/index.d.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Method,
88
Progress,
99
RequestHookConfig,
10+
StatesHook,
1011
SuccessHandler,
1112
updateState,
1213
UseHookReturnType,
@@ -523,12 +524,13 @@ declare const accessAction: AccessAction;
523524
* @returns token认证拦截器函数
524525
*/
525526
export function createClientTokenAuthentication<
527+
SH extends StatesHook<any, any>,
526528
RA extends
527529
| AlovaRequestAdapter<any, any, any, any, any>
528530
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
529531
>(
530532
options: ClientTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
531-
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
533+
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;
532534

533535
/**
534536
* 创建服务端的token认证拦截器
@@ -554,12 +556,13 @@ export function createClientTokenAuthentication<
554556
* @returns token认证拦截器函数
555557
*/
556558
export function createServerTokenAuthentication<
559+
SH extends StatesHook<any, any>,
557560
RA extends
558561
| AlovaRequestAdapter<any, any, any, any, any>
559562
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
560563
>(
561564
options: ServerTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
562-
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
565+
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;
563566

564567
/**
565568
* 在一定条件下可以自动重新拉取数据,从而刷新页面,使用场景有:

packages/scene-vue/typings/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Method,
88
Progress,
99
RequestHookConfig,
10+
StatesHook,
1011
SuccessHandler,
1112
updateState,
1213
UseHookReturnType,

0 commit comments

Comments
 (0)