Options
All
  • Public
  • Public/Protected
  • All
Menu

The IClassCompVN interface represents a virtual node for a JSX-based component.

Hierarchy

Index

Properties

Optional Readonly comp

comp?: IComponent<{}, {}>

Gets the component instance.

Optional Readonly creator

creator?: null | IComponent<{}, {}>

Component that created this node.

Optional Readonly depth

depth?: number

Level of nesting at which the node resides relative to the root node.

Readonly index

index: number

Zero-based index of this node in the parent's list of sub-nodes. This is zero for the root nodes that don't have parents.

Optional Readonly name

name?: string

Gets node's display name. This is used mostly for tracing and error reporting. The name can change during the lifetime of the virtual node; for example, it can reflect an "id" property of an element.

Optional Readonly parent

parent?: null | IVNode

Gets node's parent. This is undefined for the top-level (root) nodes.

Readonly props

props: any

Object that is used mainly by the managed components. It keeps the properties first passed to the componet's constructor and then changed when the component is updated through its parent updates.

Optional Readonly shadowRoot

shadowRoot?: ShadowRoot

If the component specifies the {@link shadow} property, the shadowRoot property will be set to the shadow root element under which the component's content returned from the render() method will be placed. If the component doesn't specify the {@link shadow} property, the shadowRoot property will be undefined. Components can access the shadow root via their vn.shadowRoot property.

Optional Readonly subNodes

subNodes?: null | IVNode[]

List of sub-nodes.

Methods

getService

  • Retrieves the value for a service with the given ID registered by a closest ancestor component or the default value if none of the ancestor components registered a service with this ID. This method doesn't establish a subscription and only reflects the current state.

    Type parameters

    • K: "ErrorBoundary"

    Parameters

    • id: K

      Unique service identifier

    • Optional defaultValue: IServiceDefinitions[K]

      Default value to return if no publish service is found.

    • Optional useSelf: boolean

      Flag indicating whether the search for the service should start from the virtual node that calls this method. The default value is false meaning the search starts from the parent virtual node.

    Returns IServiceDefinitions[K]

    Current value of the service or default value if no published service is found.

updateMe

  • updateMe(): void
  • This method is called by the component to request to be updated.

    Returns void