@kubb/core 5.0.0-alpha.31 → 5.0.0-alpha.32

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/KubbFile.ts DELETED
@@ -1,143 +0,0 @@
1
- type ImportName =
2
- | string
3
- | Array<
4
- | string
5
- | {
6
- propertyName: string
7
- name?: string
8
- }
9
- >
10
-
11
- export type Import = {
12
- /**
13
- * Import name to be used.
14
- * @example ["useState"]
15
- * @example "React"
16
- */
17
- name: ImportName
18
- /**
19
- * Path for the import.
20
- * @example '@kubb/core'
21
- */
22
- path: string
23
- /**
24
- * Add type-only import prefix.
25
- * - `true` generates `import type { Type } from './path'`
26
- * - `false` generates `import { Type } from './path'`
27
- * @default false
28
- */
29
- isTypeOnly?: boolean
30
- /**
31
- * Import entire module as namespace.
32
- * - `true` generates `import * as Name from './path'`
33
- * - `false` generates standard import
34
- * @default false
35
- */
36
- isNameSpace?: boolean
37
- /**
38
- * When root is set it will compute a relative path with `getRelativePath(root, path)`.
39
- */
40
- root?: string
41
- }
42
-
43
- export type Source = {
44
- name?: string
45
- value?: string
46
- /**
47
- * Make this source a type-only export.
48
- * @default false
49
- */
50
- isTypeOnly?: boolean
51
- /**
52
- * Include export keyword in source.
53
- * @default false
54
- */
55
- isExportable?: boolean
56
- /**
57
- * Include in barrel file generation.
58
- * @default false
59
- */
60
- isIndexable?: boolean
61
- }
62
-
63
- export type Export = {
64
- /**
65
- * Export name to be used.
66
- * @example ["useState"]
67
- * @example "React"
68
- */
69
- name?: string | Array<string>
70
- /**
71
- * Path for the export.
72
- * @example '@kubb/core'
73
- */
74
- path: string
75
- /**
76
- * Add type-only export prefix.
77
- * - `true` generates `export type { Type } from './path'`
78
- * - `false` generates `export { Type } from './path'`
79
- * @default false
80
- */
81
- isTypeOnly?: boolean
82
- /**
83
- * Export as aliased namespace.
84
- * - `true` generates `export * as aliasName from './path'`
85
- * - `false` generates standard export
86
- * @default false
87
- */
88
- asAlias?: boolean
89
- }
90
-
91
- export type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`
92
-
93
- export type Mode = 'single' | 'split'
94
-
95
- /**
96
- * Name to be used to dynamically create the baseName (based on input.path).
97
- * Based on UNIX basename.
98
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
99
- */
100
- export type BaseName = `${string}.${string}`
101
-
102
- /**
103
- * Fully qualified path to a specified file.
104
- */
105
- export type Path = string
106
-
107
- export type File<TMeta extends object = object> = {
108
- /**
109
- * Name used to create the path.
110
- * Based on UNIX basename, `${name}${extname}`.
111
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
112
- */
113
- baseName: BaseName
114
- /**
115
- * Fully qualified path to the file.
116
- */
117
- path: Path
118
- sources: Array<Source>
119
- imports: Array<Import>
120
- exports: Array<Export>
121
- /**
122
- * Extra metadata used for barrel/index file generation.
123
- */
124
- meta?: TMeta
125
- banner?: string
126
- footer?: string
127
- }
128
-
129
- export type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
130
- /**
131
- * Unique identifier, generated from a hash.
132
- * @default hash
133
- */
134
- id: string
135
- /**
136
- * First part of the `baseName`, derived from the file name.
137
- * @link https://nodejs.org/api/path.html#pathformatpathobject
138
- */
139
- name: string
140
- extname: Extname
141
- imports: Array<Import>
142
- exports: Array<Export>
143
- }