Skip to content

Commit c5b34a3

Browse files
committed
Fix promise resolve type from any to string
1 parent 5c368a5 commit c5b34a3

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

lib/src/Navigation.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class NavigationRoot {
162162
/**
163163
* Reset the app to a new layout
164164
*/
165-
public setRoot(layout: LayoutRoot): Promise<any> {
165+
public setRoot(layout: LayoutRoot): Promise<string> {
166166
return this.commands.setRoot(layout);
167167
}
168168

@@ -190,71 +190,74 @@ export class NavigationRoot {
190190
/**
191191
* Show a screen as a modal.
192192
*/
193-
public showModal<P>(layout: Layout<P>): Promise<any> {
193+
public showModal<P>(layout: Layout<P>): Promise<string> {
194194
return this.commands.showModal(layout);
195195
}
196196

197197
/**
198198
* Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack.
199199
*/
200-
public dismissModal(componentId: string, mergeOptions?: Options): Promise<any> {
200+
public dismissModal(componentId: string, mergeOptions?: Options): Promise<string> {
201201
return this.commands.dismissModal(componentId, mergeOptions);
202202
}
203203

204204
/**
205205
* Dismiss all Modals
206206
*/
207-
public dismissAllModals(mergeOptions?: Options): Promise<any> {
207+
public dismissAllModals(mergeOptions?: Options): Promise<string> {
208208
return this.commands.dismissAllModals(mergeOptions);
209209
}
210210

211211
/**
212212
* Push a new layout into this screen's navigation stack.
213213
*/
214-
public push<P>(componentId: string, layout: Layout<P>): Promise<any> {
214+
public push<P>(componentId: string, layout: Layout<P>): Promise<string> {
215215
return this.commands.push(componentId, layout);
216216
}
217217

218218
/**
219219
* Pop a component from the stack, regardless of it's position.
220220
*/
221-
public pop(componentId: string, mergeOptions?: Options): Promise<any> {
221+
public pop(componentId: string, mergeOptions?: Options): Promise<string> {
222222
return this.commands.pop(componentId, mergeOptions);
223223
}
224224

225225
/**
226226
* Pop the stack to a given component
227227
*/
228-
public popTo(componentId: string, mergeOptions?: Options): Promise<any> {
228+
public popTo(componentId: string, mergeOptions?: Options): Promise<string> {
229229
return this.commands.popTo(componentId, mergeOptions);
230230
}
231231

232232
/**
233233
* Pop the component's stack to root.
234234
*/
235-
public popToRoot(componentId: string, mergeOptions?: Options): Promise<any> {
235+
public popToRoot(componentId: string, mergeOptions?: Options): Promise<string> {
236236
return this.commands.popToRoot(componentId, mergeOptions);
237237
}
238238

239239
/**
240240
* Sets new root component to stack.
241241
*/
242-
public setStackRoot<P>(componentId: string, layout: Layout<P> | Array<Layout<P>>): Promise<any> {
242+
public setStackRoot<P>(
243+
componentId: string,
244+
layout: Layout<P> | Array<Layout<P>>
245+
): Promise<string> {
243246
const children: Layout[] = isArray(layout) ? layout : [layout];
244247
return this.commands.setStackRoot(componentId, children);
245248
}
246249

247250
/**
248251
* Show overlay on top of the entire app
249252
*/
250-
public showOverlay<P>(layout: Layout<P>): Promise<any> {
253+
public showOverlay<P>(layout: Layout<P>): Promise<string> {
251254
return this.commands.showOverlay(layout);
252255
}
253256

254257
/**
255258
* dismiss overlay by componentId
256259
*/
257-
public dismissOverlay(componentId: string): Promise<any> {
260+
public dismissOverlay(componentId: string): Promise<string> {
258261
return this.commands.dismissOverlay(componentId);
259262
}
260263

0 commit comments

Comments
 (0)