UNPKG

@kubb/react

Version:

React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.

1 lines 1.44 kB
{"version":3,"sources":["../src/types.ts"],"names":["init_cjs_shims"],"mappings":";;;;;AAAAA,gCAAA,EAAA","file":"types.cjs","sourcesContent":["import type { ReactNode } from 'react'\ntype ReactElementNames = 'br' | 'div'\n\nexport type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'\n\ntype Node = {\n parentNode: DOMElement | undefined\n internal_static?: boolean\n}\n\nexport type DOMNodeAttribute = boolean | string | number\n\ntype TextName = '#text'\nexport type TextNode = {\n nodeName: TextName\n nodeValue: string\n} & Node\n\nexport type DOMNode<T = { nodeName: NodeNames }> = T extends {\n nodeName: infer U\n}\n ? U extends '#text'\n ? TextNode\n : DOMElement\n : never\n\ntype OutputTransformer = (s: string, index: number) => string\n\nexport type DOMElement = {\n nodeName: ElementNames\n attributes: Record<string, DOMNodeAttribute>\n childNodes: DOMNode[]\n internal_transform?: OutputTransformer\n\n // Internal properties\n isStaticDirty?: boolean\n staticNode?: DOMElement\n onComputeLayout?: () => void\n onRender?: () => void\n onImmediateRender?: () => void\n} & Node\n\ntype NodeNames = ElementNames | TextName\n\nexport type KubbNode = ReactNode\n\nexport type { Key } from 'react'\n\nexport type JSDoc = {\n comments: string[]\n}\n\nexport type { Params, Param } from './utils/getFunctionParams.ts'\n"]}