diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..ba29a5c --- /dev/null +++ b/index.d.ts @@ -0,0 +1,13 @@ +import { RouteRecordRaw } from 'vue-router'; +import VueBodyClass from './dist'; + +export = VueBodyClass; + +declare class VueBodyClass { + constructor( routes: RouteRecordRaw[] ); + guard( to: object, next: () => void ): void; + parseMatched( matchedArray: string[] ): string[]; + findMatchInRoutesByPath( routes: RouteRecordRaw[], matchedItem: string ): boolean; + getClassForRoute( route: RouteRecordRaw ): string | null; + updateClassFromRoute( className: string, route: RouteRecordRaw ): string; +} diff --git a/package.json b/package.json index 2ce9cd5..ccd3826 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { "name": "vue-body-class", - "version": "3.0.2", + "version": "3.0.3", "description": "Control you body classes easily with vue-router", "main": "./dist/index.js", + "types": "./index.d.ts", + "type": "commonjs", "repository": { "type": "git", "url": "https://github.com/nikolaynesov/vue-body-class" @@ -15,6 +17,9 @@ "class" ], "author": "Nikolay Nesov", + "contributors": [ + "Davey Jacobson (https://daveyjake.dev)" + ], "license": "ISC", "bugs": { "url": "https://github.com/nikolaynesov/vue-body-class/issues"