小程序typescript模板编译出现错误

解决方法

更新最新版的开发工具,重新新建模板

简单分析

旧版本的typescript模板会缺少一些文件,导致TS编译的时候缺少文件

出错问题

miniprogram/app.ts:8:5 - error TS2558: Expected 0 type arguments, but got 1.

8 App<IMyApp>({
      ~~~~~~

miniprogram/typings/wx.d.ts:119:12 - error TS7006: Parameter 'a' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
               ~

miniprogram/typings/wx.d.ts:119:15 - error TS7006: Parameter 'b' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                  ~

miniprogram/typings/wx.d.ts:119:18 - error TS7006: Parameter 'c' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                     ~

miniprogram/typings/wx.d.ts:119:21 - error TS7006: Parameter 'd' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                        ~

miniprogram/typings/wx.d.ts:119:24 - error TS7006: Parameter 'tx' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                           ~~

miniprogram/typings/wx.d.ts:119:28 - error TS7006: Parameter 'ty' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                               ~~

miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.

343 declare var App: AppConstructor;
                ~~~

  typings/wx/lib.wx.app.d.ts:11:19
    11 declare namespace App {
                         ~~~
    'App' was also declared here.
  typings/wx/lib.wx.app.d.ts:248:15
    248 declare const App: App.AppConstructor
                      ~~~
    and here.

miniprogram/typings/wx.d.ts:344:18 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

344 declare function getApp(): Application;
                     ~~~~~~

  typings/wx/lib.wx.app.d.ts:249:15
    249 declare const getApp: App.GetApp
                      ~~~~~~
    'getApp' was also declared here.

miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

346 declare function getCurrentPages(): Page[];
                     ~~~~~~~~~~~~~~~

  typings/wx/lib.wx.page.d.ts:181:15
    181 declare const getCurrentPages: Page.GetCurrentPages
                      ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

348 interface Page {
              ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

409 declare var Page: PageConstructor;
                ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:411:13 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

411 declare var wx: {
                ~~

  typings/wx/lib.wx.api.d.ts:11:19
    11 declare namespace wx {
                         ~~
    'wx' was also declared here.
  typings/wx/lib.wx.api.d.ts:12756:15
    12756 declare const wx: wx.Wx;
                        ~~
    and here.

typings/wx/lib.wx.api.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

11 declare namespace wx {
                     ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:15 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

12756 declare const wx: wx.Wx;
                    ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:22 - error TS2694: Namespace 'wx' has no exported member 'Wx'.

12756 declare const wx: wx.Wx;
                           ~~

typings/wx/lib.wx.app.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'App'.

11 declare namespace App {
                     ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:15 - error TS2451: Cannot redeclare block-scoped variable 'App'.

248 declare const App: App.AppConstructor
                  ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:20 - error TS2503: Cannot find namespace 'App'.

248 declare const App: App.AppConstructor
                       ~~~

typings/wx/lib.wx.app.d.ts:249:15 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

249 declare const getApp: App.GetApp
                  ~~~~~~

  miniprogram/typings/wx.d.ts:344:18
    344 declare function getApp(): Application;
                         ~~~~~~
    'getApp' was also declared here.

typings/wx/lib.wx.app.d.ts:249:23 - error TS2503: Cannot find namespace 'App'.

249 declare const getApp: App.GetApp
                          ~~~

typings/wx/lib.wx.page.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

11 declare namespace Page {
                     ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:15 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

180 declare const Page: Page.PageConstructor
                  ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:21 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

180 declare const Page: Page.PageConstructor
                        ~~~~

typings/wx/lib.wx.page.d.ts:181:15 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

181 declare const getCurrentPages: Page.GetCurrentPages
                  ~~~~~~~~~~~~~~~

  miniprogram/typings/wx.d.ts:346:18
    346 declare function getCurrentPages(): Page[];
                         ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

typings/wx/lib.wx.page.d.ts:181:32 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

181 declare const getCurrentPages: Page.GetCurrentPages
                                   ~~~~


Found 26 errors.


F:\html\es6>node ./node_modules/typescript/lib/tsc.js
miniprogram/typings/wx.d.ts:119:12 - error TS7006: Parameter 'a' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
               ~

miniprogram/typings/wx.d.ts:119:15 - error TS7006: Parameter 'b' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                  ~

miniprogram/typings/wx.d.ts:119:18 - error TS7006: Parameter 'c' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                     ~

miniprogram/typings/wx.d.ts:119:21 - error TS7006: Parameter 'd' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                        ~

miniprogram/typings/wx.d.ts:119:24 - error TS7006: Parameter 'tx' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                           ~~

miniprogram/typings/wx.d.ts:119:28 - error TS7006: Parameter 'ty' implicitly has an 'any' type.

119     matrix(a, b, c, d, tx, ty): IAnimation;
                               ~~

miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.

343 declare var App: AppConstructor;
                ~~~

  typings/wx/lib.wx.app.d.ts:11:19
    11 declare namespace App {
                         ~~~
    'App' was also declared here.
  typings/wx/lib.wx.app.d.ts:248:15
    248 declare const App: App.AppConstructor
                      ~~~
    and here.

miniprogram/typings/wx.d.ts:344:18 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

344 declare function getApp(): Application;
                     ~~~~~~

  typings/wx/lib.wx.app.d.ts:249:15
    249 declare const getApp: App.GetApp
                      ~~~~~~
    'getApp' was also declared here.

miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

346 declare function getCurrentPages(): Page[];
                     ~~~~~~~~~~~~~~~

  typings/wx/lib.wx.page.d.ts:181:15
    181 declare const getCurrentPages: Page.GetCurrentPages
                      ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

348 interface Page {
              ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

409 declare var Page: PageConstructor;
                ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:411:13 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

411 declare var wx: {
                ~~

  typings/wx/lib.wx.api.d.ts:11:19
    11 declare namespace wx {
                         ~~
    'wx' was also declared here.
  typings/wx/lib.wx.api.d.ts:12756:15
    12756 declare const wx: wx.Wx;
                        ~~
    and here.

typings/wx/lib.wx.api.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

11 declare namespace wx {
                     ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:15 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

12756 declare const wx: wx.Wx;
                    ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:22 - error TS2694: Namespace 'wx' has no exported member 'Wx'.

12756 declare const wx: wx.Wx;
                           ~~

typings/wx/lib.wx.app.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'App'.

11 declare namespace App {
                     ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:15 - error TS2451: Cannot redeclare block-scoped variable 'App'.

248 declare const App: App.AppConstructor
                  ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:20 - error TS2503: Cannot find namespace 'App'.

248 declare const App: App.AppConstructor
                       ~~~

typings/wx/lib.wx.app.d.ts:249:15 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

249 declare const getApp: App.GetApp
                  ~~~~~~

  miniprogram/typings/wx.d.ts:344:18
    344 declare function getApp(): Application;
                         ~~~~~~
    'getApp' was also declared here.

typings/wx/lib.wx.app.d.ts:249:23 - error TS2503: Cannot find namespace 'App'.

249 declare const getApp: App.GetApp
                          ~~~

typings/wx/lib.wx.page.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

11 declare namespace Page {
                     ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:15 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

180 declare const Page: Page.PageConstructor
                  ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:21 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

180 declare const Page: Page.PageConstructor
                        ~~~~

typings/wx/lib.wx.page.d.ts:181:15 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

181 declare const getCurrentPages: Page.GetCurrentPages
                  ~~~~~~~~~~~~~~~

  miniprogram/typings/wx.d.ts:346:18
    346 declare function getCurrentPages(): Page[];
                         ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

typings/wx/lib.wx.page.d.ts:181:32 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

181 declare const getCurrentPages: Page.GetCurrentPages
                                   ~~~~


Found 25 errors.


F:\html\es6>node ./node_modules/typescript/lib/tsc.js
miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.

343 declare var App: AppConstructor;
                ~~~

  typings/wx/lib.wx.app.d.ts:11:19
    11 declare namespace App {
                         ~~~
    'App' was also declared here.
  typings/wx/lib.wx.app.d.ts:248:15
    248 declare const App: App.AppConstructor
                      ~~~
    and here.

miniprogram/typings/wx.d.ts:344:18 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

344 declare function getApp(): Application;
                     ~~~~~~

  typings/wx/lib.wx.app.d.ts:249:15
    249 declare const getApp: App.GetApp
                      ~~~~~~
    'getApp' was also declared here.

miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

346 declare function getCurrentPages(): Page[];
                     ~~~~~~~~~~~~~~~

  typings/wx/lib.wx.page.d.ts:181:15
    181 declare const getCurrentPages: Page.GetCurrentPages
                      ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

348 interface Page {
              ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

409 declare var Page: PageConstructor;
                ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:411:13 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

411 declare var wx: {
                ~~

  typings/wx/lib.wx.api.d.ts:11:19
    11 declare namespace wx {
                         ~~
    'wx' was also declared here.
  typings/wx/lib.wx.api.d.ts:12756:15
    12756 declare const wx: wx.Wx;
                        ~~
    and here.

typings/wx/lib.wx.api.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

11 declare namespace wx {
                     ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:15 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

12756 declare const wx: wx.Wx;
                    ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:22 - error TS2694: Namespace 'wx' has no exported member 'Wx'.

12756 declare const wx: wx.Wx;
                           ~~

typings/wx/lib.wx.app.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'App'.

11 declare namespace App {
                     ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:15 - error TS2451: Cannot redeclare block-scoped variable 'App'.

248 declare const App: App.AppConstructor
                  ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:20 - error TS2503: Cannot find namespace 'App'.

248 declare const App: App.AppConstructor
                       ~~~

typings/wx/lib.wx.app.d.ts:249:15 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

249 declare const getApp: App.GetApp
                  ~~~~~~

  miniprogram/typings/wx.d.ts:344:18
    344 declare function getApp(): Application;
                         ~~~~~~
    'getApp' was also declared here.

typings/wx/lib.wx.app.d.ts:249:23 - error TS2503: Cannot find namespace 'App'.

249 declare const getApp: App.GetApp
                          ~~~

typings/wx/lib.wx.page.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

11 declare namespace Page {
                     ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:15 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

180 declare const Page: Page.PageConstructor
                  ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:21 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

F:\html\es6>node ./node_modules/typescript/lib/tsc.js
miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.

343 declare var App: AppConstructor;
                ~~~

  typings/wx/lib.wx.app.d.ts:11:19
    11 declare namespace App {
                         ~~~
    'App' was also declared here.
  typings/wx/lib.wx.app.d.ts:248:15
    248 declare const App: App.AppConstructor
                      ~~~
    and here.

miniprogram/typings/wx.d.ts:344:18 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

344 declare function getApp(): Application;
                     ~~~~~~

  typings/wx/lib.wx.app.d.ts:249:15
    249 declare const getApp: App.GetApp
                      ~~~~~~
    'getApp' was also declared here.

miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

346 declare function getCurrentPages(): Page[];
                     ~~~~~~~~~~~~~~~

  typings/wx/lib.wx.page.d.ts:181:15
    181 declare const getCurrentPages: Page.GetCurrentPages
                      ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

348 interface Page {
              ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

409 declare var Page: PageConstructor;
                ~~~~

  typings/wx/lib.wx.page.d.ts:11:19
    11 declare namespace Page {
                         ~~~~
    'Page' was also declared here.
  typings/wx/lib.wx.page.d.ts:180:15
    180 declare const Page: Page.PageConstructor
                      ~~~~
    and here.

miniprogram/typings/wx.d.ts:411:13 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

411 declare var wx: {
                ~~

  typings/wx/lib.wx.api.d.ts:11:19
    11 declare namespace wx {
                         ~~
    'wx' was also declared here.
  typings/wx/lib.wx.api.d.ts:12756:15
    12756 declare const wx: wx.Wx;
                        ~~
    and here.

typings/wx/lib.wx.api.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

11 declare namespace wx {
                     ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:15 - error TS2451: Cannot redeclare block-scoped variable 'wx'.

12756 declare const wx: wx.Wx;
                    ~~

  miniprogram/typings/wx.d.ts:411:13
    411 declare var wx: {
                    ~~
    'wx' was also declared here.

typings/wx/lib.wx.api.d.ts:12756:22 - error TS2694: Namespace 'wx' has no exported member 'Wx'.

12756 declare const wx: wx.Wx;
                           ~~

typings/wx/lib.wx.app.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'App'.

11 declare namespace App {
                     ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:15 - error TS2451: Cannot redeclare block-scoped variable 'App'.

248 declare const App: App.AppConstructor
                  ~~~

  miniprogram/typings/wx.d.ts:343:13
    343 declare var App: AppConstructor;
                    ~~~
    'App' was also declared here.

typings/wx/lib.wx.app.d.ts:248:20 - error TS2503: Cannot find namespace 'App'.

248 declare const App: App.AppConstructor
                       ~~~

typings/wx/lib.wx.app.d.ts:249:15 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.

249 declare const getApp: App.GetApp
                  ~~~~~~

  miniprogram/typings/wx.d.ts:344:18
    344 declare function getApp(): Application;
                         ~~~~~~
    'getApp' was also declared here.

typings/wx/lib.wx.app.d.ts:249:23 - error TS2503: Cannot find namespace 'App'.

249 declare const getApp: App.GetApp
                          ~~~

typings/wx/lib.wx.page.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

11 declare namespace Page {
                     ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:15 - error TS2451: Cannot redeclare block-scoped variable 'Page'.

180 declare const Page: Page.PageConstructor
                  ~~~~

  miniprogram/typings/wx.d.ts:348:11
    348 interface Page {
                  ~~~~
    'Page' was also declared here.
  miniprogram/typings/wx.d.ts:409:13
    409 declare var Page: PageConstructor;
                    ~~~~
    and here.

typings/wx/lib.wx.page.d.ts:180:21 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

180 declare const Page: Page.PageConstructor
                        ~~~~

typings/wx/lib.wx.page.d.ts:181:15 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.

181 declare const getCurrentPages: Page.GetCurrentPages
                  ~~~~~~~~~~~~~~~

  miniprogram/typings/wx.d.ts:346:18
    346 declare function getCurrentPages(): Page[];
                         ~~~~~~~~~~~~~~~
    'getCurrentPages' was also declared here.

typings/wx/lib.wx.page.d.ts:181:32 - error TS2702: 'Page' only refers to a type, but is being used as a namespace here.

181 declare const getCurrentPages: Page.GetCurrentPages
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值