mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
feat(@types/vue-clickaway): create types (#38962)
* feat(@types/vue-clickaway): create types * fix: rename to vue-clickaway-tests.ts
This commit is contained in:
committed by
Armando Aguirre
parent
7d1ee0c34a
commit
c79ad1cd46
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for vue-clickaway 2.2
|
||||
// Project: https://github.com/simplesmiler/vue-clickaway
|
||||
// Definitions by: Khoa Nguyen <https://github.com/khoanguyen96>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.6
|
||||
import Vue, { ComponentOptions, DirectiveOptions } from 'vue';
|
||||
|
||||
export const directive: DirectiveOptions;
|
||||
export const mixin: ComponentOptions<Vue> | typeof Vue;
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vue": "^2.0.0"
|
||||
}
|
||||
}
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES6",
|
||||
"DOM.Iterable",
|
||||
"ScriptHost"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"noImplicitThis": true,
|
||||
"esModuleInterop": true,
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"vue-clickaway-tests.ts"
|
||||
]
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import Vue, { ComponentOptions } from 'vue';
|
||||
import { directive, mixin } from 'vue-clickaway';
|
||||
|
||||
// excerpt from vue-class-component/src/declarations.ts
|
||||
type VueClass<V> = { new (...args: any[]): V & Vue } & typeof Vue;
|
||||
// excerpt from vue-class-component/src/index.ts
|
||||
function Component(options: ComponentOptions<Vue> | VueClass<Vue>): any {
|
||||
return null; // mocked
|
||||
}
|
||||
|
||||
@Component({
|
||||
directives: {
|
||||
clickaway: directive,
|
||||
},
|
||||
})
|
||||
export class ComponentWithDirective extends Vue {}
|
||||
|
||||
@Component({
|
||||
mixins: [mixin],
|
||||
})
|
||||
export class ComponentWithMixin extends Vue {}
|
||||
Reference in New Issue
Block a user