Skip to content
Permalink
Browse files

fix: abstract base classes should implement shared type interfaces (#684

)

* fix: abstract base classes should implement shared type interfaces

ISSUES CLOSED: #683

* tslint doesn't like it when I indicate unused vars
  • Loading branch information
malept authored and MarshallOfSound committed Feb 8, 2019
1 parent 177012e commit d15a8cc23dfe562b73fdeb0aec2ce1c3090209a8
@@ -36,7 +36,7 @@ export interface MakerOptions {
packageJSON: any;
}

export default abstract class Maker<C> {
export default abstract class Maker<C> implements IForgeMaker {
public config!: C;
public abstract name: string;
public abstract defaultPlatforms: ForgePlatform[];
@@ -1,9 +1,9 @@
import { ForgeHookFn, StartOptions } from '@electron-forge/shared-types';
import { ForgeConfig, ForgeHookFn, IForgePlugin, StartOptions } from '@electron-forge/shared-types';
import { ChildProcess } from 'child_process';

export { StartOptions };

export default abstract class Plugin<C> {
export default abstract class Plugin<C> implements IForgePlugin {
public abstract name: string;
/* tslint:disable variable-name */
__isElectronForgePlugin!: true;
@@ -17,6 +17,9 @@ export default abstract class Plugin<C> {
});
}

init(dir: string, config: ForgeConfig) {
}

getHook(hookName: string): ForgeHookFn | null {
return null;
}
@@ -1,4 +1,4 @@
import { ForgePlatform, ForgeConfig, ForgeMakeResult } from '@electron-forge/shared-types';
import { ForgePlatform, ForgeConfig, ForgeMakeResult, IForgePublisher } from '@electron-forge/shared-types';

/* eslint-disable no-unused-vars */

@@ -19,7 +19,7 @@ export interface PublisherOptions {
forgeConfig: ForgeConfig;
}

export default abstract class Publisher<C> {
export default abstract class Publisher<C> implements IForgePublisher {
public abstract name: string;
public defaultPlatforms?: ForgePlatform[];
/* tslint:disable variable-name */
@@ -38,7 +38,7 @@ export default abstract class Publisher<C> {
get platforms() {
if (this.providedPlatforms) return this.providedPlatforms;
if (this.defaultPlatforms) return this.defaultPlatforms;
return ['win32', 'linux', 'darwin', 'mas'];
return ['win32', 'linux', 'darwin', 'mas'] as ForgePlatform[];
}

/**
@@ -60,7 +60,7 @@ export interface IForgePlugin {

init(dir: string, forgeConfig: ForgeConfig): void;
getHook?(hookName: string): ForgeHookFn | null;
startLogic?(opts: StartOptions): Promise<ChildProcess | false>;
startLogic?(opts: StartOptions): Promise<ChildProcess | string | string[] | false>;
}

export interface IForgeResolvableMaker {
@@ -71,7 +71,7 @@ export interface IForgeResolvableMaker {

export interface IForgeMaker {
__isElectronForgeMaker: boolean;
platforms?: undefined;
readonly platforms?: ForgePlatform[];
}

export interface IForgeResolvablePublisher {
@@ -82,7 +82,7 @@ export interface IForgeResolvablePublisher {

export interface IForgePublisher {
__isElectronForgePublisher: boolean;
platforms?: undefined;
readonly platforms?: ForgePlatform[];
}

export interface StartOptions {

0 comments on commit d15a8cc

Please sign in to comment.
You can’t perform that action at this time.