/** * Copyright (c) 2026 Sergio Turolla * * This file is part of @r-machine/react, licensed under the * GNU Affero General Public License v3.0 (AGPL-3.0-only). * * You may use, modify, and distribute this file under the terms * of the AGPL-3.0. See LICENSE in this package for details. * * If you need to use this software in a proprietary project, * contact: licensing@codecarvings.com */ import type { RMachine } from "r-machine"; import type { AnyResAtlas, ExperimentalFlags, ResEquipment } from "r-machine/core"; import type { AnyLocale } from "r-machine/locale"; import type { ReactNode } from "react"; import type { ReactPlugDefiner, ReactPlugKitMap } from "./react-plug.cjs"; import { VertexFrame } from "./vertex-frame.cjs"; type WriteLocale = (newLocale: L) => void | Promise; export type ReactBareToolset> = { readonly ReactRMachine: ReactBareRMachine; readonly Plug: ReactPlugDefiner; } & (EF["outerGear"] extends "on" ? { readonly VertexFrame: typeof VertexFrame; } : {}); export interface ReactBareRMachine { (props: ReactBareRMachineProps): ReactNode; probe: (localeOption: string | undefined) => L | undefined; } interface ReactBareRMachineProps { readonly locale: L; readonly writeLocale?: WriteLocale | undefined; readonly children: ReactNode; } export interface CreateReactBareToolsetOptions { /** * When true, every reactive surface (outer / vertex gear) returned by * `plug.useR()` is wrapped in a fresh-identity Proxy on each reactive * re-render, so React Compiler's reference-identity memoization re-evaluates * the scopes that read it. Off by default — see the dev-mode warning below * and the docs: enabling React Compiler with R-Machine brings little benefit * (reactivity is already read-driven) and adds this wrapping overhead. */ readonly reactCompiler?: boolean; } export declare function createReactBareToolset, EF extends ExperimentalFlags, KM extends ReactPlugKitMap>(rMachine: RMachine, kit: KM, options?: CreateReactBareToolsetOptions): Promise>; export {};