API Reference

Qingkuai's API is organized by entry package, making on-demand imports easy and keeping responsibility boundaries clear. This article lists the public APIs exported from the source entry files of two packages: the runtime package qingkuai and the compiler package qingkuai/compiler.

TIP

The internal package qingkuai/internal is mainly intended for framework internals, and application code is generally not recommended to depend on it directly, so it is not covered here.


Runtime

The runtime package exports APIs for component lifecycle methods, contexts, reactive side effects, performance optimization, and state conversion.

Type Exports

See: Utility Types

Lifecycle

See: Lifecycle. Note that inside component files these methods are built-in methods and can be called directly without importing. When importing them from the runtime package, the target component instance must be explicitly passed as the first argument.

Side Effects and Watchers

See: Watchers and Side Effects. Like the lifecycle methods, when importing them from the runtime package, the first argument is the component instance or null.

Contexts

Used to operate on the contexts of a specific component instance in external logic: setContext writes a value into the target instance's contexts layer, setContextGetter writes a reactive getter, and getContexts returns the contexts chain-head object of the target instance. Inside component files, use the built-in methods setContext, setContextExp, and setContextGetter together with the built-in identifier contexts instead.

See: Contexts

Reactivity Optimization Controls

State and Scheduling

Other Exports


Compiler (qingkuai/compiler)

The compiler package is used to parse and compile component source code. It is mainly consumed by build tools, language services, and plugin ecosystems.

Type Exports

Constants Object

The constants object exported by the compiler package contains the following properties:

Utility Object

The util object exported by the compiler package contains the following properties:

Flags

Methods


Edit this page on github (This page has been translated from the Chinese version of the site. There may be inaccuracies in the translation. We welcome your help to improve the accuracy of this document.)