File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,27 @@ export interface IAdminForth {
370
370
*/
371
371
setupEndpoints ( server : IHttpServer ) : void ;
372
372
373
+ /**
374
+ * This method can be used when you want to get some plugin instances by class name.
375
+ * Should be used for plugins which might have multiple instances with the same class name.
376
+ * @param className - name of class which is used to identify plugin instance
377
+ */
378
+ getPluginsByClassName < T > ( className : string ) : T [ ] ;
379
+
380
+ /**
381
+ * This method can be used when you want to get some plugin instance by class name.
382
+ * Should be called only if you are sure there is only one plugin instance with this class name.
383
+ * If several instances are found, this method will drop error.
384
+ * @param className - name of class which is used to identify plugin instance
385
+ *
386
+ * Example:
387
+ *
388
+ * ```ts
389
+ * const i18nPlugin = adminforth.getPluginByClassName<I18nPlugin>('I18nPlugin');
390
+ * ```
391
+ *
392
+ */
393
+ getPluginByClassName < T > ( className : string ) : T ;
373
394
}
374
395
375
396
You can’t perform that action at this time.
0 commit comments