Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt index.d.ts for end users #3582

Merged
merged 2 commits into from
Sep 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0-rc.4",
"description": "Reactive, component-oriented view layer for modern web interfaces.",
"main": "dist/vue.common.js",
"typings": "index.d.ts",
"typings": "types/index.d.ts",
"files": [
"dist/vue.common.js",
"dist/vue.js",
Expand Down
6 changes: 5 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
import {Vue} from "./vue.d";
import {Vue as _Vue} from "./vue.d";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an import to ./vue.d? It should probably just be ./vue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should.

@kaorun343 would you please have a look on this? I don't want to solve two different issues in one pull request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I will fix this later.

// `Vue` in `export = Vue` must be a namespace
declare namespace Vue {}
// TS cannot merge imported class with namespace, declare a subclass to bypass
declare class Vue extends _Vue {}
export = Vue;
2 changes: 1 addition & 1 deletion types/test/options-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vue } from "../vue.d";
import Vue = require("../index.d");
import { ComponentOptions } from "../options.d";

interface Component extends Vue {
Expand Down
2 changes: 1 addition & 1 deletion types/test/plugin-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vue } from "../vue.d";
import Vue = require("../index.d");
import { PluginFunction, PluginObject } from "../plugin.d";

class Option {
Expand Down
2 changes: 1 addition & 1 deletion types/test/vue-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vue } from "../vue.d";
import Vue = require("../index.d");

class Test extends Vue {
testProperties() {
Expand Down
2 changes: 1 addition & 1 deletion types/vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export declare class Vue {
keyCodes: { [key: string]: number };
}

static extend(options: ComponentOptions): Vue;
static extend(options: ComponentOptions): typeof Vue;
static nextTick(callback: () => void, context?: any[]): void;
static set<T>(object: Object, key: string, value: T): T;
static set<T>(array: T[], key: number, value: T): T;
Expand Down