import { Context } from "./sprite" ; /**
 * Function to define a context, which can be used to pass props into nested
 * Sprites using `getContext`:
 *
 * ```js
 * const myContext = makeContext()
 *
 * myContext.Sprite({ context: { count: 0 }, sprites: [...] })
 *
 * const { count } = getContext(myContext)
 * ```
 */ export function makeContext < T > ( ) { const contextThis = { Sprite : ( { context , sprites } ) => ( { type : "context" , value : context , sprites , context : contextThis , } ) , } ; return contextThis ; } export type ContextValue < T = unknown > = { context : Context < T > ; value : T ; } ;