@lytjs/core-signal 6.9.2 → 6.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +60 -0
- package/dist/index.d.ts +60 -0
- package/package.json +9 -9
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { BaseAppConfig, Directive, DebuggerEvent } from '@lytjs/shared-types';
|
|
2
|
+
export { DebuggerEvent, Directive, DirectiveArguments, DirectiveBinding } from '@lytjs/shared-types';
|
|
3
|
+
import { ComponentPublicInstance, ComponentOptions } from '@lytjs/component';
|
|
4
|
+
export { ComponentOptions, ComponentPublicInstance, onBeforeMount, onBeforeUnmount, onErrorCaptured, onMounted, onUnmounted } from '@lytjs/component';
|
|
5
|
+
export { nextTick } from '@lytjs/common-scheduler';
|
|
6
|
+
export { ComputedSignal, ReadonlySignal, Signal, WritableSignal, computed, computedSignal, effect, reactive, readonlySignal, ref, set, signal, signalBatch, signalUntrack, update, valueOf, watch, watchEffect } from '@lytjs/reactivity';
|
|
7
|
+
export { compile } from '@lytjs/compiler';
|
|
8
|
+
export { CleanupFn, ReconcileOptions, addEventListener, batchDOM, bindEffect, createCleanupScope, createElement, createEventHandler, createTemplate, createTextNode, insert, onCleanup, reconcileArray, remove, removeAttribute, runCleanups, setAttribute, setClass, setHTML, setProperty, setStyle, setText, toggleClass } from '@lytjs/dom-runtime';
|
|
9
|
+
|
|
10
|
+
/** 插件安装函数签名 */
|
|
11
|
+
type PluginInstallFunction<T = unknown> = (app: App, ...options: T[]) => void;
|
|
12
|
+
interface App<HostElement = Element> {
|
|
13
|
+
config: AppConfig;
|
|
14
|
+
use(plugin: Plugin | PluginInstallFunction, ...options: unknown[]): App;
|
|
15
|
+
mount(rootContainer: HostElement | string): Promise<ComponentPublicInstance | null>;
|
|
16
|
+
unmount(): void;
|
|
17
|
+
provide<T = unknown>(key: string | symbol, value: T): App;
|
|
18
|
+
inject<T = unknown>(key: string | symbol, defaultValue?: T): T;
|
|
19
|
+
component(name: string, component: Component): App;
|
|
20
|
+
directive(name: string, directive: Directive): App;
|
|
21
|
+
mixin(mixin: ComponentOptions): App;
|
|
22
|
+
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
23
|
+
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
24
|
+
}
|
|
25
|
+
interface AppConfig extends BaseAppConfig {
|
|
26
|
+
performance: boolean;
|
|
27
|
+
globalProperties: Record<string, unknown>;
|
|
28
|
+
isCustomElement?: (tag: string) => boolean;
|
|
29
|
+
compilerOptions?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
/** createApp 的配置选项(Signal 模式固定使用 signal 渲染,忽略 rendererMode) */
|
|
32
|
+
interface AppOptions {
|
|
33
|
+
/** Signal 模式下此选项被忽略,始终使用 Signal 渲染 */
|
|
34
|
+
rendererMode?: 'signal' | 'vapor';
|
|
35
|
+
}
|
|
36
|
+
interface Plugin {
|
|
37
|
+
install: PluginInstallFunction;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Signal 模式下的组件类型
|
|
41
|
+
* 必须包含 template 属性,可选包含 data、setup、生命周期钩子
|
|
42
|
+
*/
|
|
43
|
+
type Component = ComponentOptions & {
|
|
44
|
+
template?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type ErrorCapturedHook = (err: Error, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
48
|
+
type DebuggerHook = (event: DebuggerEvent) => void;
|
|
49
|
+
|
|
50
|
+
declare function createApp(rootComponent: Component, rootProps?: Record<string, unknown> | null, _options?: AppOptions): App;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 定义组件(re-export from @lytjs/component)
|
|
54
|
+
*
|
|
55
|
+
* Signal 模式下,组件应包含 template 属性。
|
|
56
|
+
* defineComponent 主要用于类型标注和 IDE 提示。
|
|
57
|
+
*/
|
|
58
|
+
declare const defineComponent: (options: ComponentOptions) => ComponentOptions;
|
|
59
|
+
|
|
60
|
+
export { type App, type AppConfig, type AppOptions, type Component, type DebuggerHook, type ErrorCapturedHook, type Plugin, createApp, defineComponent };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { BaseAppConfig, Directive, DebuggerEvent } from '@lytjs/shared-types';
|
|
2
|
+
export { DebuggerEvent, Directive, DirectiveArguments, DirectiveBinding } from '@lytjs/shared-types';
|
|
3
|
+
import { ComponentPublicInstance, ComponentOptions } from '@lytjs/component';
|
|
4
|
+
export { ComponentOptions, ComponentPublicInstance, onBeforeMount, onBeforeUnmount, onErrorCaptured, onMounted, onUnmounted } from '@lytjs/component';
|
|
5
|
+
export { nextTick } from '@lytjs/common-scheduler';
|
|
6
|
+
export { ComputedSignal, ReadonlySignal, Signal, WritableSignal, computed, computedSignal, effect, reactive, readonlySignal, ref, set, signal, signalBatch, signalUntrack, update, valueOf, watch, watchEffect } from '@lytjs/reactivity';
|
|
7
|
+
export { compile } from '@lytjs/compiler';
|
|
8
|
+
export { CleanupFn, ReconcileOptions, addEventListener, batchDOM, bindEffect, createCleanupScope, createElement, createEventHandler, createTemplate, createTextNode, insert, onCleanup, reconcileArray, remove, removeAttribute, runCleanups, setAttribute, setClass, setHTML, setProperty, setStyle, setText, toggleClass } from '@lytjs/dom-runtime';
|
|
9
|
+
|
|
10
|
+
/** 插件安装函数签名 */
|
|
11
|
+
type PluginInstallFunction<T = unknown> = (app: App, ...options: T[]) => void;
|
|
12
|
+
interface App<HostElement = Element> {
|
|
13
|
+
config: AppConfig;
|
|
14
|
+
use(plugin: Plugin | PluginInstallFunction, ...options: unknown[]): App;
|
|
15
|
+
mount(rootContainer: HostElement | string): Promise<ComponentPublicInstance | null>;
|
|
16
|
+
unmount(): void;
|
|
17
|
+
provide<T = unknown>(key: string | symbol, value: T): App;
|
|
18
|
+
inject<T = unknown>(key: string | symbol, defaultValue?: T): T;
|
|
19
|
+
component(name: string, component: Component): App;
|
|
20
|
+
directive(name: string, directive: Directive): App;
|
|
21
|
+
mixin(mixin: ComponentOptions): App;
|
|
22
|
+
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
23
|
+
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
24
|
+
}
|
|
25
|
+
interface AppConfig extends BaseAppConfig {
|
|
26
|
+
performance: boolean;
|
|
27
|
+
globalProperties: Record<string, unknown>;
|
|
28
|
+
isCustomElement?: (tag: string) => boolean;
|
|
29
|
+
compilerOptions?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
/** createApp 的配置选项(Signal 模式固定使用 signal 渲染,忽略 rendererMode) */
|
|
32
|
+
interface AppOptions {
|
|
33
|
+
/** Signal 模式下此选项被忽略,始终使用 Signal 渲染 */
|
|
34
|
+
rendererMode?: 'signal' | 'vapor';
|
|
35
|
+
}
|
|
36
|
+
interface Plugin {
|
|
37
|
+
install: PluginInstallFunction;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Signal 模式下的组件类型
|
|
41
|
+
* 必须包含 template 属性,可选包含 data、setup、生命周期钩子
|
|
42
|
+
*/
|
|
43
|
+
type Component = ComponentOptions & {
|
|
44
|
+
template?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type ErrorCapturedHook = (err: Error, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
48
|
+
type DebuggerHook = (event: DebuggerEvent) => void;
|
|
49
|
+
|
|
50
|
+
declare function createApp(rootComponent: Component, rootProps?: Record<string, unknown> | null, _options?: AppOptions): App;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 定义组件(re-export from @lytjs/component)
|
|
54
|
+
*
|
|
55
|
+
* Signal 模式下,组件应包含 template 属性。
|
|
56
|
+
* defineComponent 主要用于类型标注和 IDE 提示。
|
|
57
|
+
*/
|
|
58
|
+
declare const defineComponent: (options: ComponentOptions) => ComponentOptions;
|
|
59
|
+
|
|
60
|
+
export { type App, type AppConfig, type AppOptions, type Component, type DebuggerHook, type ErrorCapturedHook, type Plugin, createApp, defineComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lytjs/core-signal",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.4",
|
|
4
4
|
"description": "Lyt.js Core - Signal rendering mode only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dev": "tsup --watch"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@lytjs/component": "
|
|
26
|
-
"@lytjs/reactivity": "
|
|
27
|
-
"@lytjs/compiler": "
|
|
28
|
-
"@lytjs/renderer": "
|
|
29
|
-
"@lytjs/dom-runtime": "
|
|
30
|
-
"@lytjs/common-scheduler": "
|
|
31
|
-
"@lytjs/common-error": "
|
|
32
|
-
"@lytjs/shared-types": "
|
|
25
|
+
"@lytjs/component": "^6.9.4",
|
|
26
|
+
"@lytjs/reactivity": "^6.9.4",
|
|
27
|
+
"@lytjs/compiler": "^6.9.4",
|
|
28
|
+
"@lytjs/renderer": "^6.9.4",
|
|
29
|
+
"@lytjs/dom-runtime": "^6.9.4",
|
|
30
|
+
"@lytjs/common-scheduler": "^6.9.4",
|
|
31
|
+
"@lytjs/common-error": "^6.9.4",
|
|
32
|
+
"@lytjs/shared-types": "^6.9.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.5.1",
|