lemon_js_internal library
Internal integration API shared by Lemon JS packages and package tests.
Classes
- AxiosFeatures
- 将 Axios 与它所依赖的 Fetch/XHR 宿主能力打包为一个 JsFeatures。
- EssentialFeatures
- 提供低风险常用模块,当前包含 ES Module 与 CommonJS 的 Buffer。
- FetchFeatures
-
可选的 Fetch API features,由平台 HTTP 客户端提供
fetch实现。 -
JsAccessor<
T extends Object> - A dynamic JavaScript property backed by Dart getter/setter callbacks.
-
JsClass<
T extends Object> - Explicit descriptor for a Dart class exposed as a JavaScript constructor.
- JsClassHandle
- Runtime-owned handle to a JavaScript constructor binding.
- JsConsoleEvent
-
A single JavaScript
console.*event emitted by one JsEngine runtime. - JsEngine
- QuickJS 的公开 Dart 入口。
- JsFeatures
- Named bundle of environment patches, modules, and host methods.
- JsFunctionHandle
- Runtime-owned handle to a JavaScript function.
- JsGlobals
- Browser-like global aliases that can be explicitly installed into a runtime.
- JsHostMethod
- 创建时注入并在引擎重建后恢复的 Dart 宿主方法。
- JsHostMethodContext
- 一次异步宿主方法调用的生命周期上下文。
- JsHostMethodDebugInfo
- Structured host-method metadata exposed by the inspector prototype.
- JsHttpSession
- 可由多个 Fetch/XHR 请求复用的宿主网络会话。
- JsInspectorSnapshot
- Runtime debug snapshot exposed by the inspector prototype.
- JsKvStore
- 可替换的异步命名空间 KV 存储。
-
JsMembers<
T extends Object> - Explicit descriptor for members of a Dart object or class exposed to JavaScript.
- JsMemoryKvStore
- 适合测试和临时 Session 的内存 KV 实现。
-
JsMethod<
T extends Object> - A Promise-returning JavaScript method backed by a Dart callback.
- JsModule
- 显式注册到 runtime 的 JavaScript 模块描述。
-
JsObject<
T extends Object> - An existing Dart object exposed to JavaScript.
- JsObjectHandle
- Runtime-owned handle to a JavaScript object proxy.
- JsOptions
- Resource and execution-queue limits used when creating a QuickJS runtime.
- JsPlugin
- Explicit plugin package made from a manifest and a module graph.
- JsPluginClient
- Lightweight client for one plugin mounted in a JsPluginHost.
- JsPluginDebugInfo
- Structured loaded-plugin metadata exposed by the inspector prototype.
- JsPluginHost
- Minimal execution contract shared by standalone engines and child contexts.
- JsPluginManifest
- Manifest describing a JavaScript plugin contract.
- JsPluginModule
- One ES module inside a JsPlugin.
- JsPluginRegistry
-
Registry for calling plugin exports through
pluginId.methodnames. - JsScript
- 安装到每个新建 runtime 的启动/引导 JavaScript 脚本描述。
- 使用 Flutter shared_preferences 提供的默认持久化 KV 实现。
- JsSourceLocation
- Original source location resolved from a source map.
- JsSourceMap
- 解析后的 JavaScript source map,用于将生成代码位置映射回原始源码。
- JsUndefined
-
JavaScript 的
undefined值。 - JsValue
- A fixed Dart value exposed as a readonly JavaScript property.
- JsZipPlugin
- Convenience loader for zipped JavaScript plugin packages.
- NodeFeatures
- 提供最小 Node-like 模块环境,不包含 fs、网络或完整 npm resolver。
- StorageFeatures
- 将一个已经绑定命名空间的 KV Store 暴露为 ES module。
- WebCryptoFeatures
- Optional Web Crypto compatibility features.
- WebFeatures
- 提供轻量浏览器全局环境,不包含网络、Web Crypto 或 DOM。
- WebSocketFeatures
- 不支持 WebSocket 宿主后端的平台占位能力。
Enums
- JsConsoleLevel
- JavaScript console method severity.
- JsErrorKind
- 宿主可以稳定判断的框架错误分类;不解释插件自己的业务错误内容。
- JsFeaturesConflictPolicy
- Conflict handling for JsEngine.loadFeatures.
- JsHostMethodImplementation
- 宿主方法的实现来源。
- JsModuleFormat
- Supported host module source formats.
- JsRuntimeState
-
JsEngine实例当前可观察的生命周期状态。
Extensions
- JsExceptionKind on JsException
- Stable error classification shared by every JsException.
- JsPluginInternalFeatures on JsPlugin
- Internal conversion used by packages that compose plugins into feature slots.
Functions
-
assetModuleLoader(
{AssetBundle? bundle, String prefix = ''}) → JsModuleLoader - Creates a JsModuleLoader backed by a Flutter AssetBundle.
Typedefs
-
JsCallback
= FutureOr<
Object?> Function(List<Object?> args) - Dart callback exposed to JavaScript by JsEngine.injectFunction.
-
JsClassConstructor<
T extends Object> = FutureOr< T> Function(List<Object?> args) - Creates a Dart instance for an injected JavaScript class.
-
JsConsoleSink
= FutureOr<
void> Function(JsConsoleEvent event) -
接收 JavaScript
console.log、console.warn和console.error事件。 -
JsGetter<
T extends Object> = FutureOr< Object?> Function(T target) - Callback backing an injected property getter.
-
JsHostMethodCallback
= FutureOr<
Object?> Function(List<Object?> args, JsHostMethodContext context) - 创建时注入的 Dart 宿主方法回调。
-
JsMemberCallback<
T extends Object> = FutureOr< Object?> Function(T target, List<Object?> args) - Callback backing an injected instance method.
-
JsModuleLoader
= FutureOr<
String?> Function(String name) - 按需懒加载未预先注册的 ES 模块源码。
-
JsSetter<
T extends Object> = FutureOr< void> Function(T target, Object? value) - Callback backing an injected property setter.
Exceptions / Errors
- JsCancelledException
-
JS 执行被
restart()或其他取消机制中断。 - JsException
- QuickJS 插件对外暴露的异常基类。
- JsOutOfMemoryException
- runtime 分配内存超过配置限制。
- JsQueueFullException
- runtime 的串行调用队列已经达到宿主配置的上限。
- JsRuntimeClosedException
- runtime 已经关闭后继续调用 API。
- JsRuntimeCrashException
- runtime worker 崩溃或异常退出。
- JsStackOverflowException
- runtime 调用栈超过配置限制。
- JsThrownException
- JavaScript 代码主动 throw 或求值异常时的错误。
- JsTimeoutException
- JS 执行超过调用方指定的 timeout。
- JsValueConversionException
-
eval()遇到无法直接映射为 Dart 值的 JS 值。