@awdware/gah-shared
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -1,6 +0,6 @@ | ||
import { GahEvent, GahEventPayload } from './gah-event'; | ||
export declare class GahEventHandler { | ||
event: GahEvent; | ||
handler: (payload: GahEventPayload) => void; | ||
import { GahEvent, ExtractEventPayload, GahEventType } from './gah-event'; | ||
export declare class GahEventHandler<T extends GahEventType> { | ||
eventType: GahEventType; | ||
handler: (payload: Omit<ExtractEventPayload<GahEvent, T>, 'type'>) => void; | ||
pluginName: string; | ||
} |
import { GahFileData } from './install-helper/gah-file-data'; | ||
import { GahModuleData } from './install-helper/gah-module-data'; | ||
export declare enum GahEvent { | ||
UNKNOWN = 0, | ||
INSTALL_FINISHED = 1, | ||
INSTALL_STARTED = 2, | ||
HOST_COPIED = 3, | ||
STARTING_MODULE_INSTALL = 4, | ||
FINISHED_MODULE_INSTALL = 5, | ||
TS_CONFIG_CLEANED = 6, | ||
GAH_FOLDER_CLEANED = 7, | ||
STYLES_FILE_GENERATED = 8, | ||
SYMLINKS_CREATED = 9, | ||
TS_CONFIG_ADJUSTED = 10, | ||
TEMPLATE_GENERATED = 11, | ||
ASSETS_BASE_STYLES_COPIED = 12, | ||
DEPENDENCIES_MERGED = 13, | ||
STYLE_IMPORTS_GENERATED = 14, | ||
GITIGNORE_ADJUSTED = 15, | ||
ANGULAR_JSON_ADJUSTED = 16, | ||
INDEX_HTML_ADJUSTED = 17, | ||
PACKAGES_INSTALLED = 18 | ||
} | ||
export interface GahEventPayload { | ||
} | ||
export interface GahFileDataPayload extends GahEventPayload { | ||
readonly gahFile?: GahFileData; | ||
} | ||
export interface GahModuleDataPayload extends GahEventPayload { | ||
readonly module?: GahModuleData; | ||
} | ||
export declare type InstallFinishedEvent = GahFileDataPayload; | ||
export declare type InstallStartedEvent = GahFileDataPayload; | ||
export declare type HostCopiedEvent = GahFileDataPayload; | ||
export declare type StartingModuleInstallEvent = GahModuleDataPayload; | ||
export declare type FinishedgModuleInstallEvent = GahModuleDataPayload; | ||
export declare type TsConfigCleanedEvent = GahModuleDataPayload; | ||
export declare type GahFolderCleanedEvent = GahModuleDataPayload; | ||
export declare type StylesFileGeneratedEvent = GahModuleDataPayload; | ||
export declare type SymlinksCreatedEvent = GahModuleDataPayload; | ||
export declare type TsConfigAdjustedEvent = GahModuleDataPayload; | ||
export declare type TemplateGeneratedEvent = GahModuleDataPayload; | ||
export declare type AssetsBaseStylesCopiedEvent = GahModuleDataPayload; | ||
export declare type DependenciesMergedEvent = GahModuleDataPayload; | ||
export declare type StyleImportsGeneratedEvent = GahModuleDataPayload; | ||
export declare type GitignoreAdjustedEvent = GahModuleDataPayload; | ||
export declare type AngularJsonAdjustedEvent = GahModuleDataPayload; | ||
export declare type IndexHtmlAdjustedEvent = GahModuleDataPayload; | ||
export declare type PackagesInstalledEvent = GahModuleDataPayload; | ||
export declare type GahEvent = { | ||
type: 'INSTALL_FINISHED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'INSTALL_STARTED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'HOST_COPIED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'STARTING_MODULE_INSTALL'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'FINISHED_MODULE_INSTALL'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TS_CONFIG_CLEANED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'GAH_FOLDER_CLEANED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'STYLES_FILE_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'SYMLINKS_CREATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TS_CONFIG_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TEMPLATE_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'ASSETS_BASE_STYLES_COPIED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'DEPENDENCIES_MERGED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'STYLE_IMPORTS_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'GITIGNORE_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'ANGULAR_JSON_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'INDEX_HTML_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'PACKAGES_INSTALLED'; | ||
module?: GahModuleData; | ||
}; | ||
export declare type GahEventType = GahEvent['type']; | ||
export declare type ExtractEventPayload<A, T> = A extends { | ||
type: T; | ||
} ? A : never; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GahEvent = void 0; | ||
var GahEvent; | ||
(function (GahEvent) { | ||
GahEvent[GahEvent["UNKNOWN"] = 0] = "UNKNOWN"; | ||
GahEvent[GahEvent["INSTALL_FINISHED"] = 1] = "INSTALL_FINISHED"; | ||
GahEvent[GahEvent["INSTALL_STARTED"] = 2] = "INSTALL_STARTED"; | ||
GahEvent[GahEvent["HOST_COPIED"] = 3] = "HOST_COPIED"; | ||
GahEvent[GahEvent["STARTING_MODULE_INSTALL"] = 4] = "STARTING_MODULE_INSTALL"; | ||
GahEvent[GahEvent["FINISHED_MODULE_INSTALL"] = 5] = "FINISHED_MODULE_INSTALL"; | ||
GahEvent[GahEvent["TS_CONFIG_CLEANED"] = 6] = "TS_CONFIG_CLEANED"; | ||
GahEvent[GahEvent["GAH_FOLDER_CLEANED"] = 7] = "GAH_FOLDER_CLEANED"; | ||
GahEvent[GahEvent["STYLES_FILE_GENERATED"] = 8] = "STYLES_FILE_GENERATED"; | ||
GahEvent[GahEvent["SYMLINKS_CREATED"] = 9] = "SYMLINKS_CREATED"; | ||
GahEvent[GahEvent["TS_CONFIG_ADJUSTED"] = 10] = "TS_CONFIG_ADJUSTED"; | ||
GahEvent[GahEvent["TEMPLATE_GENERATED"] = 11] = "TEMPLATE_GENERATED"; | ||
GahEvent[GahEvent["ASSETS_BASE_STYLES_COPIED"] = 12] = "ASSETS_BASE_STYLES_COPIED"; | ||
GahEvent[GahEvent["DEPENDENCIES_MERGED"] = 13] = "DEPENDENCIES_MERGED"; | ||
GahEvent[GahEvent["STYLE_IMPORTS_GENERATED"] = 14] = "STYLE_IMPORTS_GENERATED"; | ||
GahEvent[GahEvent["GITIGNORE_ADJUSTED"] = 15] = "GITIGNORE_ADJUSTED"; | ||
GahEvent[GahEvent["ANGULAR_JSON_ADJUSTED"] = 16] = "ANGULAR_JSON_ADJUSTED"; | ||
GahEvent[GahEvent["INDEX_HTML_ADJUSTED"] = 17] = "INDEX_HTML_ADJUSTED"; | ||
GahEvent[GahEvent["PACKAGES_INSTALLED"] = 18] = "PACKAGES_INSTALLED"; | ||
})(GahEvent = exports.GahEvent || (exports.GahEvent = {})); | ||
//# sourceMappingURL=gah-event.js.map |
@@ -7,3 +7,3 @@ import { IFileSystemService } from '../services/file-system.service'; | ||
import { IWorkspaceService } from '../services/workspace.service'; | ||
import { GahEvent, GahEventPayload } from './gah-event'; | ||
import { GahEvent, ExtractEventPayload, GahEventType } from './gah-event'; | ||
import { GahPluginConfig } from './gah-plugin-config'; | ||
@@ -25,3 +25,3 @@ import { IExecutionService } from '../services/execution.service'; | ||
abstract onInstall(existingSettings?: GahPluginConfig): Promise<GahPluginConfig>; | ||
protected registerEventListener(event: GahEvent, handler: (event: GahEventPayload) => void): void; | ||
protected registerEventListener<T extends GahEventType>(type: T, handler: (payload: Omit<ExtractEventPayload<GahEvent, T>, 'type'>) => void): void; | ||
} |
@@ -8,4 +8,4 @@ "use strict"; | ||
} | ||
GahPlugin.prototype.registerEventListener = function (event, handler) { | ||
this.pluginService.registerEventHandler(this.name, event, handler); | ||
GahPlugin.prototype.registerEventListener = function (type, handler) { | ||
this.pluginService.registerEventHandler(this.name, type, handler); | ||
}; | ||
@@ -12,0 +12,0 @@ return GahPlugin; |
@@ -1,7 +0,7 @@ | ||
import { GahEvent, GahEventPayload } from '../models/gah-event'; | ||
import { GahEvent, GahEventType, ExtractEventPayload } from '../models/gah-event'; | ||
import { PlguinUpdate } from '../models/plugin-update'; | ||
export interface IPluginService { | ||
loadInstalledPlugins(): Promise<void>; | ||
triggerEvent(event: GahEvent, payload: GahEventPayload): void; | ||
registerEventHandler(pluginName: string, event: GahEvent, handler: (payload: GahEventPayload) => void): void; | ||
triggerEvent<T extends GahEventType>(type: T, payload: Omit<ExtractEventPayload<GahEvent, T>, 'type'>): void; | ||
registerEventHandler<T extends GahEventType>(pluginName: string, type: T, handler: (payload: Omit<ExtractEventPayload<GahEvent, T>, 'type'>) => void): void; | ||
installPlugin(pluginName: string): Promise<boolean>; | ||
@@ -8,0 +8,0 @@ removePlugin(pluginName: string): Promise<boolean>; |
{ | ||
"name": "@awdware/gah-shared", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"description": "Provides types and interfaces for gah", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -1,6 +0,6 @@ | ||
import { GahEvent, GahEventPayload } from './gah-event'; | ||
export declare class GahEventHandler { | ||
event: GahEvent; | ||
handler: (payload: GahEventPayload) => void; | ||
import { GahEvent, ExtractEventPayload, GahEventType } from './gah-event'; | ||
export declare class GahEventHandler<T extends GahEventType> { | ||
eventType: GahEventType; | ||
handler: (payload: Pick<ExtractEventPayload<GahEvent, T>, Exclude<keyof ExtractEventPayload<GahEvent, T>, 'type'>>) => void; | ||
pluginName: string; | ||
} |
import { GahFileData } from './install-helper/gah-file-data'; | ||
import { GahModuleData } from './install-helper/gah-module-data'; | ||
export declare enum GahEvent { | ||
UNKNOWN = 0, | ||
INSTALL_FINISHED = 1, | ||
INSTALL_STARTED = 2, | ||
HOST_COPIED = 3, | ||
STARTING_MODULE_INSTALL = 4, | ||
FINISHED_MODULE_INSTALL = 5, | ||
TS_CONFIG_CLEANED = 6, | ||
GAH_FOLDER_CLEANED = 7, | ||
STYLES_FILE_GENERATED = 8, | ||
SYMLINKS_CREATED = 9, | ||
TS_CONFIG_ADJUSTED = 10, | ||
TEMPLATE_GENERATED = 11, | ||
ASSETS_BASE_STYLES_COPIED = 12, | ||
DEPENDENCIES_MERGED = 13, | ||
STYLE_IMPORTS_GENERATED = 14, | ||
GITIGNORE_ADJUSTED = 15, | ||
ANGULAR_JSON_ADJUSTED = 16, | ||
INDEX_HTML_ADJUSTED = 17, | ||
PACKAGES_INSTALLED = 18 | ||
} | ||
export interface GahEventPayload { | ||
} | ||
export interface GahFileDataPayload extends GahEventPayload { | ||
readonly gahFile?: GahFileData; | ||
} | ||
export interface GahModuleDataPayload extends GahEventPayload { | ||
readonly module?: GahModuleData; | ||
} | ||
export declare type InstallFinishedEvent = GahFileDataPayload; | ||
export declare type InstallStartedEvent = GahFileDataPayload; | ||
export declare type HostCopiedEvent = GahFileDataPayload; | ||
export declare type StartingModuleInstallEvent = GahModuleDataPayload; | ||
export declare type FinishedgModuleInstallEvent = GahModuleDataPayload; | ||
export declare type TsConfigCleanedEvent = GahModuleDataPayload; | ||
export declare type GahFolderCleanedEvent = GahModuleDataPayload; | ||
export declare type StylesFileGeneratedEvent = GahModuleDataPayload; | ||
export declare type SymlinksCreatedEvent = GahModuleDataPayload; | ||
export declare type TsConfigAdjustedEvent = GahModuleDataPayload; | ||
export declare type TemplateGeneratedEvent = GahModuleDataPayload; | ||
export declare type AssetsBaseStylesCopiedEvent = GahModuleDataPayload; | ||
export declare type DependenciesMergedEvent = GahModuleDataPayload; | ||
export declare type StyleImportsGeneratedEvent = GahModuleDataPayload; | ||
export declare type GitignoreAdjustedEvent = GahModuleDataPayload; | ||
export declare type AngularJsonAdjustedEvent = GahModuleDataPayload; | ||
export declare type IndexHtmlAdjustedEvent = GahModuleDataPayload; | ||
export declare type PackagesInstalledEvent = GahModuleDataPayload; | ||
export declare type GahEvent = { | ||
type: 'INSTALL_FINISHED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'INSTALL_STARTED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'HOST_COPIED'; | ||
gahFile?: GahFileData; | ||
} | { | ||
type: 'STARTING_MODULE_INSTALL'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'FINISHED_MODULE_INSTALL'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TS_CONFIG_CLEANED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'GAH_FOLDER_CLEANED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'STYLES_FILE_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'SYMLINKS_CREATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TS_CONFIG_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'TEMPLATE_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'ASSETS_BASE_STYLES_COPIED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'DEPENDENCIES_MERGED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'STYLE_IMPORTS_GENERATED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'GITIGNORE_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'ANGULAR_JSON_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'INDEX_HTML_ADJUSTED'; | ||
module?: GahModuleData; | ||
} | { | ||
type: 'PACKAGES_INSTALLED'; | ||
module?: GahModuleData; | ||
}; | ||
export declare type GahEventType = GahEvent['type']; | ||
export declare type ExtractEventPayload<A, T> = A extends { | ||
type: T; | ||
} ? A : never; |
@@ -7,3 +7,3 @@ import { IFileSystemService } from '../services/file-system.service'; | ||
import { IWorkspaceService } from '../services/workspace.service'; | ||
import { GahEvent, GahEventPayload } from './gah-event'; | ||
import { GahEvent, ExtractEventPayload, GahEventType } from './gah-event'; | ||
import { GahPluginConfig } from './gah-plugin-config'; | ||
@@ -25,3 +25,3 @@ import { IExecutionService } from '../services/execution.service'; | ||
abstract onInstall(existingSettings?: GahPluginConfig): Promise<GahPluginConfig>; | ||
protected registerEventListener(event: GahEvent, handler: (event: GahEventPayload) => void): void; | ||
protected registerEventListener<T extends GahEventType>(type: T, handler: (payload: Pick<ExtractEventPayload<GahEvent, T>, Exclude<keyof ExtractEventPayload<GahEvent, T>, 'type'>>) => void): void; | ||
} |
@@ -1,7 +0,7 @@ | ||
import { GahEvent, GahEventPayload } from '../models/gah-event'; | ||
import { GahEvent, GahEventType, ExtractEventPayload } from '../models/gah-event'; | ||
import { PlguinUpdate } from '../models/plugin-update'; | ||
export interface IPluginService { | ||
loadInstalledPlugins(): Promise<void>; | ||
triggerEvent(event: GahEvent, payload: GahEventPayload): void; | ||
registerEventHandler(pluginName: string, event: GahEvent, handler: (payload: GahEventPayload) => void): void; | ||
triggerEvent<T extends GahEventType>(type: T, payload: Pick<ExtractEventPayload<GahEvent, T>, Exclude<keyof ExtractEventPayload<GahEvent, T>, 'type'>>): void; | ||
registerEventHandler<T extends GahEventType>(pluginName: string, type: T, handler: (payload: Pick<ExtractEventPayload<GahEvent, T>, Exclude<keyof ExtractEventPayload<GahEvent, T>, 'type'>>) => void): void; | ||
installPlugin(pluginName: string): Promise<boolean>; | ||
@@ -8,0 +8,0 @@ removePlugin(pluginName: string): Promise<boolean>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2241
93545