egg 3.14.1 → 3.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +8 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -546,7 +546,7 @@ declare module 'egg' {
546
546
  headers: { [key: string]: string };
547
547
  }
548
548
 
549
- export interface Router extends KoaRouter<any, Context> {
549
+ export interface Router extends Omit<KoaRouter<any, Context>, 'url'> {
550
550
  /**
551
551
  * restful router api
552
552
  */
@@ -554,7 +554,7 @@ declare module 'egg' {
554
554
 
555
555
  /**
556
556
  * @param {String} name - Router name
557
- * @param {Object} params - more parameters
557
+ * @param {Object} [params] - more parameters
558
558
  * @example
559
559
  * ```js
560
560
  * router.url('edit_post', { id: 1, name: 'foo', page: 2 })
@@ -565,7 +565,12 @@ declare module 'egg' {
565
565
  * @return {String} url by path name and query params.
566
566
  * @since 1.0.0
567
567
  */
568
- url(name: string, params: any): any;
568
+ url(name: string, params?: any): string;
569
+ /**
570
+ * Alias for the url method
571
+ */
572
+ pathFor(name: string, params?: any): string;
573
+ methods: string[];
569
574
  }
570
575
 
571
576
  export interface EggApplication extends EggCoreBase<EggAppConfig> { // tslint:disable-line
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.14.1",
3
+ "version": "3.14.2",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },