import { ComponentType } from 'react' export type FIXME = any export interface RJT_SERIALIZED_COMPONENT { type: '__RJT_COMPONENT__' name: string props: Record } export interface RJT_SERIALIZED_ACTION { type: '__RJT_ACTION__' name: string params: unknown[] } export interface RJT_SERIALIZED_FRAGMENT { type: '__RJT_FRAGMENT__' children: RJT_SDUI[] } export type RJT_SDUI = string | RJT_SERIALIZED_ACTION | RJT_SERIALIZED_COMPONENT | RJT_SERIALIZED_FRAGMENT | RJT_SDUI[] export type RJT_CONSTANT_TYPE = 'number' | 'string' | 'function' | 'object' | 'array' export interface RJT_CONSTANT { type: '__RJT_CONSTANT__' name: string kind: T } export type RJT_OPERAND_TYPE = number | RJT_CONSTANT<'number'> | RJT_GENERIC_OPERATION export interface RJT_ADDITION_OPERATION { type: '__RJT_OPERATION__' operation: '+' operands: [RJT_OPERAND_TYPE, RJT_OPERAND_TYPE] } export interface RJT_MULTIPLICATION_OPERATION { type: '__RJT_OPERATION__' operation: '*' operands: [RJT_OPERAND_TYPE, RJT_OPERAND_TYPE] } export interface RJT_SUBSTRUCTION_OPERATION { type: '__RJT_OPERATION__' operation: '-' operands: [RJT_OPERAND_TYPE, RJT_OPERAND_TYPE] } export interface RJT_DIVISION_OPERATION { type: '__RJT_OPERATION__' operation: '/' operands: [RJT_OPERAND_TYPE, RJT_OPERAND_TYPE] } export interface RJT_SQRT_OPERATION { type: '__RJT_OPERATION__' operation: 'sqrt' operands: [RJT_OPERAND_TYPE] } export interface RJT_POW_OPERATION { type: '__RJT_OPERATION__' operation: 'pow' operands: [RJT_OPERAND_TYPE, RJT_OPERAND_TYPE] } export type RJT_GENERIC_OPERATION = | RJT_ADDITION_OPERATION | RJT_MULTIPLICATION_OPERATION | RJT_SUBSTRUCTION_OPERATION | RJT_DIVISION_OPERATION | RJT_SQRT_OPERATION | RJT_POW_OPERATION export type RJT_OPERATION_TYPE = RJT_GENERIC_OPERATION['operation'] type FindByOperation = Union extends { operation: Type } ? Union : never export type RJT_OPERATION = FindByOperation export interface RJT_CONFIG { components: Record> actions: Record void> constants: Record } export type RJT_SERIALIZABLE

= ComponentType

& { __RJT_TYPE__: '__RJT_COMPONENT__' __RJT_NAME__: string } export type RJT_TEMPLATE

= ComponentType

& { __RJT_TYPE__: '__RJT_TEMPLATE__' } export type RJT_ACTION void, P extends unknown[]> = R & { __RJT_TYPE__: '__RJT_ACTION__' __RJT_NAME__: string __RJT_PARAMS__: P }