Skip to content

Commit

Permalink
fix(useJwt)!: rename type JwtOptions to UseJwtOptions and `JwtRes…
Browse files Browse the repository at this point in the history
…ult` to `UseJwtReturn` (#1899)
  • Loading branch information
okxiaoliang4 committed Jul 13, 2022
1 parent 5246706 commit d9dad87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/integrations/useJwt/index.ts
Expand Up @@ -5,7 +5,7 @@ import { resolveUnref } from '@vueuse/shared'
import jwt_decode from 'jwt-decode'
import type { JwtDecodeOptions, JwtHeader, JwtPayload } from 'jwt-decode'

export interface JwtOptions<Fallback> {
export interface UseJwtOptions<Fallback> {
/**
* Value returned when encounter error on decoding
*
Expand All @@ -19,7 +19,7 @@ export interface JwtOptions<Fallback> {
onError?: (error: unknown) => void
}

export interface JwtResult<Payload, Header, Fallback> {
export interface UseJwtReturn<Payload, Header, Fallback> {
header: ComputedRef<Header | Fallback>
payload: ComputedRef<Payload | Fallback>
}
Expand All @@ -36,8 +36,8 @@ export function useJwt<
Fallback = null,
>(
encodedJwt: MaybeComputedRef<string>,
options: JwtOptions<Fallback> = {},
): JwtResult<Payload, Header, Fallback> {
options: UseJwtOptions<Fallback> = {},
): UseJwtReturn<Payload, Header, Fallback> {
const {
onError,
fallbackValue = null,
Expand Down

0 comments on commit d9dad87

Please sign in to comment.