UNPKG

@clerk/shared

Version:

Internal package utils used by the Clerk SDKs

53 lines 1.39 kB
import { BillingStatementResource, ForPayerType } from "../../types/billing.js"; import { ClerkAPIResponseError } from "../../types/errors.js"; //#region src/react/hooks/useStatementQuery.types.d.ts /** * @internal */ type UseStatementQueryParams = { /** * The statement ID to fetch. */ statementId?: string | null; /** * Specifies whether to fetch the statement for an organization or a user. * * @default 'user' */ for?: ForPayerType; /** * If true, the previous data will be kept in the cache until new data is fetched. * * @default false */ keepPreviousData?: boolean; /** * If `true`, a request will be triggered when the hook is mounted. * * @default true */ enabled?: boolean; }; /** * @internal */ type StatementQueryResult = { /** * The statement object, `undefined` before the first fetch, or `null` if no statement exists. */ data: BillingStatementResource | 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 { StatementQueryResult, UseStatementQueryParams };