Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

types.d.ts

116 lines2.1 KB

1import type {
2 StatusStepType,
3 AddOnOption,
4 AddOnOptions,
5} from '@tanstack/cta-engine'
6​
7export type ApplicationMode = 'add' | 'setup' | 'none'
8​
9export type StarterInfo = {
10 url: string
11 id: string
12 name: string
13 description: string
14 version: string
15 author: string
16 license: string
17 mode: string
18 typescript: boolean
19 tailwind: boolean
20 banner?: string
21 dependsOn?: Array<string>
23​
24// Files
25​
26export type DryRunOutput = {
27 files: Record<string, string>
28 commands: Array<{
29 command: string
30 args: Array<string>
31 }>
32 deletedFiles: Array<string>
34​
35export type AddOnInfo = {
36 id: string
37 name: string
38 description: string
39 type: 'add-on' | 'example' | 'starter' | 'toolchain' | 'deployment'
40 modes: Array<string>
41 smallLogo?: string
42 priority?: number
43 logo?: string
44 link: string
45 dependsOn?: Array<string>
46 options?: AddOnOptions
48​
49export type FileClass =
50 | 'unchanged'
51 | 'added'
52 | 'modified'
53 | 'deleted'
54 | 'overwritten'
55​
56export type FileTreeItem = TreeDataItem & {
57 contents: string
58 fullPath: string
59 fileClass: FileClass | undefined
60 originalFile?: string
61 modifiedFile?: string
63​
64export type Registry = {
65 starters: Array<{
66 name: string
67 description: string
68 url: string
69 banner?: string
70 }>
71 'add-ons': Array<{
72 name: string
73 description: string
74 url: string
75 }>
77​
78export type InitialData = {
79 supportedModes: Record<
80 string,
81 {
82 displayName: string
83 description: string
84 forceTypescript: boolean
85 }
86 >
87 options: SerializedOptions
88 output: GeneratorOutput
89 localFiles: Record<string, string>
90 addOns: Record<string, Array<AddOnInfo>>
91 applicationMode: ApplicationMode
92 showDeploymentOptions?: boolean
93 forcedRouterMode?: string
94 forcedAddOns?: Array<string>
95 registry?: Registry | undefined
97​
98export type EventItem = {
99 msgType: 'start'
100 id: string
101 type: StatusStepType
102 message: string
104export type EventFinish = {
105 msgType: 'finish'
106 id: string
107 message: string
109​
110export type StreamEvent = EventItem | EventFinish
111​
112export type StreamItem = {
113 id: string
114 icon: typeof FileIcon
115 message: string