diff --git a/dist/app/PluginRegistry.d.ts b/dist/app/PluginRegistry.d.ts index 04248fed7..bfe03a0d0 100644 --- a/dist/app/PluginRegistry.d.ts +++ b/dist/app/PluginRegistry.d.ts @@ -51,6 +51,16 @@ export declare class PluginRegistry implements IRegistry { * determines the factory method to use in case of the 'new ' syntax wrap the class constructor using a factory method */ getFactoryMethod(instance: any, factory: string | null): any; + /** + * Removes all registered plugins if no custom remove function is provided. + * @param remove Custom function to remove only specific plugins. + * @example + * ```ts + * PluginRegistry.getInstance().removePlugins((desc) => desc.type === 'tdpView'); + * // => removes all plugins of type "tdpView" + * ``` + */ + removePlugins(remove?: (desc: T) => boolean): void; private static instance; static getInstance(): PluginRegistry; } diff --git a/dist/app/PluginRegistry.d.ts.map b/dist/app/PluginRegistry.d.ts.map index 73f746084..269a9611a 100644 --- a/dist/app/PluginRegistry.d.ts.map +++ b/dist/app/PluginRegistry.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"PluginRegistry.d.ts","sourceRoot":"","sources":["../../src/app/PluginRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,qBAAa,cAAe,YAAW,SAAS;IAC9C,OAAO,CAAC,QAAQ,CAAqB;IAE9B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IACvD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IACnE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,YAAY,EAAE,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AE,GAAG;;;IAM3B;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAoC7D;;;;;;;;OAQG;IACI,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,GAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAqB,GAAG,IAAI;IAI7F,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;WAE1B,WAAW,IAAI,cAAc;CAO5C"} \ No newline at end of file diff --git a/dist/app/PluginRegistry.js b/dist/app/PluginRegistry.js index 4a5d395f8..73b5a1808 100644 --- a/dist/app/PluginRegistry.js +++ b/dist/app/PluginRegistry.js @@ -132,6 +132,18 @@ export class PluginRegistry { } return instance[f]; } + /** + * Removes all registered plugins if no custom remove function is provided. + * @param remove Custom function to remove only specific plugins. + * @example + * ```ts + * PluginRegistry.getInstance().removePlugins((desc) => desc.type === 'tdpView'); + * // => removes all plugins of type "tdpView" + * ``` + */ + removePlugins(remove = () => false) { + this.registry = this.registry.filter((d) => !remove(d)); + } static getInstance() { if (!PluginRegistry.instance) { PluginRegistry.instance = new PluginRegistry(); diff --git a/dist/app/PluginRegistry.js.map b/dist/app/PluginRegistry.js.map index 70e59c922..40c8e76a5 100644 --- a/dist/app/PluginRegistry.js.map +++ b/dist/app/PluginRegistry.js.map @@ -1 +1 @@ -{"version":3,"file":"PluginRegistry.js","sourceRoot":"","sources":["../../src/app/PluginRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,MAAM,OAAO,cAAc;IAA3B;QACU,aAAQ,GAAkB,EAAE,CAAC;QA2D7B,iBAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAwG3C,CAAC;IA9JQ,IAAI,C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C7D,CAAC;IAIM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC5B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;SAChD;QAED,OAAO,cAAc,CAAC,QAAQ,CAAC;IACjC,CAAC;CACF"} \ No newline at end of file diff --git a/src/app/PluginRegistry.ts b/src/app/PluginRegistry.ts index 035c505b3..cce38b972 100644 --- a/src/app/PluginRegistry.ts +++ b/src/app/PluginRegistry.ts @@ -159,6 +159,19 @@ export class PluginRegistry implements IRegistry { return instance[f]; } + /** + * Removes all registered plugins if no custom remove function is provided. + * @param remove Custom function to remove only specific plugins. + * @example + * ```ts + * PluginRegistry.getInstance().removePlugins((desc) => desc.type === 'tdpView'); + * // => removes all plugins of type "tdpView" + * ``` + */ + public removePlugins(remove: (desc: T) => boolean = () => false): void { + this.registry = this.registry.filter((d) => !remove(d)); + } + private static instance: PluginRegistry; public static getInstance(): PluginRegistry {