Преглед на файлове

Tell prop's type with generic (#4597)

Henrik Raitasola преди 6 години
родител
ревизия
bc23fbad60
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2
    2
      lib/src/Navigation.ts

+ 2
- 2
lib/src/Navigation.ts Целия файл

164
   /**
164
   /**
165
    * Sets new root component to stack.
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
     const children: Layout[] = isArray(layout) ? layout : [layout];
168
     const children: Layout[] = isArray(layout) ? layout : [layout];
169
     return this.commands.setStackRoot(componentId, children);
169
     return this.commands.setStackRoot(componentId, children);
170
   }
170
   }
172
   /**
172
   /**
173
    * Show overlay on top of the entire app
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
     return this.commands.showOverlay(layout);
176
     return this.commands.showOverlay(layout);
177
   }
177
   }
178
 
178