mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #10197 from ktsn/vue-directive
Improve Vue.js directive types
This commit is contained in:
+12
-1
@@ -30,9 +30,20 @@ namespace TestGlobalAPI {
|
||||
twoWay: true,
|
||||
acceptStatement: true,
|
||||
priority: 1,
|
||||
terminal: true,
|
||||
count: 30
|
||||
});
|
||||
Vue.directive("my-directive", () => {});
|
||||
Vue.directive("my-directive", function() {
|
||||
const d = this as vuejs.Directive;
|
||||
d.el;
|
||||
d.vm;
|
||||
d.expression;
|
||||
d.arg;
|
||||
d.name;
|
||||
d.modifiers;
|
||||
d.descriptor;
|
||||
d.params;
|
||||
});
|
||||
var myDirective = Vue.directive("my-directive");
|
||||
var elementDirective = Vue.elementDirective("element-directive");
|
||||
Vue.elementDirective("element-directive", elementDirective);
|
||||
|
||||
Vendored
+12
@@ -38,10 +38,22 @@ declare namespace vuejs {
|
||||
deep?: boolean;
|
||||
twoWay?: boolean;
|
||||
acceptStatement?: boolean;
|
||||
terminal?: boolean;
|
||||
priority?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Directive {
|
||||
el: HTMLElement;
|
||||
vm: Vue;
|
||||
expression: string;
|
||||
arg?: string;
|
||||
name: string;
|
||||
modifiers: { [key: string]: boolean };
|
||||
descriptor: any;
|
||||
params?: { [key: string]: any };
|
||||
}
|
||||
|
||||
interface FilterOption {
|
||||
read?: Function;
|
||||
write?: Function;
|
||||
|
||||
Reference in New Issue
Block a user