Skip to content

Commit 7e4240b

Browse files
committed
refactor(tslint): Modify sfdx-falcon-types
Commented out a large group of interfaces and types that were not in use. Need to decide later whether these are all useless artifacts from the early days of this project or if the types/interfaces were just moved to other files. Related to: #139
1 parent 4bc7c2e commit 7e4240b

File tree

1 file changed

+105
-37
lines changed

1 file changed

+105
-37
lines changed

src/modules/sfdx-falcon-types/index.ts

Lines changed: 105 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,32 @@
33
* @file modules/sfdx-falcon-types/index.d.ts
44
* @copyright Vivek M. Chawla - 2018
55
* @author Vivek M. Chawla <@VivekMChawla>
6-
* @summary ???
7-
* @description ???
6+
* @summary Collection of interfaces and types used across SFDX-Falcon modules.
7+
* @description Collection of interfaces and types used across SFDX-Falcon modules.
88
* @version 1.0.0
99
* @license MIT
1010
*/
1111
//─────────────────────────────────────────────────────────────────────────────────────────────────┘
1212
// Import External Modules/Types
13-
import {AnyJson} from '@salesforce/ts-types';
14-
import {Observable} from 'rx';
13+
import {AnyJson} from '@salesforce/ts-types';
14+
import * as inquirer from 'inquirer';
15+
import {Observable} from 'rx';
1516

17+
/**
18+
* Represents the local config options for an AppX Demo project.
19+
* TODO: Delete this interface if not used.
20+
*/
21+
/*
1622
export interface AppxDemoLocalConfig {
1723
demoValidationOrgAlias: string;
1824
demoDeploymentOrgAlias: string;
1925
devHubAlias: string;
2026
envHubAlias: string;
21-
}
22-
27+
}//*/
28+
/**
29+
* Represents the configuration schema of an AppX Demo Project.
30+
*/
31+
/*
2332
export interface AppxDemoProjectConfig {
2433
demoAlias: string;
2534
demoConfig: string;
@@ -31,21 +40,32 @@ export interface AppxDemoProjectConfig {
3140
partnerAlias: string;
3241
partnerName: string;
3342
schemaVersion: string;
34-
}
35-
43+
}//*/
44+
/**
45+
* Represents the sequence options for an AppX Demo project
46+
* TODO: Delete this if left unused.
47+
*/
48+
/*
3649
export interface AppxDemoSequenceOptions {
3750
scratchDefJson: string;
3851
rebuildValidationOrg: boolean;
3952
skipActions: [string];
40-
}
41-
53+
}//*/
54+
/**
55+
* Represents local config settings for an APK (AppX Package) project
56+
* TODO: Delete this if left unused.
57+
*/
58+
/*
4259
export interface AppxPackageLocalConfig {
4360
demoValidationOrgAlias: string;
4461
demoDeploymentOrgAlias: string;
4562
devHubAlias: string;
4663
envHubAlias: string;
47-
}
48-
64+
}//*/
65+
/**
66+
* TODO: Delete this if left unused.
67+
*/
68+
/*
4969
export interface AppxPackageProjectConfig {
5070
gitHubUrl: string;
5171
gitRemoteUri: string;
@@ -62,26 +82,40 @@ export interface AppxPackageProjectConfig {
6282
projectName: string;
6383
projectType: string;
6484
schemaVersion: string;
65-
}
66-
85+
}//*/
86+
/**
87+
* TODO: Delete this if left unused
88+
*/
89+
/*
6790
export interface AppxPackageSequenceOptions {
6891
scratchDefJson: string;
69-
}
70-
92+
}//*/
93+
/**
94+
* TODO: Delete this if left unused
95+
*/
96+
/*
7197
export interface FalconConfig {
7298
appxProject?: AppxPackageProjectConfig;
7399
appxDemo?: AppxDemoProjectConfig;
74-
}
75-
100+
}//*/
101+
/**
102+
* TODO: Delete this if left unused
103+
*/
104+
/*
76105
export interface FalconCommandContext extends FalconSequenceContext {
77106
commandObserver: any; // tslint:disable-line: no-any
78-
}
79-
80-
// TODO: Need to finish defining FalconCommandHandler
107+
}//*/
108+
/**
109+
* TODO: Delete this if left unused.
110+
*/
111+
/*
81112
export interface FalconCommandHandler {
82113
changeMe: string;
83-
}
84-
114+
}//*/
115+
/**
116+
* Delete this if left unused.
117+
*/
118+
/*
85119
export interface FalconCommandSequence {
86120
sequenceName: string;
87121
sequenceType: string;
@@ -91,15 +125,21 @@ export interface FalconCommandSequence {
91125
sequenceGroups: [FalconCommandSequenceGroup];
92126
handlers: [FalconCommandHandler];
93127
schemaVersion: string;
94-
}
95-
128+
}//*/
129+
/**
130+
* Delete this if left unused.
131+
*/
132+
/*
96133
export interface FalconCommandSequenceGroup {
97134
groupId: string;
98135
groupName: string;
99136
description: string;
100137
sequenceSteps: FalconCommandSequenceStep[];
101-
}
102-
138+
}//*/
139+
/**
140+
* Delete this if left unused.
141+
*/
142+
/*
103143
export interface FalconCommandSequenceStep {
104144
stepName: string;
105145
description: string;
@@ -111,13 +151,24 @@ export interface FalconCommandSequenceStep {
111151
onError?: {
112152
handler: string;
113153
};
114-
}
154+
}//*/
115155

