Skip to content

Commit

Permalink
Generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed May 29, 2021
1 parent 8af773d commit 8a8f326
Show file tree
Hide file tree
Showing 33 changed files with 71 additions and 27 deletions.
3 changes: 3 additions & 0 deletions packages/core/createGlobalState/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export default defineComponent({
export declare function createGlobalState<T extends object>(
stateFactory: () => T
): () => T
export declare type CreateGlobalStateReturn = ReturnType<
typeof createGlobalState
>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useAsyncState/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export declare function useAsyncState<T>(
>
execute: (delay?: number) => Promise<void>
}
export declare type UseAsyncStateReturn = ReturnType<typeof useAsyncState>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useBattery/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export declare function useBattery({ navigator }?: ConfigurableNavigator): {
dischargingTime: Ref<number>
level: Ref<number>
}
export declare type UseBatteryReturn = ReturnType<typeof useBattery>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useBreakpoints/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export declare function useBreakpoints<K extends string>(
isSmaller(k: K): boolean
isInBetween(a: K, b: K): boolean
}
export declare type UseBreakpointsReturn = ReturnType<typeof useBreakpoints>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useBrowserLocation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export declare function useBrowserLocation({
protocol?: string | undefined
search?: string | undefined
}>
export declare type UseBrowserLocationReturn = ReturnType<
typeof useBrowserLocation
>
```
## Source
Expand Down
2 changes: 2 additions & 0 deletions packages/core/useDeviceMotion/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export declare function useDeviceMotion(options?: DeviceMotionOptions): {
rotationRate: Ref<DeviceMotionEventRotationRate | null>
interval: Ref<number>
}
export declare type UseDeviceMotionReturn = ReturnType<typeof useDeviceMotion>
export {}
```

## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useDeviceOrientation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export declare function useDeviceOrientation(options?: ConfigurableWindow): {
beta: Ref<number | null>
gamma: Ref<number | null>
}
export declare type UseDeviceOrientationReturn = ReturnType<
typeof useDeviceOrientation
>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useDevicePixelRatio/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export default {
export declare function useDevicePixelRatio({ window }?: ConfigurableWindow): {
pixelRatio: Ref<number>
}
export declare type UseDevicePixelRatioReturn = ReturnType<
typeof useDevicePixelRatio
>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useElementBounding/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export declare function useElementBounding(
width: Ref<number>
height: Ref<number>
}
export declare type UseElementBoundingReturn = ReturnType<
typeof useElementBounding
>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useElementSize/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export declare function useElementSize(
width: Ref<number>
height: Ref<number>
}
export declare type UseElementSizeReturn = ReturnType<typeof useElementSize>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useEventSource/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export declare function useEventSource(
error: Ref<Event | null>
close: () => void
}
export declare type UseEventListenerReturn = ReturnType<typeof useEventListener>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useFullscreen/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export declare function useFullscreen(
exit: () => Promise<void>
toggle: () => Promise<void>
}
export declare type UseFullscreenReturn = ReturnType<typeof useFullscreen>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useGeolocation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export declare function useGeolocation(options?: GeolocationOptions): {
readonly TIMEOUT: number
} | null>
}
export declare type UseGeolocationReturn = ReturnType<typeof useGeolocation>
```
## Source
Expand Down
9 changes: 5 additions & 4 deletions packages/core/useIdle/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export interface IdleOptions
*/
initialState?: boolean
}
export interface UseIdleReturn {
idle: Ref<boolean>
lastActive: Ref<number>
}
/**
* Tracks whether the user is being inactive.
*
Expand All @@ -59,10 +63,7 @@ export interface IdleOptions
export declare function useIdle(
timeout?: number,
options?: IdleOptions
): {
idle: Ref<boolean>
lastActive: Ref<number>
}
): UseIdleReturn
```

## Source
Expand Down
11 changes: 7 additions & 4 deletions packages/core/useIdle/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue-demi'
import { ConfigurableEventFilter, createFilterWrapper, throttleFilter, timestamp } from '@vueuse/shared'
import { Ref, ref } from 'vue-demi'
import { useEventListener, WindowEventName } from '../useEventListener'
import { ConfigurableWindow, defaultWindow } from '../_configurable'

Expand Down Expand Up @@ -27,6 +27,11 @@ export interface IdleOptions extends ConfigurableWindow, ConfigurableEventFilter
initialState?: boolean
}

export interface UseIdleReturn {
idle: Ref<boolean>
lastActive: Ref<number>
}

/**
* Tracks whether the user is being inactive.
*
Expand All @@ -37,7 +42,7 @@ export interface IdleOptions extends ConfigurableWindow, ConfigurableEventFilter
export function useIdle(
timeout: number = oneMinute,
options: IdleOptions = {},
) {
): UseIdleReturn {
const {
initialState = false,
listenForVisibilityChange = true,
Expand Down Expand Up @@ -77,5 +82,3 @@ export function useIdle(

return { idle, lastActive }
}

export type UseIdleReturn = ReturnType<typeof useIdle>
3 changes: 3 additions & 0 deletions packages/core/useIntersectionObserver/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export declare function useIntersectionObserver(
isSupported: boolean | undefined
stop: () => void
}
export declare type UseIntersectionObserverReturn = ReturnType<
typeof useIntersectionObserver
>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useMediaControls/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ export declare function useMediaControls(
isPictureInPicture: Ref<boolean>
onSourceError: EventHookOn<Event>
}
export declare type UseMediaControlsReturn = ReturnType<typeof useMediaControls>
export {}
```

Expand Down
1 change: 1 addition & 0 deletions packages/core/useMouse/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export declare function useMouse(options?: MouseOptions): {
y: Ref<number>
sourceType: Ref<MouseSourceType>
}
export declare type UseMouseReturn = ReturnType<typeof useMouse>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useMouseInElement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export declare function useMouseInElement(
isOutside: Ref<boolean>
stop: () => void
}
export declare type UseMouseInElementReturn = ReturnType<
typeof useMouseInElement
>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useMousePressed/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export declare function useMousePressed(options?: MousePressedOptions): {
pressed: Ref<boolean>
sourceType: Ref<MouseSourceType>
}
export declare type UseMousePressedReturn = ReturnType<typeof useMousePressed>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useMutationObserver/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export declare function useMutationObserver(
isSupported: boolean | undefined
stop: () => void
}
export declare type UseMutationObserverReturn = ReturnType<
typeof useMutationObserver
>
```
## Source
Expand Down
5 changes: 4 additions & 1 deletion packages/core/useNow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ export interface UseNowOptions<Controls extends boolean> {
* @param options
*/
export declare function useNow(options?: UseNowOptions<false>): Ref<Date>
export declare function useNow(options: UseNowOptions<true>): {
export declare function useNow(
options: UseNowOptions<true>
): {
now: Ref<Date>
} & Pausable
export declare type UseNowReturn = ReturnType<typeof useNow>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useResizeObserver/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export declare function useResizeObserver(
isSupported: boolean | undefined
stop: () => void
}
export declare type UseResizeObserverReturn = ReturnType<
typeof useResizeObserver
>
export {}
```

Expand Down
1 change: 1 addition & 0 deletions packages/core/useScriptTag/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export declare function useScriptTag(
load: (waitForScriptLoad?: boolean) => Promise<HTMLScriptElement | boolean>
unload: () => void
}
export declare type UseScriptTagReturn = ReturnType<typeof useScriptTag>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useShare/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export declare function useShare(
isSupported: boolean
share: (overrideOptions?: MaybeRef<ShareOptions>) => Promise<void>
}
export declare type UseShareReturn = ReturnType<typeof useShare>
```
## Source
Expand Down
3 changes: 3 additions & 0 deletions packages/core/useSpeechRecognition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export declare function useSpeechRecognition(
start: () => void
stop: () => void
}
export declare type UseSpeechRecognitionReturn = ReturnType<
typeof useSpeechRecognition
>
```
## Source
Expand Down
19 changes: 2 additions & 17 deletions packages/core/useSwipe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface SwipeOptions extends ConfigurableWindow {
}
export interface SwipeReturn {
isPassiveEventSupported: boolean
isSwiping: ComputedRef<boolean>
isSwiping: Ref<boolean>
direction: ComputedRef<SwipeDirection | null>
coordsStart: {
readonly x: number
Expand All @@ -86,22 +86,7 @@ export interface SwipeReturn {
export declare function useSwipe(
target: MaybeRef<EventTarget | null | undefined>,
options?: SwipeOptions
): {
isPassiveEventSupported: boolean
isSwiping: Ref<boolean>
direction: ComputedRef<SwipeDirection>
coordsStart: {
x: number
y: number
}
coordsEnd: {
x: number
y: number
}
lengthX: ComputedRef<number>
lengthY: ComputedRef<number>
stop: () => void
}
): SwipeReturn
```

## Source
Expand Down
5 changes: 4 additions & 1 deletion packages/core/useTimestamp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ export interface TimestampOptions<Controls extends boolean> {
export declare function useTimestamp(
options?: TimestampOptions<false>
): Ref<number>
export declare function useTimestamp(options: TimestampOptions<true>): {
export declare function useTimestamp(
options: TimestampOptions<true>
): {
timestamp: Ref<number>
} & Pausable
export declare type UseTimestampReturn = ReturnType<typeof useTimestamp>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useUserMedia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export declare function useUserMedia(options?: UseUserMediaOptions): {
enabled: Ref<boolean>
autoSwitch: Ref<boolean>
}
export declare type UseUserMediaReturn = ReturnType<typeof useUserMedia>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useWebWorker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export declare function useWebWorker(
terminate: () => void
worker: Ref<Worker | undefined>
}
export declare type UseWebWorkerReturn = ReturnType<typeof useWebWorker>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useWebWorkerFn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export declare const useWebWorkerFn: <T extends (...fnArgs: any[]) => any>(
workerStatus: Ref<WebWorkerStatus>
workerTerminate: (status?: WebWorkerStatus) => void
}
export declare type UseWebWorkerFnReturn = ReturnType<typeof useWebWorkerFn>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useWindowScroll/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export declare function useWindowScroll({ window }?: ConfigurableWindow): {
x: Ref<number>
y: Ref<number>
}
export declare type UseWindowScrollReturn = ReturnType<typeof useWindowScroll>
```
## Source
Expand Down
1 change: 1 addition & 0 deletions packages/core/useWindowSize/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export declare function useWindowSize({
width: Ref<number>
height: Ref<number>
}
export declare type UseWindowSizeReturn = ReturnType<typeof useWindowSize>
```
## Source
Expand Down

0 comments on commit 8a8f326

Please sign in to comment.