1 | import { VNode, ComponentInternalInstance, App, Slots, Component, ComponentPublicInstance, Directive } from 'vue';
|
---|
2 | import { Readable, Writable } from 'node:stream';
|
---|
3 | export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared';
|
---|
4 |
|
---|
5 | type SSRBuffer = SSRBufferItem[] & {
|
---|
6 | hasAsync?: boolean;
|
---|
7 | };
|
---|
8 | type SSRBufferItem = string | SSRBuffer | Promise<SSRBuffer>;
|
---|
9 | type PushFn = (item: SSRBufferItem) => void;
|
---|
10 | type Props = Record<string, unknown>;
|
---|
11 | export type SSRContext = {
|
---|
12 | [key: string]: any;
|
---|
13 | teleports?: Record<string, string>;
|
---|
14 | };
|
---|
15 | export declare function renderVNode(push: PushFn, vnode: VNode, parentComponent: ComponentInternalInstance, slotScopeId?: string): void;
|
---|
16 |
|
---|
17 | export declare function renderToString(input: App | VNode, context?: SSRContext): Promise<string>;
|
---|
18 |
|
---|
19 | export interface SimpleReadable {
|
---|
20 | push(chunk: string | null): void;
|
---|
21 | destroy(err: any): void;
|
---|
22 | }
|
---|
23 | export declare function renderToSimpleStream<T extends SimpleReadable>(input: App | VNode, context: SSRContext, stream: T): T;
|
---|
24 | /**
|
---|
25 | * @deprecated
|
---|
26 | */
|
---|
27 | export declare function renderToStream(input: App | VNode, context?: SSRContext): Readable;
|
---|
28 | export declare function renderToNodeStream(input: App | VNode, context?: SSRContext): Readable;
|
---|
29 | export declare function pipeToNodeWritable(input: App | VNode, context: SSRContext | undefined, writable: Writable): void;
|
---|
30 | export declare function renderToWebStream(input: App | VNode, context?: SSRContext): ReadableStream;
|
---|
31 | export declare function pipeToWebWritable(input: App | VNode, context: SSRContext | undefined, writable: WritableStream): void;
|
---|
32 |
|
---|
33 | type SSRSlots = Record<string, SSRSlot>;
|
---|
34 | type SSRSlot = (props: Props, push: PushFn, parentComponent: ComponentInternalInstance | null, scopeId: string | null) => void;
|
---|
35 | export declare function ssrRenderSlot(slots: Slots | SSRSlots, slotName: string, slotProps: Props, fallbackRenderFn: (() => void) | null, push: PushFn, parentComponent: ComponentInternalInstance, slotScopeId?: string): void;
|
---|
36 | export declare function ssrRenderSlotInner(slots: Slots | SSRSlots, slotName: string, slotProps: Props, fallbackRenderFn: (() => void) | null, push: PushFn, parentComponent: ComponentInternalInstance, slotScopeId?: string, transition?: boolean): void;
|
---|
37 |
|
---|
38 | export declare function ssrRenderComponent(comp: Component, props?: Props | null, children?: Slots | SSRSlots | null, parentComponent?: ComponentInternalInstance | null, slotScopeId?: string): SSRBuffer | Promise<SSRBuffer>;
|
---|
39 |
|
---|
40 | export declare function ssrRenderTeleport(parentPush: PushFn, contentRenderFn: (push: PushFn) => void, target: string, disabled: boolean, parentComponent: ComponentInternalInstance): void;
|
---|
41 |
|
---|
42 | export declare function ssrRenderAttrs(props: Record<string, unknown>, tag?: string): string;
|
---|
43 | export declare function ssrRenderDynamicAttr(key: string, value: unknown, tag?: string): string;
|
---|
44 | export declare function ssrRenderAttr(key: string, value: unknown): string;
|
---|
45 | export declare function ssrRenderClass(raw: unknown): string;
|
---|
46 | export declare function ssrRenderStyle(raw: unknown): string;
|
---|
47 |
|
---|
48 | export declare function ssrInterpolate(value: unknown): string;
|
---|
49 |
|
---|
50 | export declare function ssrRenderList(source: unknown, renderItem: (value: unknown, key: string | number, index?: number) => void): void;
|
---|
51 |
|
---|
52 | export declare function ssrRenderSuspense(push: PushFn, { default: renderContent }: Record<string, (() => void) | undefined>): Promise<void>;
|
---|
53 |
|
---|
54 | export declare function ssrGetDirectiveProps(instance: ComponentPublicInstance, dir: Directive, value?: any, arg?: string, modifiers?: Record<string, boolean>): Record<string, any>;
|
---|
55 |
|
---|
56 | export declare const ssrLooseEqual: (a: unknown, b: unknown) => boolean;
|
---|
57 | export declare function ssrLooseContain(arr: unknown[], value: unknown): boolean;
|
---|
58 | export declare function ssrRenderDynamicModel(type: unknown, model: unknown, value: unknown): string;
|
---|
59 | export declare function ssrGetDynamicModelProps(existingProps: any, model: unknown): {
|
---|
60 | checked: true;
|
---|
61 | } | {
|
---|
62 | value: any;
|
---|
63 | } | null;
|
---|
64 |
|
---|
65 | export { renderVNode as ssrRenderVNode };
|
---|