From 47de93f113f9b4ce561ab20df8967c6862722035 Mon Sep 17 00:00:00 2001 From: Juraj Uhlar Date: Tue, 10 Dec 2024 13:53:21 +0000 Subject: [PATCH] chore: replace deprecated imports --- src/fpjs-context.ts | 4 ++-- src/use-visitor-data.ts | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fpjs-context.ts b/src/fpjs-context.ts index 91a7828..6f83c00 100644 --- a/src/fpjs-context.ts +++ b/src/fpjs-context.ts @@ -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 { /** @@ -20,7 +20,7 @@ export interface VisitorQueryResult extends QueryResu data?: VisitorData } -export interface GetDataOptions extends GetOptions { +export interface GetDataOptions extends FingerprintJSPro.GetOptions { /** * When set to true, the visitor data will always be fetched from our API. * */ diff --git a/src/use-visitor-data.ts b/src/use-visitor-data.ts index 4cdfac1..60fb7bd 100644 --- a/src/use-visitor-data.ts +++ b/src/use-visitor-data.ts @@ -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' @@ -50,7 +50,10 @@ export function useVisitorData( const { ignoreCache: defaultIgnoreCache, ...getVisitorDataOptions } = getOptions - const getDataOptions: GetOptions = { ...getVisitorDataOptions, ...getDataPassedOptions } + const getDataOptions: FingerprintJSPro.GetOptions = { + ...getVisitorDataOptions, + ...getDataPassedOptions, + } const result = await getVisitorData( getDataOptions,