156+
export type InquirerChoice = inquirer.objects.Choice;
157+
export type InquirerChoices = inquirer.objects.Choices;
158+
export type InquirerQuestion = inquirer.Question;
159+
export type InquirerQuestions = inquirer.Questions;
160+
export type InquirerAnswers = inquirer.Answers;
161+
/**
162+
* Represents the status code and JSON result that is sent to the caller when SFDX-Falcon CLI Commands are run.
163+
*/
116164
export interface SfdxFalconJsonResponse {
117165
falconStatus: number;
118166
falconResult: AnyJson;
119167
}
120-
168+
/**
169+
* Delete this if left unused.
170+
*/
171+
/*
121172
export interface FalconSequenceContext {
122173
devHubAlias: string;
123174
targetOrgAlias: string;
@@ -128,33 +179,50 @@ export interface FalconSequenceContext {
128179
dataPath: string;
129180
logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
130181
sequenceObserver: any; // tslint:disable-line: no-any
131-
}
132-
182+
}//*/
183+
/**
184+
* Represents a Listr Task object that can be executed by a Listr Task Runner.
185+
*/
133186
export interface ListrTask {
134187
title: string;
135188
task: ListrTaskFunction;
136189
skip?: boolean|ListrSkipFunction;
137190
enabled?: boolean|ListrEnabledFunction;
138191
}
139-
192+
/**
193+
* Represents an "enabled" function for use in a Listr Task.
194+
*/
140195
export type ListrEnabledFunction =
141196
(context?:any)=> boolean; // tslint:disable-line: no-any
142-
197+
/**
198+
* Represents a "skip" function for use in a Listr Task.
199+
*/
143200
export type ListrSkipFunction =
144201
(context?:any) => boolean|string|Promise<boolean|string>; // tslint:disable-line: no-any
145-
202+
/**
203+
* Represents a "task" function for use in a Listr Task.
204+
*/
146205
export type ListrTaskFunction =
147206
(context?:ListrContext, task?:ListrTask) => void|Promise<void>|Observable<any>; // tslint:disable-line: no-any
148-
207+
/**
208+
* Represents the set of "execution options" related to the use of Listr.
209+
*/
149210
export interface ListrExecutionOptions {
150211
listrContext: any; // tslint:disable-line: no-any
151212
listrTask: any; // tslint:disable-line: no-any
152213
observer: any; // tslint:disable-line: no-any
153214
}
154-
215+
/**
216+
* Represents the Listr "Context" that's passed to various functions set up inside Listr Tasks.
217+
*/
155218
export type ListrContext = any; // tslint:disable-line: no-any
219+
/**
220+
* Represents an Observable for use with Listr.
221+
*/
156222
export type ListrObservable = any; // tslint:disable-line: no-any
157-
223+
/**
224+
* Enum that stores the various CLI log level flag values.
225+
*/
158226
export enum SfdxCliLogLevel {
159227
TRACE = 'trace',
160228
DEBUG = 'debug',

0 commit comments

Comments
 (0)