Skip to content

Commit

Permalink
fix(useIntersectionObserver)!: rename type `IntersectionObserverOptio…
Browse files Browse the repository at this point in the history
…ns` to `UseIntersectionObserverOptions` (#1870)
  • Loading branch information
okxiaoliang4 committed Jul 12, 2022
1 parent 499f60d commit fc03c0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/directive.test.ts
Expand Up @@ -3,7 +3,7 @@ import type { VueWrapper } from '@vue/test-utils'
import { mount } from '@vue/test-utils'

import { vIntersectionObserver } from './directive'
import type { IntersectionObserverOptions } from '.'
import type { UseIntersectionObserverOptions } from '.'

const App = defineComponent({
props: {
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('vIntersectionObserver', () => {
describe('given options', () => {
beforeEach(() => {
onIntersectionObserver = vi.fn()
const options: IntersectionObserverOptions = {
const options: UseIntersectionObserverOptions = {
rootMargin: '10px',
}
wrapper = mount(App, {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/directive.ts
@@ -1,11 +1,11 @@
import { directiveHooks } from '@vueuse/shared'
import type { ObjectDirective } from 'vue-demi'
import { useIntersectionObserver } from '.'
import type { IntersectionObserverOptions } from '.'
import type { UseIntersectionObserverOptions } from '.'

type BindingValueFunction = IntersectionObserverCallback

type BindingValueArray = [BindingValueFunction, IntersectionObserverOptions]
type BindingValueArray = [BindingValueFunction, UseIntersectionObserverOptions]

export const vIntersectionObserver: ObjectDirective<
HTMLElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/index.ts
Expand Up @@ -6,7 +6,7 @@ import type { MaybeElementRef } from '../unrefElement'
import { unrefElement } from '../unrefElement'
import { useSupported } from '../useSupported'

export interface IntersectionObserverOptions extends ConfigurableWindow {
export interface UseIntersectionObserverOptions extends ConfigurableWindow {
/**
* The Element or Document whose bounds are used as the bounding box when testing for intersection.
*/
Expand Down Expand Up @@ -34,7 +34,7 @@ export interface IntersectionObserverOptions extends ConfigurableWindow {
export function useIntersectionObserver(
target: MaybeElementRef,
callback: IntersectionObserverCallback,
options: IntersectionObserverOptions = {},
options: UseIntersectionObserverOptions = {},
) {
const {
root,
Expand Down

0 comments on commit fc03c0f

Please sign in to comment.