API reference
react
Import
Section titled “Import”import * as api from "@fungi.computer/sprite/react";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | SpriteProps | Avatar presentation plus ordinary attributes for the DOM host. |
| constant | Sprite | Own one player; source and appearance changes do not remount its React host. |
| function | SpriteProvider() | Shell-owned renderer and asset configuration; no selected identity lives here. |
SpritePropstype alias
Section titled “SpriteProps”type SpriteProps = AvatarPresentation & Omit<HTMLAttributes<HTMLDivElement>, "children"> & object;Avatar presentation plus ordinary attributes for the DOM host.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
service? |
SpriteService |
Optional for standalone use; a shell normally supplies SpriteProvider. |
paused? |
boolean |
- |
onState()? |
(state) => void |
Observe loading, ready, error, and disposal changes. |
Spriteconstant
Section titled “Sprite”const Sprite: ForwardRefExoticComponent< AvatarPresentation & Omit<HTMLAttributes<HTMLDivElement>, "children"> & object & RefAttributes<HTMLDivElement>>;Own one player; source and appearance changes do not remount its React host.
SpriteProvider()function
Section titled “SpriteProvider()”function SpriteProvider(__namedParameters): Element;Shell-owned renderer and asset configuration; no selected identity lives here.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
{ service: SpriteService; children: ReactNode; } |
__namedParameters.service |
SpriteService |
__namedParameters.children |
ReactNode |
Returns
Section titled “Returns”Element