import React from 'react'; import { ElectricClient } from '../../client/model/client.js'; import { DbSchema } from '../../client/model/index.js'; interface Props>> { children?: React.ReactNode; db?: S; } interface ElectricContext>> { ElectricContext: React.Context; useElectric: () => S | undefined; ElectricProvider: ({ children, db }: Props) => JSX.Element; } /** * This "static" context is used internally by our React hooks to access the {@link ElectricClient}. * It loses information about the actual types of the DB tables, * but we don't need that information in the React hooks. * However, users preferably don't lose this type information, * therefore, they can use {@link makeElectricContext}. */ declare let ElectricContext: React.Context> | undefined>; export { ElectricContext }; /** * Call this function to create an Electric context, provider, and subscriber for your React application. * We can't provide a predefined context, provider, and subscriber because that would lose type information * as the types depend on the type of the database `S` that's provides as a type argument. * * @example * This example loses information about the concrete DB tables: * ``` * const ctx = createContext() * ``` */ export declare function makeElectricContext>>(): ElectricContext;