Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useResizeObserver)!: rename type ResizeObserverOptions to UseResizeObserverOptions #1862

Merged
merged 1 commit into from Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/useElementBounding/component.ts
@@ -1,9 +1,9 @@
import { defineComponent, h, reactive, ref } from 'vue-demi'
import { useElementBounding } from '@vueuse/core'
import type { ResizeObserverOptions } from '../useResizeObserver'
import type { UseResizeObserverOptions } from '../useResizeObserver'
import type { RenderableComponent } from '../types'

export const UseElementBounding = defineComponent<ResizeObserverOptions & RenderableComponent>({
export const UseElementBounding = defineComponent<UseResizeObserverOptions & RenderableComponent>({
name: 'UseElementBounding',
props: ['box', 'as'] as unknown as undefined,
setup(props, { slots }) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useElementSize/component.ts
Expand Up @@ -2,9 +2,9 @@ import { defineComponent, h, reactive, ref } from 'vue-demi'
import type { ElementSize } from '@vueuse/core'
import { useElementSize } from '@vueuse/core'
import type { RenderableComponent } from '../types'
import type { ResizeObserverOptions } from '../useResizeObserver'
import type { UseResizeObserverOptions } from '../useResizeObserver'

export const UseElementSize = defineComponent<ElementSize & ResizeObserverOptions & RenderableComponent>({
export const UseElementSize = defineComponent<ElementSize & UseResizeObserverOptions & RenderableComponent>({
name: 'UseElementSize',
props: ['width', 'height', 'box'] as unknown as undefined,
setup(props, { slots }) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useElementSize/index.ts
@@ -1,6 +1,6 @@
import { ref, watch } from 'vue-demi'
import type { MaybeComputedElementRef } from '../unrefElement'
import type { ResizeObserverOptions } from '../useResizeObserver'
import type { UseResizeObserverOptions } from '../useResizeObserver'
import { useResizeObserver } from '../useResizeObserver'
import { unrefElement } from '../unrefElement'

Expand All @@ -20,7 +20,7 @@ export interface ElementSize {
export function useElementSize(
target: MaybeComputedElementRef,
initialSize: ElementSize = { width: 0, height: 0 },
options: ResizeObserverOptions = {},
options: UseResizeObserverOptions = {},
) {
const width = ref(initialSize.width)
const height = ref(initialSize.height)
Expand Down
6 changes: 3 additions & 3 deletions packages/core/useResizeObserver/index.ts
Expand Up @@ -21,7 +21,7 @@ export interface ResizeObserverEntry {

export type ResizeObserverCallback = (entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver) => void

export interface ResizeObserverOptions extends ConfigurableWindow {
export interface UseResizeObserverOptions extends ConfigurableWindow {
/**
* Sets which box model the observer will observe changes to. Possible values
* are `content-box` (the default), and `border-box`.
Expand All @@ -34,7 +34,7 @@ export interface ResizeObserverOptions extends ConfigurableWindow {
declare class ResizeObserver {
constructor(callback: ResizeObserverCallback)
disconnect(): void
observe(target: Element, options?: ResizeObserverOptions): void
observe(target: Element, options?: UseResizeObserverOptions): void
unobserve(target: Element): void
}

Expand All @@ -49,7 +49,7 @@ declare class ResizeObserver {
export function useResizeObserver(
target: MaybeComputedElementRef,
callback: ResizeObserverCallback,
options: ResizeObserverOptions = {},
options: UseResizeObserverOptions = {},
) {
const { window = defaultWindow, ...observerOptions } = options
let observer: ResizeObserver | undefined
Expand Down