Skip to content

Commit

Permalink
added Pluginable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jonathan committed Jul 28, 2024
1 parent b01ee19 commit 8c7ce0b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/behavioral/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,24 @@
* @module Plugin
*/

export abstract class Plugin<T> {
export type Pluginable<T> = {
/**
* Returns the name as a string.
*
* @returns {string} The name.
*/
get name(): string

/**
* Executes the method with the given arguments.
*
* @param {...T} args - The arguments to be passed to the method.
* @return {void}
*/
execute(...args: T[]): void
}

export abstract class Plugin<T> implements Pluginable<T> {
/**
* Retrieves the name.
*
Expand Down

0 comments on commit 8c7ce0b

Please sign in to comment.