mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
adds vue-datetime typings (#38428)
* Adds vue-datetime definitions * npm test fixes for PR
This commit is contained in:
parent
bc8addff53
commit
aa5c66c087
25
types/vue-datetime/index.d.ts
vendored
Normal file
25
types/vue-datetime/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for vue-datetime 1.0
|
||||
// Project: https://github.com/mariomka/vue-datetime#readme
|
||||
// Definitions by: Olavo Rocha Neto <https://github.com/olavorn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { VueConstructor } from 'vue';
|
||||
export const Datetime: VueDateTimeConstructor;
|
||||
export const DatetimePopup: VueDateTimeConstructor;
|
||||
export default Datetime;
|
||||
|
||||
export interface VueDateTimeProps {
|
||||
inputClass: any;
|
||||
inputStyle: any;
|
||||
}
|
||||
|
||||
export interface VueDateTimeData {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface VueDateTimeConstructor extends VueConstructor {
|
||||
props: VueDateTimeProps;
|
||||
data: () => VueDateTimeData;
|
||||
methods: any;
|
||||
}
|
||||
6
types/vue-datetime/package.json
Normal file
6
types/vue-datetime/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vue": ">=2.0.0"
|
||||
}
|
||||
}
|
||||
24
types/vue-datetime/tsconfig.json
Normal file
24
types/vue-datetime/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"vue-datetime-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/vue-datetime/tslint.json
Normal file
1
types/vue-datetime/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
30
types/vue-datetime/vue-datetime-tests.ts
Normal file
30
types/vue-datetime/vue-datetime-tests.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import Vue from 'vue';
|
||||
import VueDateTime from 'vue-datetime';
|
||||
|
||||
const options = [
|
||||
{
|
||||
name: 'SomeName'
|
||||
},
|
||||
{
|
||||
name: 'SomeName2'
|
||||
}
|
||||
];
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
value: null,
|
||||
},
|
||||
components: {
|
||||
'vue-datetime': VueDateTime
|
||||
},
|
||||
methods: {
|
||||
optionConsumer(option: any) {
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<vue-datetime :value="value"
|
||||
@input="optionConsumer">
|
||||
</vue-datetime>
|
||||
`
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user