Skip to content

Commit

Permalink
Merge pull request #61 from alovajs/release/v1.4.x
Browse files Browse the repository at this point in the history
fix(auth): correct the type of authentication module
  • Loading branch information
JOU-amjs committed Apr 12, 2024
2 parents 71c185f + d98b68b commit acadeaa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/scene-react/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Method,
Progress,
RequestHookConfig,
StatesHook,
SuccessHandler,
updateState,
UseHookReturnType,
Expand Down Expand Up @@ -511,12 +512,13 @@ declare const accessAction: AccessAction;
* @returns token认证拦截器函数
*/
export function createClientTokenAuthentication<
SH extends StatesHook<any, any>,
RA extends
| AlovaRequestAdapter<any, any, any, any, any>
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
>(
options: ClientTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;

/**
* 创建服务端的token认证拦截器
Expand All @@ -542,12 +544,13 @@ export function createClientTokenAuthentication<
* @returns token认证拦截器函数
*/
export function createServerTokenAuthentication<
SH extends StatesHook<any, any>,
RA extends
| AlovaRequestAdapter<any, any, any, any, any>
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
>(
options: ServerTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;

/**
* 在一定条件下可以自动重新拉取数据,从而刷新页面,使用场景有:
Expand Down
7 changes: 5 additions & 2 deletions packages/scene-svelte/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Method,
Progress,
RequestHookConfig,
StatesHook,
SuccessHandler,
updateState,
UseHookReturnType,
Expand Down Expand Up @@ -523,12 +524,13 @@ declare const accessAction: AccessAction;
* @returns token认证拦截器函数
*/
export function createClientTokenAuthentication<
SH extends StatesHook<any, any>,
RA extends
| AlovaRequestAdapter<any, any, any, any, any>
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
>(
options: ClientTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;

/**
* 创建服务端的token认证拦截器
Expand All @@ -554,12 +556,13 @@ export function createClientTokenAuthentication<
* @returns token认证拦截器函数
*/
export function createServerTokenAuthentication<
SH extends StatesHook<any, any>,
RA extends
| AlovaRequestAdapter<any, any, any, any, any>
| ((...args: any[]) => AlovaRequestAdapter<any, any, any, any, any>) = typeof GlobalFetch
>(
options: ServerTokenAuthenticationOptions<AlovaRequestAdapterUnified<RA>>
): TokenAuthenticationResult<AlovaRequestAdapterUnified<RA>>;
): TokenAuthenticationResult<SH, AlovaRequestAdapterUnified<RA>>;

/**
* 在一定条件下可以自动重新拉取数据,从而刷新页面,使用场景有:
Expand Down
1 change: 1 addition & 0 deletions packages/scene-vue/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Method,
Progress,
RequestHookConfig,
StatesHook,
SuccessHandler,
updateState,
UseHookReturnType,
Expand Down

0 comments on commit acadeaa

Please sign in to comment.