From e17f8d78af8b1fb27f04f30e320057f8a1afbd67 Mon Sep 17 00:00:00 2001 From: andrewvasilchuk Date: Sat, 10 Oct 2020 15:06:32 +0300 Subject: [PATCH] feat: add TS types --- package.json | 4 +++- types/index.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 types/index.d.ts diff --git a/package.json b/package.json index 148a9dc..8ef64e6 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,12 @@ "vuejs-components" ], "main": "dist/vue-social-sharing.js", + "types": "types/index.d.ts", "files": [ "dist", "src", - "nuxt" + "nuxt", + "types/*.d.ts" ], "scripts": { "test": "jest tests", diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..7a53d60 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,22 @@ +import { PluginObject } from "vue" + +export interface Props { + network: string + url: string + title: string + description?: string + quote?: string + hashtags?: string + twitterUser?: string + media?: string + tag?: string + popup?: { width: number; height: number } +} + +export interface PluginOptions { + networks: Record +} + +type VueSocialSharing = PluginObject + +export default VueSocialSharing