-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from joeistas/add-types
Add typescript type definitions
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Vue, { VueConstructor, Component, PluginFunction } from 'vue' | ||
|
||
declare const Transitions: Transitions | ||
export default Transitions | ||
export declare interface Transitions { | ||
install: PluginFunction<TransitionOptions> | ||
} | ||
|
||
export declare interface TransitionOptions { | ||
components?: { name: TransitionName }[] | ||
} | ||
|
||
export type TransitionName = | ||
'fade-transition' | | ||
'zoom-center-transition' | | ||
'zoom-x-transition' | | ||
'zoom-y-transition' | | ||
'collapse-transition' | | ||
'scale-transition' | | ||
'slide-y-up-transition' | | ||
'slide-y-down-transition' | | ||
'slide-x-left-transition' | | ||
'slide-x-right-transition' | ||
|
||
export const FadeTransition: Component | ||
export const ZoomCenterTansition: Component | ||
export const ZoomXTransition: Component | ||
export const ZoomYTransition: Component | ||
export const CollapseTransition: Component | ||
export const ScaleTransition: Component | ||
export const SlideYUpTransition: Component | ||
export const SlideYDownTransition: Component | ||
export const SlideXLeftTransition: Component | ||
export const SlideXRightTransition: Component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Vue from 'vue' | ||
|
||
import Transitions, { | ||
FadeTransition, | ||
ZoomCenterTansition, | ||
ZoomXTransition, | ||
ZoomYTransition, | ||
CollapseTransition, | ||
SlideYUpTransition, | ||
SlideYDownTransition, | ||
SlideXLeftTransition, | ||
SlideXRightTransition, | ||
TransitionOptions, | ||
} from '../index' | ||
|
||
// Test using Transitions plugin | ||
Vue.use(Transitions) | ||
Vue.use<TransitionOptions>(Transitions, {}) | ||
Vue.use<TransitionOptions>( | ||
Transitions, | ||
{ | ||
components: [ | ||
{ name: 'fade-transition' }, | ||
{ name: 'zoom-center-transition' }, | ||
{ name: 'zoom-x-transition' }, | ||
{ name: 'zoom-y-transition' }, | ||
{ name: 'collapse-transition' }, | ||
{ name: 'slide-y-up-transition' }, | ||
{ name: 'slide-y-down-transition' }, | ||
{ name: 'slide-x-left-transition' }, | ||
{ name: 'slide-x-right-transition' }, | ||
] | ||
} | ||
) | ||
|
||
// Test component definitions | ||
Vue.component('test-component', { | ||
components: { | ||
FadeTransition, | ||
ZoomCenterTansition, | ||
ZoomXTransition, | ||
ZoomYTransition, | ||
CollapseTransition, | ||
SlideYUpTransition, | ||
SlideYDownTransition, | ||
SlideXLeftTransition, | ||
SlideXRightTransition, | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": [ | ||
"dom", | ||
"es2015" | ||
], | ||
"module": "commonjs", | ||
"strict": true, | ||
"noEmit": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"vue2-transitions": ["../index.d.ts"] | ||
} | ||
}, | ||
"files": [ | ||
"../index.d.ts", | ||
], | ||
"compileOnSave": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters