Skip to content

Commit

Permalink
refactor(tslint): Modify sfdx-falcon-types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
VivekMChawla committed Apr 6, 2019
1 parent 4bc7c2e commit 7e4240b
Showing 1 changed file with 105 additions and 37 deletions.
142 changes: 105 additions & 37 deletions src/modules/sfdx-falcon-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,32 @@
* @file modules/sfdx-falcon-types/index.d.ts
* @copyright Vivek M. Chawla - 2018
* @author Vivek M. Chawla <@VivekMChawla>
* @summary ???
* @description ???
* @summary Collection of interfaces and types used across SFDX-Falcon modules.
* @description Collection of interfaces and types used across SFDX-Falcon modules.
* @version 1.0.0
* @license MIT
*/
//─────────────────────────────────────────────────────────────────────────────────────────────────┘
// Import External Modules/Types
import {AnyJson} from '@salesforce/ts-types';
import {Observable} from 'rx';
import {AnyJson} from '@salesforce/ts-types';
import * as inquirer from 'inquirer';
import {Observable} from 'rx';

/**
* Represents the local config options for an AppX Demo project.
* TODO: Delete this interface if not used.
*/
/*
export interface AppxDemoLocalConfig {
demoValidationOrgAlias: string;
demoDeploymentOrgAlias: string;
devHubAlias: string;
envHubAlias: string;
}

}//*/
/**
* Represents the configuration schema of an AppX Demo Project.
*/
/*
export interface AppxDemoProjectConfig {
demoAlias: string;
demoConfig: string;
Expand All @@ -31,21 +40,32 @@ export interface AppxDemoProjectConfig {
partnerAlias: string;
partnerName: string;
schemaVersion: string;
}

}//*/
/**
* Represents the sequence options for an AppX Demo project
* TODO: Delete this if left unused.
*/
/*
export interface AppxDemoSequenceOptions {
scratchDefJson: string;
rebuildValidationOrg: boolean;
skipActions: [string];
}

}//*/
/**
* Represents local config settings for an APK (AppX Package) project
* TODO: Delete this if left unused.
*/
/*
export interface AppxPackageLocalConfig {
demoValidationOrgAlias: string;
demoDeploymentOrgAlias: string;
devHubAlias: string;
envHubAlias: string;
}

}//*/
/**
* TODO: Delete this if left unused.
*/
/*
export interface AppxPackageProjectConfig {
gitHubUrl: string;
gitRemoteUri: string;
Expand All @@ -62,26 +82,40 @@ export interface AppxPackageProjectConfig {
projectName: string;
projectType: string;
schemaVersion: string;
}

}//*/
/**
* TODO: Delete this if left unused
*/
/*
export interface AppxPackageSequenceOptions {
scratchDefJson: string;
}

}//*/
/**
* TODO: Delete this if left unused
*/
/*
export interface FalconConfig {
appxProject?: AppxPackageProjectConfig;
appxDemo?: AppxDemoProjectConfig;
}

}//*/
/**
* TODO: Delete this if left unused
*/
/*
export interface FalconCommandContext extends FalconSequenceContext {
commandObserver: any; // tslint:disable-line: no-any
}

// TODO: Need to finish defining FalconCommandHandler
}//*/
/**
* TODO: Delete this if left unused.
*/
/*
export interface FalconCommandHandler {
changeMe: string;
}

}//*/
/**
* Delete this if left unused.
*/
/*
export interface FalconCommandSequence {
sequenceName: string;
sequenceType: string;
Expand All @@ -91,15 +125,21 @@ export interface FalconCommandSequence {
sequenceGroups: [FalconCommandSequenceGroup];
handlers: [FalconCommandHandler];
schemaVersion: string;
}

}//*/
/**
* Delete this if left unused.
*/
/*
export interface FalconCommandSequenceGroup {
groupId: string;
groupName: string;
description: string;
sequenceSteps: FalconCommandSequenceStep[];
}

}//*/
/**
* Delete this if left unused.
*/
/*
export interface FalconCommandSequenceStep {
stepName: string;
description: string;
Expand All @@ -111,13 +151,24 @@ export interface FalconCommandSequenceStep {
onError?: {
handler: string;
};
}
}//*/

export type InquirerChoice = inquirer.objects.Choice;
export type InquirerChoices = inquirer.objects.Choices;
export type InquirerQuestion = inquirer.Question;
export type InquirerQuestions = inquirer.Questions;
export type InquirerAnswers = inquirer.Answers;
/**
* Represents the status code and JSON result that is sent to the caller when SFDX-Falcon CLI Commands are run.
*/
export interface SfdxFalconJsonResponse {
falconStatus: number;
falconResult: AnyJson;
}

/**
* Delete this if left unused.
*/
/*
export interface FalconSequenceContext {
devHubAlias: string;
targetOrgAlias: string;
Expand All @@ -128,33 +179,50 @@ export interface FalconSequenceContext {
dataPath: string;
logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
sequenceObserver: any; // tslint:disable-line: no-any
}

}//*/
/**
* Represents a Listr Task object that can be executed by a Listr Task Runner.
*/
export interface ListrTask {
title: string;
task: ListrTaskFunction;
skip?: boolean|ListrSkipFunction;
enabled?: boolean|ListrEnabledFunction;
}

/**
* Represents an "enabled" function for use in a Listr Task.
*/
export type ListrEnabledFunction =
(context?:any)=> boolean; // tslint:disable-line: no-any

/**
* Represents a "skip" function for use in a Listr Task.
*/
export type ListrSkipFunction =
(context?:any) => boolean|string|Promise<boolean|string>; // tslint:disable-line: no-any

/**
* Represents a "task" function for use in a Listr Task.
*/
export type ListrTaskFunction =
(context?:ListrContext, task?:ListrTask) => void|Promise<void>|Observable<any>; // tslint:disable-line: no-any

/**
* Represents the set of "execution options" related to the use of Listr.
*/
export interface ListrExecutionOptions {
listrContext: any; // tslint:disable-line: no-any
listrTask: any; // tslint:disable-line: no-any
observer: any; // tslint:disable-line: no-any
}

/**
* Represents the Listr "Context" that's passed to various functions set up inside Listr Tasks.
*/
export type ListrContext = any; // tslint:disable-line: no-any
/**
* Represents an Observable for use with Listr.
*/
export type ListrObservable = any; // tslint:disable-line: no-any

/**
* Enum that stores the various CLI log level flag values.
*/
export enum SfdxCliLogLevel {
TRACE = 'trace',
DEBUG = 'debug',
Expand Down

0 comments on commit 7e4240b

Please sign in to comment.