Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

server-renderer.d.ts 4.0KB

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