Type defining the options that can be supplied for a callback to be wrapped
Argument that is supplied to the callback as a last parameter.
Component that will be set as a current component when the callback is invoked.
Object that will be referenced by "this" within the callback function
Type of scheduling the Mimbl tick after the callback function returns.
Type that combines readonly component properties and component events. For each event, the ComponentProps type defines a property named $on_event, where "event" is the name of the property from the TEvents generic type. This allows attaching to component events in JSX just like attaching to HTML element events.
The ComponentProps is not usually used directly by developers; however, it defines the
type of the props
property in the IComponent interface that all class-based components
implement.
Example:
// Component properties
interface IMyCompProps
{
title?: string
}
// Component events
interface IMyCompEvents
{
titleChanged?: string;
}
// the following component
class MyComp extends Component<IMyCompProps,IMyCompEvents> {...}
// would have its properties type equivalent to
type PropsAndEvents =
{
readonly title?: string;
readonly $on_titleChanged?: EventPropType<CustomEvent<string>>;
}
// this allows using MyComp as the following
<MyComp title="Hello" $on_titleChanged={e => console.log(`Title changed to ${e.detail}`)}
Type defining properties that can be passed to the class-based component
of this type. Note that if the component is expected to accept children then the TProps
object must have the cildren
property (usually of the any
type). Default type is an empty
object (no properties and no children).
Type that maps event names (a.k.a event types) to either Event-derived
classes (e.g. MouseEvent) or any other type. The latter will be interpreted as a type of the
detail
property of a CustomEvent. Default type is an empty object (no events).
Type for the shadow
property in the IComponent interface. This can be one of the following:
<div>
element will be created and shadow root attached to
it with mode "open".<div>
element will be created and shadow root attached to
it with the given initialization prameters.Type of vnref property that can be passed to JSX elements.
Type of the vnref property value.
DOM event type, e.g. MouseEvent
Type of event handler function for DOM events of type T.
Event object
Optional parameter, which is defined only if it was passed when the callback was
wrapped - that is, in the arg
property of the EventObjectType object or in the 2nd item of the
EventTupleType tuple.
Union type that can be passed to an Element's event.
DOM event type, e.g. MouseEvent
Type defining a tuple that can be supplied for an event listener.
DOM event type, e.g. MouseEvent
Converts the given interface T to a type that maps an extended attribute type to each property
of T. The extended property contains the property type, the ITrigger for this type as well as
null
and undefined
. This is primarily useful for defining attributes of HTML elements - both
built-in and custom.
Example:
interface IMyAttrs
{
foo: string;
bar: number;
}
type MyExtendedAttrs = ExtendedAttrs<IMyAttrs>;
// the MyExtendedEvents is equivalent to the following interface
interface MyExtendedAttrs
{
foo: string | ITrigger<string> | null | undefined;
bar: number | ITrigger<number> | null | undefined;
}
Represents intrinsic element attributes, events and children known to Mimbl infrastucture. Each
built-in or custom element is defined as a JSX intrinsic element using the ExtendedElement
type by passing the correct attribute, event and children types.
Type that can be passed to the ref
attribute to get a reference to the
element.
Type listing element's event names mapped to event types. Most elements don't need to specify this type parameter as they only implement standard events; however, there are some elements - e.g.
Type that determines what children are allowed under the element. It
defaults to any
and usually doesn't need to be specified.
Converts the given interface T to a type that maps an event type to each property of T. If
the property is iself an event (that is, derives from the Event interface), this event
becomes the type of the mapped property. Otherwise, the property is mapped to a CustomEvent
type whose detail
property is defined as the original property type.
Example:
interface IMyEvents
{
foo: string;
bar: number;
baz: MouseEvent;
}
type MyExtendedEvents = ExtendedEvents<IMyEvents>;
// the MyExtendedEvents is equivalent to the following interface
interface MyExtendedEvents
{
foo: CustomEvent<string>;
bar: CustomEvent<number>;
baz: MouseEvent;
}
Internal type containing names of attributes that are not "triggerized" when applying the ExtendedAttrs type to the element attributes interface.
Defines event handler that is invoked when reference value changes.
Type of ref property value. This can be either the {@link IRef]] interface or [[RefFunc} function or the type itself.
Type of ref property that can be passed to JSX elements and components. This can be either the {@link IRef]] interface or [[RefFunc} function.
Definition of type of method that renders content.
Type of functions scheduled to be called either before or after the update cycle.
The UpdateStrategy object specifies different aspects of update behavior of components and elements.
Flag determining whether or not non-matching new keyed sub-nodes are allowed to recycle non- matching old keyed sub-nodes. Here "non-matching" means those new or old nodes with keys for which no old or new sub-nodes with the same key were found. If this flag is true, then non-matching old sub-nodes will be removed and non-matching new sub-nodes will be inserted. If this flag is false, then non-matching old sub-nodes will be updated by the non-matching new sub-nodes - provided that the types of sub-nodes are the same.
If keyed sub-nodes recycling is enabled it can speed up an update process because less DOM nodes get removed and inserted, which is more expensive than updating. However, this can have some adverse effects under cirtain circumstances if certain data is bound to the particular instances of DOM nodes.
The flag's default value is false, that is, recycling is enabled.
Flag determining whether the reconciliation procedure should not pay attention to the keys. This flag is complimentary to the disableKeyedNodeRecycling flag and take effect only if the latter is false (or undefined). When the ignoreKeys flag is false (default) we try to match new sub-nodes to old ones using keys. Setting the ignoreKeys flag to true completely ignores keys and the matching is done by going through the lists of the new and old sub-nodes sequentially. Under certain circumstances this may speed up the reconciliation process
The flag's default value is false, that is, keys are used for matching the nodes.
Type that can be passed as a callback to a component's property. It allows passing a callback in one of the following forms:
this
parameter is properly set up when the callback is invoked.this
parameter.func
specifying the function to be called andthisArg
specifying the value to be used as thethis
parameter.