@@ -81,6 +81,7 @@ export const publish = (topic: string, data: any) => {
81
81
/**
82
82
* Validates that a valid registration key has been procured from http://ionic.io/register-portals
83
83
* @param key The registration key
84
+ * @returns Promise<void>
84
85
*/
85
86
export const register = async ( key : string ) : Promise < void > => {
86
87
return IONPortalsReactNative . register ( key ) ;
@@ -125,15 +126,32 @@ export type PortalProps = PortalProp & ViewProps;
125
126
* Adds a Portal to an internal registry. Must be called before attempting to render a {@link PortalView}.
126
127
*
127
128
* @param portal The portal to add to the internal registry.
129
+ * @returns Promise containing the Portal that was added to the registry.
128
130
*/
129
131
export const addPortal = async ( portal : Portal ) : Promise < Portal > => {
130
132
return IONPortalsReactNative . addPortal ( portal ) ;
131
133
} ;
132
134
135
+ /**
136
+ * Adds all portals to an internal registry. This or {@link addPortal} must be called before attempting to render a {@link PortalView}
137
+ *
138
+ * @param portals The portals to add to the internal registry.
139
+ * @returns Promise containing the Portals that were added to the registry.
140
+ */
133
141
export const addPortals = async ( portals : Portal [ ] ) : Promise < Portal [ ] > => {
134
142
return IONPortalsReactNative . addPortals ( portals ) ;
135
143
} ;
136
144
145
+ /**
146
+ * Gets a {@link Portal} previously registered via {@link addPortal} or {@link addPortals}.
147
+ *
148
+ * @param name The portal name to retrieve from the internal registry.
149
+ * @returns Promise containing the registered {@link Portal}. If the {@link Portal} was not registered, the Promise will fail.
150
+ */
151
+ export const getPortal = async ( name : string ) : Promise < Portal > => {
152
+ return IONPortalsReactNative . getPortal ( name ) ;
153
+ } ;
154
+
137
155
export interface LiveUpdate {
138
156
/** The AppFlow application ID */
139
157
appId : string ;
@@ -165,6 +183,7 @@ export interface SyncResults {
165
183
*
166
184
* @param pathToKey The *relative* path to the public key for verification.
167
185
* This path should be the same relatibe to the main application bundle on iOS and the assets directory on Android.
186
+ * @returns Promise<void>
168
187
*/
169
188
export const enableSecureLiveUpdates = async (
170
189
pathToKey : string
0 commit comments