@kubb/renderer-jsx 5.0.0-beta.62 → 5.0.0-beta.64

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/src/types.ts DELETED
@@ -1,123 +0,0 @@
1
- import type { ArrowFunctionNode, ConstNode, ExportNode, FileNode, FunctionNode, ImportNode, SourceNode, TypeNode } from '@kubb/ast'
2
-
3
- /**
4
- * Unique key for a Kubb JSX element in lists or conditional renders.
5
- */
6
- export type Key = string | number | bigint
7
-
8
- /**
9
- * Element produced by a Kubb JSX component. The renderer walks these at runtime,
10
- * so the fields stay opaque to type-checking.
11
- */
12
- export type KubbReactElement = {
13
- type: unknown
14
- props: unknown
15
- key: Key | null
16
- }
17
-
18
- /**
19
- * Anything a Kubb JSX component accepts as children: an element, a primitive
20
- * rendered as text, a nullish value that is skipped, or an iterable of nodes.
21
- */
22
- export type KubbReactNode = KubbReactElement | string | number | bigint | boolean | null | undefined | Iterable<KubbReactNode>
23
-
24
- /**
25
- * Props for the `<kubb-jsx>` element.
26
- * Embeds a raw JSX string verbatim in generated output.
27
- */
28
- export type KubbJsxProps = {
29
- children?: string
30
- }
31
-
32
- /**
33
- * Props for the `<kubb-file>` element.
34
- * Represents a generated file.
35
- */
36
- export type KubbFileProps = {
37
- id?: string | null
38
- children?: KubbReactNode
39
- baseName: string
40
- path: string
41
- override?: boolean | null
42
- meta?: FileNode['meta'] | null
43
- }
44
-
45
- /**
46
- * Props for the `<kubb-source>` element.
47
- * Marks a block of source text associated with a file.
48
- */
49
- export type KubbSourceProps = Omit<SourceNode, 'kind'> & {
50
- children?: KubbReactNode
51
- }
52
-
53
- /**
54
- * Props for the `<kubb-import>` element.
55
- * Declares an import statement in the generated file.
56
- */
57
- export type KubbImportProps = Omit<ImportNode, 'kind'> & {}
58
-
59
- /**
60
- * Props for the `<kubb-export>` element.
61
- * Declares an export statement in the generated file.
62
- */
63
- export type KubbExportProps = Omit<ExportNode, 'kind'> & {}
64
-
65
- /**
66
- * Props for the `<kubb-function>` element.
67
- * Generates a function declaration.
68
- */
69
- export type KubbFunctionProps = Omit<FunctionNode, 'kind'> & {
70
- children?: KubbReactNode
71
- }
72
-
73
- /**
74
- * Props for the `<kubb-arrow-function>` element.
75
- * Generates an arrow function declaration.
76
- */
77
- export type KubbArrowFunctionProps = Omit<ArrowFunctionNode, 'kind'> & {
78
- children?: KubbReactNode
79
- }
80
-
81
- /**
82
- * Props for the `<kubb-const>` element.
83
- * Generates a constant declaration.
84
- */
85
- export type KubbConstProps = Omit<ConstNode, 'kind'> & {
86
- children?: KubbReactNode
87
- }
88
-
89
- /**
90
- * Props for the `<kubb-type>` element.
91
- * Generates a TypeScript type alias declaration.
92
- */
93
- export type KubbTypeProps = Omit<TypeNode, 'kind'> & {
94
- children?: KubbReactNode
95
- }
96
-
97
- /**
98
- * Props for the `<br>` element. It emits a single line break and takes no
99
- * attributes of its own.
100
- */
101
- export type LineBreakProps = {}
102
-
103
- /**
104
- * JSDoc comment block to attach to a generated declaration.
105
- * Each string in `comments` becomes one line inside the `/** … *\/` block.
106
- *
107
- * @example
108
- * ```ts
109
- * { comments: ['@description A pet object.', '@deprecated Use PetV2 instead.'] }
110
- * // Emits:
111
- * // /**
112
- * // * @description A pet object.
113
- * // * @deprecated Use PetV2 instead.
114
- * // *\/
115
- * ```
116
- */
117
- export type JSDoc = {
118
- /**
119
- * Lines to emit inside the JSDoc block, in source order.
120
- * Use standard JSDoc tags such as `@description`, `@deprecated`, `@see`, etc.
121
- */
122
- comments: Array<string>
123
- }