UNPKG

@mussnad/frappe-react-query

Version:
28 lines (27 loc) 1.32 kB
import { PropsWithChildren } from 'react'; import { QueryClient } from '@tanstack/react-query'; import { TokenParams } from '../types'; type FrappeProviderProps = PropsWithChildren<{ /** URL of the Frappe server * * Only needed if the URL of the window is not the same as the Frappe server URL */ url?: string; /** Token parameters to be used for authentication * * Only needed for token-based authentication */ tokenParams?: TokenParams; /** Port on which Socket is running. Only meant for local development. Set to undefined on production. */ socketPort?: string; /** Get this from frappe.local.site on the server, or frappe.boot.sitename on the window. * Required for Socket connection to work in Frappe v15+ */ siteName?: string; /** Flag to disable socket, if needed. This defaults to true. */ enableSocket?: boolean; /** QueryClient options - these will be applied globally unless overridden */ queryClient?: QueryClient; /** Custom Headers to be passed in each request */ customHeaders?: Record<string, string>; }>; export declare const FrappeProvider: ({ url, tokenParams, socketPort, queryClient, siteName, enableSocket, children, customHeaders, }: FrappeProviderProps) => import("react/jsx-runtime").JSX.Element; export {};