瀏覽代碼

Tell prop's type with generic (#4597)

Henrik Raitasola 5 年之前
父節點
當前提交
bc23fbad60
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      lib/src/Navigation.ts

+ 2
- 2
lib/src/Navigation.ts 查看文件

@@ -164,7 +164,7 @@ export class NavigationRoot {
164 164
   /**
165 165
    * Sets new root component to stack.
166 166
    */
167
-  public setStackRoot(componentId: string, layout: Layout | Layout[]): Promise<any> {
167
+  public setStackRoot<P>(componentId: string, layout: Layout<P> | Array<Layout<P>>): Promise<any> {
168 168
     const children: Layout[] = isArray(layout) ? layout : [layout];
169 169
     return this.commands.setStackRoot(componentId, children);
170 170
   }
@@ -172,7 +172,7 @@ export class NavigationRoot {
172 172
   /**
173 173
    * Show overlay on top of the entire app
174 174
    */
175
-  public showOverlay(layout: Layout): Promise<any> {
175
+  public showOverlay<P>(layout: Layout<P>): Promise<any> {
176 176
     return this.commands.showOverlay(layout);
177 177
   }
178 178