Skip to content

Commit 9f6d0c0

Browse files
fix(types): add missing goTo types (#13812)
fixes #9648
1 parent 43b0406 commit 9f6d0c0

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

Diff for: packages/api-generator/src/maps/$vuetify.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ module.exports = {
33
functions: [
44
{
55
name: 'goTo',
6-
signature: '() => void',
6+
signature: `(target: number | string | HTMLElement | Vue, options?: {
7+
container?: string | HTMLElement | Vue
8+
duration?: number
9+
offset?: number
10+
easing?: VuetifyGoToEasing
11+
appOffset?: boolean
12+
}): Promise<number>`,
713
},
814
],
915
},

Diff for: packages/api-generator/src/maps/vuetify.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ module.exports = {
33
functions: [
44
{
55
name: 'goTo',
6-
signature: '(target: string | number | HTMLElement | VueComponent, options?: object): void',
6+
signature: `(target: number | string | HTMLElement | Vue, options?: {
7+
container?: string | HTMLElement | Vue
8+
duration?: number
9+
offset?: number
10+
easing?: VuetifyGoToEasing
11+
appOffset?: boolean
12+
}): Promise<number>`,
713
},
814
],
915
},

Diff for: packages/docs/src/components/api/ApiTable.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
<template v-else-if="header === 'type' || header === 'signature'">
4848
<div
49-
class="text-mono"
49+
class="text-mono text-pre"
5050
v-html="getType(item[header])"
5151
/>
5252
</template>

Diff for: packages/vuetify/src/services/goto/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { VuetifyServiceContract } from 'vuetify/types/services'
1515

1616
export default function goTo (
1717
_target: VuetifyGoToTarget,
18-
_settings: Partial<GoToOptions> = {}
18+
_settings: GoToOptions = {}
1919
): Promise<number> {
2020
const settings: GoToOptions = {
2121
container: (document.scrollingElement as HTMLElement | null) || document.body || document.documentElement,

Diff for: packages/vuetify/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from './services/presets'
1717

1818
// Service Options
19-
import { GoToOptions } from './services/goto'
19+
import { GoToOptions, VuetifyGoToTarget } from './services/goto'
2020

2121
export default class Vuetify {
2222
constructor (preset?: Partial<UserVuetifyPreset>)
@@ -48,7 +48,7 @@ export interface VuetifyUseOptions {
4848

4949
export interface Framework {
5050
readonly breakpoint: Breakpoint
51-
readonly goTo: <T extends string | number | HTMLElement | Vue>(target: T, options?: GoToOptions) => Promise<T>
51+
readonly goTo: (target: VuetifyGoToTarget, options?: GoToOptions) => Promise<number>
5252
application: Application
5353
theme: Theme
5454
icons: Icons

Diff for: packages/vuetify/types/services/goto.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Types
22
import Vue from 'vue'
33

4-
type VuetifyGoToTarget = number | string | HTMLElement | Vue
4+
export type VuetifyGoToTarget = number | string | HTMLElement | Vue
55

66
export type VuetifyGoToEasing =
77
((t: number) => number) |
@@ -26,3 +26,5 @@ export interface GoToOptions {
2626
easing?: VuetifyGoToEasing
2727
appOffset?: boolean
2828
}
29+
30+
export default function goTo(target: VuetifyGoToTarget, options?: GoToOptions): Promise<number>

0 commit comments

Comments
 (0)