diff --git a/notNeededPackages.json b/notNeededPackages.json index ad8e9733d2..e6fc627970 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -275,6 +275,12 @@ "typingsPackageName": "scanf", "sourceRepoURL": "https://github.com/Lellansin/node-scanf", "asOfVersion": "0.7.3" + }, + { + "libraryName": "vue-router", + "typingsPackageName": "vue-router", + "sourceRepoURL": "https://github.com/vuejs/vue-router", + "asOfVersion": "2.0.0" } ] } \ No newline at end of file diff --git a/vue-router/index.d.ts b/vue-router/index.d.ts deleted file mode 100644 index 9f5d1ef0c3..0000000000 --- a/vue-router/index.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -// Type definitions for vue-router 0.7.10 -// Project: https://github.com/vuejs/vue-router -// Definitions by: kaorun343 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace vuejs { - - interface Transition { - from: $route; - to: $route; - next(data?: any): void; - abort(reason?: any): void; - redirect(path: string): void; - } - - interface RouterOption { - hashbang?: boolean; - history?: boolean; - abstract?: boolean; - root?: string; - linkActiveClass?: string; - saveScrollPosition?: boolean; - transitionOnLoad?: boolean; - suppressTransitionError?: boolean; - } - - interface RouterStatic { - new (option?: RouterOption): Router; - } - - interface RouteMapObject { - component: any; - subRoutes?: { [key: string]: RouteMapObject }; - [key: string]: any; - } - - interface Router { - - app: RootVueApp; - mode: string; - - start(App: any, el: string | Element): void; - stop(): void; - map(routeMap: { [path: string]: RouteMapObject }): void; - on(path: string, config: Object): void; - go(path: string | Object): void; - replace(path: string): void; - redirect(redirectMap: Object): void; - alias(aliasMap: Object): void; - beforeEach(hook: (transition: Transition) => any): void; - afterEach(hook: (transition: Transition) => any): void; - } - - interface $route { - path: string; - params: Params; - query: Query; - router: Router; - matched: string[]; - name: string; - [key: string]: any; - } - - interface TransitionHook { - data?(transition?: Transition): PromiseLike | void; - activate?(transition?: Transition): PromiseLike | void; - deactivate?(transition?: Transition): PromiseLike | void; - canActivate?(transition?: Transition): PromiseLike | boolean | void; - canDeactivate?(transition?: Transition): PromiseLike | boolean | void; - canReuse?: boolean | ((transition: Transition) => boolean); - } - - interface Vue { - $route: vuejs.$route; - $router: vuejs.Router; - } - - interface ComponentOption { - route?: vuejs.TransitionHook; - } -} - -declare var VueRouter: vuejs.RouterStatic; - -declare module "vue-router" { - export = VueRouter; -} diff --git a/vue-router/package.json b/vue-router/package.json deleted file mode 100644 index a393c6b160..0000000000 --- a/vue-router/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@types/vue": "^1.0.31" - } -} \ No newline at end of file diff --git a/vue-router/tsconfig.json b/vue-router/tsconfig.json deleted file mode 100644 index 7fd9e070f8..0000000000 --- a/vue-router/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "vue-router-tests.ts" - ] -} \ No newline at end of file diff --git a/vue-router/vue-router-tests.ts b/vue-router/vue-router-tests.ts deleted file mode 100644 index 70eb436132..0000000000 --- a/vue-router/vue-router-tests.ts +++ /dev/null @@ -1,110 +0,0 @@ - - -Vue.use(VueRouter); - -namespace TestBasic { - "use strict"; - - var Foo = Vue.extend({ - template: "

This is foo!

", - route: { - canActivate(transition: vuejs.Transition) { - return true; - }, - activate: function() { - var p: PromiseLike; - return p; - }, - deactivate: function(transition: vuejs.Transition) { - transition.next(); - } - } - }); - - var Bar = Vue.extend({ - template: "

This is bar!

" - }); - - var App = Vue.extend({}); - var app = new App(); - app.$on("some event", function() { - var name: string = app.$route.name; - }); - - var router = new VueRouter(); - - router.map({ - "/foo": { - component: Foo - }, - "/bar": { - component: Bar - } - }); - - router.start(App, "#app"); -} - -namespace TestAdvanced { - "use strict"; - - namespace App { - - export class App extends Vue { - authenticating: boolean; - - data() { - return { - authenticating: false - }; - } - } - } - - namespace Inbox { - export class Index extends Vue { - } - } - - namespace RouteConfig { - export function configRouter(router: vuejs.Router) { - router.map({ - "/about": { - component: {}, - auth: false - }, - "*": { - component: {} - } - }); - - router.redirect({ - "/info": "/about", - "/hello/:userId": "/user/:userId" - }); - - router.beforeEach((transition) => { - if (transition.to.path === "/forbidden") { - router.app.authenticating = true; - setTimeout(() => { - router.app.authenticating = false; - alert(""); - transition.abort(); - }, 3000); - } else { - transition.next(); - } - }); - } - } - - import configRouter = RouteConfig.configRouter; - - const router = new VueRouter({ - history: true, - saveScrollPosition: true - }); - - configRouter(router); - router.start(App, "#app"); -}