jazz-react
Context & Hooks
createJazzReactApp<Acc>({ AccountSchema? }):
JazzReactApp<Acc>
{ AccountSchema: AccountClass<Acc> }
Acc extends Account
Hooks
.useAccount():
{ me: Acc, logOut: () => void }
⚠️ undocumented
.useAccount<D>(depth):
{ me: DeeplyLoaded<Acc, D> | undefined, logOut: () => void }
D extends { profile: DepthsIn<Profile, 5, [0]> | undefined, root: DepthsIn<CoMap, 5, [0]> | undefined } | never[]
depth: D
⚠️ undocumented
.useAccountOrGuest():
{ me: AnonymousJazzAgent | Acc }
⚠️ undocumented
.useAccountOrGuest<D>(depth):
{ me: DeeplyLoaded<Acc, D> | AnonymousJazzAgent | undefined }
D extends { profile: DepthsIn<Profile, 5, [0]> | undefined, root: DepthsIn<CoMap, 5, [0]> | undefined } | never[]
depth: D
⚠️ undocumented
.useCoState<V, D>(Schema, id, depth):
DeeplyLoaded<V, D> | undefined
V extends CoValue
Schema: TODO reflection type 512 & CoValueClass<CoValue>,
id: ID<V> | undefined,
depth: TODO type unknown
⚠️ undocumented
.useAcceptInvite<V>({ invitedObjectSchema, onAccept, forValueHint? }):
void
V extends CoValue
{ invitedObjectSchema: CoValueClass<V>, onAccept: (projectID: ID<V>) => void, forValueHint: string }
⚠️ undocumented
Provider Component
.Provider:
FC<{ children: ReactNode, auth: "guest" | AuthMethod, peer: TODO type templateLiteral | TODO type templateLiteral, storage: StorageConfig }>
⚠️ undocumented
Media
useProgressiveImg({ image, maxWidth? }):
{ src: undefined | string, res: "placeholder" | TODO type templateLiteral | undefined, originalSize: co<[number, number]> | undefined }
{ image: ImageDefinition | null | undefined, maxWidth: number }
ProgressiveImg({ children, image, maxWidth? }):
ReactNode
{ children: (result: { src: undefined | string, res: "placeholder" | TODO type templateLiteral | undefined, originalSize: TODO type typeOperator | undefined }) => ReactNode, image: ImageDefinition | null | undefined, maxWidth: number }
Auth Providers
useDemoAuth({ seedAccounts? }):
TODO type typeOperator
{ seedAccounts: { undefined } }
usePasskeyAuth({ appName, appHostname? }):
TODO type typeOperator
{ appName: string, appHostname: string }
usePassphraseAuth({ appName, wordlist, appHostname? }):
TODO type typeOperator
{ appName: string, wordlist: string[], appHostname: string }
Invite Links
createInviteLink<C>(value, role, { baseURL?, valueHint? }):
string
value: C,
role: "writeOnly" | "admin" | "writer" | "reader",
{ baseURL: string, valueHint: string }
parseInviteLink<C>(inviteURL):
{ valueID: ID<C>, inviteSecret: InviteSecret, valueHint: string } | undefined
inviteURL: string
Other
DemoAuthBasicUI({ appName, state }):
Element
{ appName: string, state: DemoAuthState }
PasskeyAuthBasicUI({ state }):
Element | null
{ state: PasskeyAuthState }
PassphraseAuthBasicUI(state):
Element
state: PassphraseAuthState