Skip to content

Commit 886c8a3

Browse files
donniewajohnleider
authored andcommitted
fix(Typescript): update declaration file (#9320)
* Typescript Declaration File Fix - Updated the lib.d.ts declaration file to add back the module for `vuetify/lib/directives`. This matches the same module setup as the ES5 a-la-carte model. As well as the documentation for loading the directives directly from `vuetify/lib/directives` - According to the other files I noticed that the directives were expected to be in a directives object when being imported from `vuetify/lib`. I've updated the export to wrap the directives only from `vuetify/lib` to be encapsulated in the `directives` namespace. * Adding the missing Intersect and Mutate to Lib and alacarte * - reverted the entry lib back to the full export of directives as per the review comments - Since the entry lib is exporting all directives, I've modified the lib.d.ts types file to reflect it properly ``` Test Suites: 172 passed, 172 total Tests: 52 skipped, 1325 passed, 1377 total Snapshots: 559 passed, 559 total Time: 81.07s Ran all test suites. ``` * Fixing the Travis failure - Had to update the test for Lib.ts, Directives isn't actually exporting as an encapsulated object, so it has to be imported from the directives module - removed the extra import from the lib.d.ts that was causing a full on meltdown of the linter
1 parent 2db8cc9 commit 886c8a3

File tree

3 files changed

+43
-10
lines changed

3 files changed

+43
-10
lines changed

packages/vuetify/types/alacarte.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ declare module 'vuetify/es5/directives' {
3030
import { DirectiveOptions } from 'vue'
3131

3232
const ClickOutside: DirectiveOptions
33-
const Ripple: DirectiveOptions
33+
const Intersect: DirectiveOptions
34+
const Mutate: DirectiveOptions
3435
const Resize: DirectiveOptions
36+
const Ripple: DirectiveOptions
3537
const Scroll: DirectiveOptions
3638
const Touch: DirectiveOptions
3739

3840
export {
3941
ClickOutside,
42+
Intersect,
43+
Mutate,
4044
Ripple,
4145
Resize,
4246
Scroll,

packages/vuetify/types/lib.d.ts

+36-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ declare module 'vuetify/lib' {
55

66
const Vuetify: Vuetify
77
const colors: Colors
8-
const directives: {
9-
ClickOutside: DirectiveOptions
10-
Ripple: DirectiveOptions
11-
Resize: DirectiveOptions
12-
Scroll: DirectiveOptions
13-
Touch: DirectiveOptions
14-
}
8+
const ClickOutside: DirectiveOptions
9+
const Intersect: DirectiveOptions
10+
const Mutate: DirectiveOptions
11+
const Resize: DirectiveOptions
12+
const Ripple: DirectiveOptions
13+
const Scroll: DirectiveOptions
14+
const Touch: DirectiveOptions
1515
const VApp: Component
1616
const VAppBar: Component
1717
const VAppBarNavIcon: Component
@@ -170,7 +170,13 @@ declare module 'vuetify/lib' {
170170
export default Vuetify
171171
export {
172172
colors,
173-
directives,
173+
ClickOutside,
174+
Intersect,
175+
Mutate,
176+
Ripple,
177+
Resize,
178+
Scroll,
179+
Touch,
174180
VApp,
175181
VAppBar,
176182
VAppBarNavIcon,
@@ -327,3 +333,25 @@ declare module 'vuetify/lib' {
327333
VExpandXTransition,
328334
}
329335
}
336+
337+
declare module 'vuetify/lib/directives' {
338+
import { DirectiveOptions } from 'vue'
339+
340+
const ClickOutside: DirectiveOptions
341+
const Intersect: DirectiveOptions
342+
const Mutate: DirectiveOptions
343+
const Resize: DirectiveOptions
344+
const Ripple: DirectiveOptions
345+
const Scroll: DirectiveOptions
346+
const Touch: DirectiveOptions
347+
348+
export {
349+
ClickOutside,
350+
Intersect,
351+
Mutate,
352+
Ripple,
353+
Resize,
354+
Scroll,
355+
Touch
356+
}
357+
}

packages/vuetify/types/test/lib.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import Vuetify, {
44
VBtn,
55
VCard,
66
VCardText,
7-
directives,
87
} from 'vuetify/lib'
98

9+
import * as directives from 'vuetify/lib/directives'
10+
1011
Vuetify.install(Vue)
1112

1213
Vuetify.install(Vue, {})

0 commit comments

Comments
 (0)