ssr.ts 523 B

123456789101112131415161718192021222324252627
  1. import VNode from '../src/core/vdom/vnode'
  2. import { Component } from './component'
  3. export type ComponentWithCacheContext = {
  4. type: 'ComponentWithCache'
  5. bufferIndex: number
  6. buffer: Array<string>
  7. key: string
  8. }
  9. export type ElementContext = {
  10. type: 'Element'
  11. children: Array<VNode>
  12. rendered: number
  13. endTag: string
  14. total: number
  15. }
  16. export type ComponentContext = {
  17. type: 'Component'
  18. prevActive: Component
  19. }
  20. export type RenderState =
  21. | ComponentContext
  22. | ComponentWithCacheContext
  23. | ElementContext