import type { Fn0 } from "@thi.ng/api" ; import type { ISubscribable } from "@thi.ng/rstream" ; /**
 * Main rdom component interface/contract. Also see
 *  Component for a flexible base class, implementing this
 * interface.
  export interface IComponent < T = any > { /**
     * This component's main DOM element, i.e. usually the element
     * created when the component is  IComponent . mount ed. This
     * element will be used as default by various helper methods in the
     *  Component class.
      el ? : Element ; /**
     * Async component lifecycle method to initialize & attach the
     * component in the target DOM.
     *
     * The `index` arg is used to define the child index of where to
     * mount the component in the parent element and SHOULD default to
     * -1, causing the component to be appended to (rather than inserted
     * into) the list of children. The `index` arg MUST be passed to any
     * DOM creation functions used within `mount()` (e.g.  el ,
     *  $tree ). Likewise, for control-flow or wrapper components,
     * the `index` arg MUST be used when mounting child components
     * in-place of the wrapper component itself (e.g. see  $list ,
     *  $klist ,  $sub etc.).
     *
     * The optional additional varargs are only used by some component
     * wrappers and are context specific to each.
     *
     *  param parent param idx param xs mount ( parent , idx ? , ... xs ) : Promise < Element > ; /**
     * Async component lifecycle method to remove the component from the
     * target DOM and release any other internal resources (e.g.
     * subscriptions).
     */ unmount ( ) : Promise < void > ; /**
     * Component update lifecycle method. Not always used, but if it is
     * then intended to perform internal updates to reflect incoming
     * `state` arg in the DOM and/or child components.
     */ update ( state ? ) : void ; } /**
 * Specialized version of  IComponent which requires an
 * additional state arg for the component's `mount()` lifecycle method.
 *
 *  remarks This interface is used to connect an otherwise stateless component
 * with a state provider (e.g.  $sub ).
  export interface IMountWith < T , M > extends IComponent < T > { param parent param index param state mount ( parent , index , state ) : Promise < Element > ; /**
     * Same like  IComponent . update , but new `state` value arg is
     * mandatory.
     *
     *  param state update ( state ) : void ; } /**
 * Syntax sugar for  IMountWith .
  export type IMountWithState < T > = IMountWith < T , T > ; /**
 * Component type returned by  $compile .
  export interface CompiledComponent extends IComponent { subs ? : ISubscribable < any > [ ] ; children ? : IComponent [ ] ; } /**
 * Any value which is either an  IComponent or hiccup-style array/tree
  export type ComponentLike = IComponent | [ string , ... ( any | null ) [ ] ] ; export type Callback = Fn0 < void > ; export type Task = Fn0 < void > ; export type NumOrElement = number | Element ; /**
 * Interface for task schedulers. See  NullScheduler and
 *  RAFScheduler .
  export interface IScheduler { param scope param task add ( scope , task ) : void ; param scope cancel ( scope ) : void ; }