From 34b759bb825ef5f419884fa118560e65f2b6f751 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 2 Jun 2022 19:58:21 +0800 Subject: [PATCH] feat: expose plugin and viewNode outsize registry --- .../doric/src/main/java/pub/doric/DoricRegistry.java | 8 ++++++++ doric-iOS/Pod/Classes/DoricRegistry.h | 3 +++ doric-iOS/Pod/Classes/DoricRegistry.m | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java b/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java index 4430db6a..4677877e 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java @@ -248,4 +248,12 @@ public class DoricRegistry { public DoricResourceManager getResourceManager() { return doricResourceManager; } + + public Set allPlugins() { + return pluginInfoMap.keySet(); + } + + public Set allViewNodes() { + return nodeInfoMap.keySet(); + } } diff --git a/doric-iOS/Pod/Classes/DoricRegistry.h b/doric-iOS/Pod/Classes/DoricRegistry.h index 7b856307..fa986578 100644 --- a/doric-iOS/Pod/Classes/DoricRegistry.h +++ b/doric-iOS/Pod/Classes/DoricRegistry.h @@ -56,6 +56,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)register:(DoricLibrary *)library; +-(NSArray *)allPlugins; + +-(NSArray *)allViewNodes; @end NS_ASSUME_NONNULL_END diff --git a/doric-iOS/Pod/Classes/DoricRegistry.m b/doric-iOS/Pod/Classes/DoricRegistry.m index eb8f9842..c4c27245 100644 --- a/doric-iOS/Pod/Classes/DoricRegistry.m +++ b/doric-iOS/Pod/Classes/DoricRegistry.m @@ -198,4 +198,12 @@ - (void)onLog:(DoricLogType)type message:(NSString *)message { [monitor onLog:type message:message]; } } + +- (NSArray *)allPlugins { + return self.plugins.allKeys; +} + +- (NSArray *)allViewNodes { + return self.nodes.allKeys; +} @end