@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
51 lines • 1.34 kB
TypeScript
import { ClerkAPIResponseError } from "../../errors/clerkApiResponseError.js";
import { BillingPlanResource } from "../../types/billing.js";
//#region src/react/hooks/usePlanDetailsQuery.types.d.ts
/**
* @internal
*/
type UsePlanDetailsQueryParams = {
/**
* The plan ID to fetch.
*/
planId?: string | null;
/**
* Initial plan data to use before fetching.
*/
initialPlan?: BillingPlanResource | null;
/**
* If true, the previous data will be kept in the cache until new data is fetched.
*
* @default true
*/
keepPreviousData?: boolean;
/**
* If `true`, a request will be triggered when the hook is mounted.
*
* @default true
*/
enabled?: boolean;
};
/**
* @internal
*/
type PlanDetailsQueryResult = {
/**
* The plan object, `undefined` before the first fetch, or `null` if no plan exists.
*/
data: BillingPlanResource | undefined | null;
/**
* Any error that occurred during the data fetch, or `undefined` if no error occurred.
*/
error: ClerkAPIResponseError | null;
/**
* Indicates whether the initial data is still being fetched.
*/
isLoading: boolean;
/**
* Indicates whether any request is still in flight, including background updates.
*/
isFetching: boolean;
};
//#endregion
export { PlanDetailsQueryResult, UsePlanDetailsQueryParams };