@lytjs/renderer 6.9.0 → 6.9.1
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.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/vapor/vapor-app.cjs +4 -0
- package/dist/vapor/vapor-app.cjs.map +1 -1
- package/dist/vapor/vapor-app.mjs +4 -0
- package/dist/vapor/vapor-app.mjs.map +1 -1
- package/package.json +16 -16
- package/dist/dom.d.cts +0 -1
- package/dist/dom.d.ts +0 -1
- package/dist/index.d.cts +0 -965
- package/dist/index.d.ts +0 -965
- package/dist/ssr.d.cts +0 -21
- package/dist/ssr.d.ts +0 -21
- package/dist/vapor/vapor-app.d.cts +0 -88
- package/dist/vapor/vapor-app.d.ts +0 -88
package/dist/ssr.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VNode } from '@lytjs/vdom';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @lytjs/renderer - SSR 渲染器
|
|
5
|
-
* 服务端渲染为字符串
|
|
6
|
-
* FIX: P2-36 使用共享工具函数
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
interface SSRInput {
|
|
10
|
-
vnode: VNode;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 将 VNode 渲染为 HTML 字符串。
|
|
14
|
-
*
|
|
15
|
-
* 返回 Promise 以支持未来的 Suspense/异步组件。
|
|
16
|
-
* 当组件包含异步子组件(如 Suspense 边界)时,
|
|
17
|
-
* 渲染过程需要等待异步数据加载完成后才能输出 HTML。
|
|
18
|
-
*/
|
|
19
|
-
declare function renderToString(input: SSRInput): Promise<string>;
|
|
20
|
-
|
|
21
|
-
export { type SSRInput, renderToString };
|
package/dist/ssr.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VNode } from '@lytjs/vdom';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @lytjs/renderer - SSR 渲染器
|
|
5
|
-
* 服务端渲染为字符串
|
|
6
|
-
* FIX: P2-36 使用共享工具函数
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
interface SSRInput {
|
|
10
|
-
vnode: VNode;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 将 VNode 渲染为 HTML 字符串。
|
|
14
|
-
*
|
|
15
|
-
* 返回 Promise 以支持未来的 Suspense/异步组件。
|
|
16
|
-
* 当组件包含异步子组件(如 Suspense 边界)时,
|
|
17
|
-
* 渲染过程需要等待异步数据加载完成后才能输出 HTML。
|
|
18
|
-
*/
|
|
19
|
-
declare function renderToString(input: SSRInput): Promise<string>;
|
|
20
|
-
|
|
21
|
-
export { type SSRInput, renderToString };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/** Vapor 组件的上下文对象 */
|
|
2
|
-
interface VaporContext {
|
|
3
|
-
attrs: Record<string, unknown>;
|
|
4
|
-
slots: Record<string, () => Node>;
|
|
5
|
-
emit: (event: string, ...args: unknown[]) => void;
|
|
6
|
-
}
|
|
7
|
-
/** Prop 定义选项 */
|
|
8
|
-
interface PropOptions {
|
|
9
|
-
type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function';
|
|
10
|
-
default?: unknown;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
validator?: (value: unknown) => boolean;
|
|
13
|
-
}
|
|
14
|
-
/** Vapor 组件定义选项 */
|
|
15
|
-
interface VaporComponentOptions {
|
|
16
|
-
name?: string;
|
|
17
|
-
props?: Record<string, PropOptions>;
|
|
18
|
-
setup?: (props: Record<string, unknown>, context: VaporContext) => Record<string, unknown> | void;
|
|
19
|
-
template: string;
|
|
20
|
-
}
|
|
21
|
-
/** Vapor 组件定义(编译后的结果) */
|
|
22
|
-
interface VaporComponentDefinition {
|
|
23
|
-
name?: string;
|
|
24
|
-
props?: Record<string, PropOptions>;
|
|
25
|
-
setup?: (props: Record<string, unknown>, context: VaporContext) => Record<string, unknown> | void;
|
|
26
|
-
template: string;
|
|
27
|
-
compiledCode?: string;
|
|
28
|
-
}
|
|
29
|
-
/** Vapor 应用配置选项 */
|
|
30
|
-
interface VaporAppOptions {
|
|
31
|
-
/** 根容器属性(传递给根组件的 props) */
|
|
32
|
-
rootProps?: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
/** Vapor 应用实例 */
|
|
35
|
-
interface VaporApp {
|
|
36
|
-
mount(container: Element | string): void;
|
|
37
|
-
unmount(): void;
|
|
38
|
-
provide(key: string | symbol, value: unknown): void;
|
|
39
|
-
component(name: string, component: VaporComponentDefinition): VaporApp;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* 定义一个 Vapor 模式的组件
|
|
43
|
-
*
|
|
44
|
-
* 将模板编译结果缓存到闭包中,返回组件定义对象。
|
|
45
|
-
*
|
|
46
|
-
* @param options - 组件定义选项
|
|
47
|
-
* @returns VaporComponentDefinition
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* const MyComponent = defineVaporComponent({
|
|
52
|
-
* name: 'MyComponent',
|
|
53
|
-
* props: {
|
|
54
|
-
* message: { type: String, default: 'hello' }
|
|
55
|
-
* },
|
|
56
|
-
* setup(props, { emit }) {
|
|
57
|
-
* return { count: 0, onClick: () => emit('click') };
|
|
58
|
-
* },
|
|
59
|
-
* template: '<div @click="onClick">{{ message }}</div>'
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
declare function defineVaporComponent(options: VaporComponentOptions): VaporComponentDefinition;
|
|
64
|
-
/**
|
|
65
|
-
* 创建一个 Vapor 模式的应用实例
|
|
66
|
-
*
|
|
67
|
-
* 内部使用 createSignalRenderer 进行渲染。
|
|
68
|
-
*
|
|
69
|
-
* @param rootComponent - 根组件定义
|
|
70
|
-
* @param options - 应用配置选项
|
|
71
|
-
* @returns VaporApp 实例
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```ts
|
|
75
|
-
* const App = defineVaporComponent({
|
|
76
|
-
* template: '<div>{{ message }}</div>',
|
|
77
|
-
* setup() {
|
|
78
|
-
* return { message: 'Hello Vapor' };
|
|
79
|
-
* }
|
|
80
|
-
* });
|
|
81
|
-
*
|
|
82
|
-
* const app = createVaporApp(App);
|
|
83
|
-
* app.mount('#app');
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
declare function createVaporApp(rootComponent: VaporComponentDefinition, options?: VaporAppOptions): VaporApp;
|
|
87
|
-
|
|
88
|
-
export { type PropOptions, type VaporApp, type VaporAppOptions, type VaporComponentDefinition, type VaporComponentOptions, type VaporContext, createVaporApp, defineVaporComponent };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/** Vapor 组件的上下文对象 */
|
|
2
|
-
interface VaporContext {
|
|
3
|
-
attrs: Record<string, unknown>;
|
|
4
|
-
slots: Record<string, () => Node>;
|
|
5
|
-
emit: (event: string, ...args: unknown[]) => void;
|
|
6
|
-
}
|
|
7
|
-
/** Prop 定义选项 */
|
|
8
|
-
interface PropOptions {
|
|
9
|
-
type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function';
|
|
10
|
-
default?: unknown;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
validator?: (value: unknown) => boolean;
|
|
13
|
-
}
|
|
14
|
-
/** Vapor 组件定义选项 */
|
|
15
|
-
interface VaporComponentOptions {
|
|
16
|
-
name?: string;
|
|
17
|
-
props?: Record<string, PropOptions>;
|
|
18
|
-
setup?: (props: Record<string, unknown>, context: VaporContext) => Record<string, unknown> | void;
|
|
19
|
-
template: string;
|
|
20
|
-
}
|
|
21
|
-
/** Vapor 组件定义(编译后的结果) */
|
|
22
|
-
interface VaporComponentDefinition {
|
|
23
|
-
name?: string;
|
|
24
|
-
props?: Record<string, PropOptions>;
|
|
25
|
-
setup?: (props: Record<string, unknown>, context: VaporContext) => Record<string, unknown> | void;
|
|
26
|
-
template: string;
|
|
27
|
-
compiledCode?: string;
|
|
28
|
-
}
|
|
29
|
-
/** Vapor 应用配置选项 */
|
|
30
|
-
interface VaporAppOptions {
|
|
31
|
-
/** 根容器属性(传递给根组件的 props) */
|
|
32
|
-
rootProps?: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
/** Vapor 应用实例 */
|
|
35
|
-
interface VaporApp {
|
|
36
|
-
mount(container: Element | string): void;
|
|
37
|
-
unmount(): void;
|
|
38
|
-
provide(key: string | symbol, value: unknown): void;
|
|
39
|
-
component(name: string, component: VaporComponentDefinition): VaporApp;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* 定义一个 Vapor 模式的组件
|
|
43
|
-
*
|
|
44
|
-
* 将模板编译结果缓存到闭包中,返回组件定义对象。
|
|
45
|
-
*
|
|
46
|
-
* @param options - 组件定义选项
|
|
47
|
-
* @returns VaporComponentDefinition
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* const MyComponent = defineVaporComponent({
|
|
52
|
-
* name: 'MyComponent',
|
|
53
|
-
* props: {
|
|
54
|
-
* message: { type: String, default: 'hello' }
|
|
55
|
-
* },
|
|
56
|
-
* setup(props, { emit }) {
|
|
57
|
-
* return { count: 0, onClick: () => emit('click') };
|
|
58
|
-
* },
|
|
59
|
-
* template: '<div @click="onClick">{{ message }}</div>'
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
declare function defineVaporComponent(options: VaporComponentOptions): VaporComponentDefinition;
|
|
64
|
-
/**
|
|
65
|
-
* 创建一个 Vapor 模式的应用实例
|
|
66
|
-
*
|
|
67
|
-
* 内部使用 createSignalRenderer 进行渲染。
|
|
68
|
-
*
|
|
69
|
-
* @param rootComponent - 根组件定义
|
|
70
|
-
* @param options - 应用配置选项
|
|
71
|
-
* @returns VaporApp 实例
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```ts
|
|
75
|
-
* const App = defineVaporComponent({
|
|
76
|
-
* template: '<div>{{ message }}</div>',
|
|
77
|
-
* setup() {
|
|
78
|
-
* return { message: 'Hello Vapor' };
|
|
79
|
-
* }
|
|
80
|
-
* });
|
|
81
|
-
*
|
|
82
|
-
* const app = createVaporApp(App);
|
|
83
|
-
* app.mount('#app');
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
declare function createVaporApp(rootComponent: VaporComponentDefinition, options?: VaporAppOptions): VaporApp;
|
|
87
|
-
|
|
88
|
-
export { type PropOptions, type VaporApp, type VaporAppOptions, type VaporComponentDefinition, type VaporComponentOptions, type VaporContext, createVaporApp, defineVaporComponent };
|