Skip to content

Add typescript definition file #13

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "git"
},
"main": "dist/vue-content-loader.cjs.js",
"types": "src/vue-content-loader.d.ts",
Copy link
Owner

Choose a reason for hiding this comment

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

maybe move to index.d.ts? src folder is not published on npm.

"module": "dist/vue-content-loader.es.js",
"cdn": "dist/vue-content-loader.min.js",
"unpkg": "dist/vue-content-loader.min.js",
Expand Down
29 changes: 29 additions & 0 deletions src/vue-content-loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { VueConstructor } from 'vue';

export const ContentLoader: ContentLoaderConstructor
export const FacebookLoader: FacebookLoaderConstructor
export const BulletListLoader: BulletListLoaderConstructor
export const InstagramLoader: InstagramLoaderConstructor
export const CodeLoader: CodeLoaderConstructor
export const ListLoader: ListLoaderConstructor

export interface ContentLoaderProps {
width: number,
height: number,
speed: number,
preserveAspectRatio: string,
primaryColor: string,
secondaryColor: string,
uniqueKey: string,
animate: boolean
}

export interface ContentLoaderConstructor extends VueConstructor {
props: ContentLoaderProps
}

export interface FacebookLoaderConstructor extends ContentLoaderConstructor{}
export interface CodeLoaderConstructor extends ContentLoaderConstructor{}
export interface BulletListLoaderConstructor extends ContentLoaderConstructor{}
export interface InstagramLoaderConstructor extends ContentLoaderConstructor{}
export interface ListLoaderConstructor extends ContentLoaderConstructor{}