Skip to content

Commit

Permalink
chore: replace deprecated imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JuroUhlar committed Dec 10, 2024
1 parent 73c18c9 commit 47de93f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/fpjs-context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext } from 'react'
import { VisitorData, GetOptions } from '@fingerprintjs/fingerprintjs-pro-spa'
import { VisitorData, GetOptions, FingerprintJSPro } from '@fingerprintjs/fingerprintjs-pro-spa'

export interface QueryResult<TData, TError = Error> {
/**
Expand All @@ -20,7 +20,7 @@ export interface VisitorQueryResult<TExtended extends boolean> extends QueryResu
data?: VisitorData<TExtended>
}

export interface GetDataOptions<TExtended extends boolean> extends GetOptions<TExtended> {
export interface GetDataOptions<TExtended extends boolean> extends FingerprintJSPro.GetOptions<TExtended> {
/**
* When set to true, the visitor data will always be fetched from our API.
* */
Expand Down
7 changes: 5 additions & 2 deletions src/use-visitor-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FpjsContextInterface, FpjsContext, GetDataOptions, QueryResult, VisitorQueryContext } from './fpjs-context'
import { useCallback, useContext, useEffect, useState } from 'react'
import { GetOptions, VisitorData } from '@fingerprintjs/fingerprintjs-pro-spa'
import { VisitorData, FingerprintJSPro } from '@fingerprintjs/fingerprintjs-pro-spa'
import { usePrevious } from './utils/use-previous'
import deepEquals from 'fast-deep-equal'
import { toError } from './utils/to-error'
Expand Down Expand Up @@ -50,7 +50,10 @@ export function useVisitorData<TExtended extends boolean>(

const { ignoreCache: defaultIgnoreCache, ...getVisitorDataOptions } = getOptions

const getDataOptions: GetOptions<TExtended> = { ...getVisitorDataOptions, ...getDataPassedOptions }
const getDataOptions: FingerprintJSPro.GetOptions<TExtended> = {
...getVisitorDataOptions,
...getDataPassedOptions,
}

const result = await getVisitorData(
getDataOptions,
Expand Down

0 comments on commit 47de93f

Please sign in to comment.