Skip to content

⬅️ Back to Table of Contents

📄 useTimestamp

📊 Analysis Summary

Metric Count
🔧 Functions 2
📦 Imports 6
📐 Interfaces 1
📑 Type Aliases 1

📚 Table of Contents

🛠️ File Location:

📂 packages/core/useTimestamp/index.ts

📦 Imports

Name Source
Pausable @vueuse/shared
ShallowRef vue
ConfigurableScheduler ../_configurable
timestamp @vueuse/shared
shallowRef vue
useRafFn ../useRafFn

Functions

useTimestamp(options: UseTimestampOptions<false>): ShallowRef<number>

Reactive current timestamp.

Parameters:

  • options any: No description

See: https://vueuse.org/useTimestamp

Raw JSDoc
/**
 * Reactive current timestamp.
 *
 * @see https://vueuse.org/useTimestamp
 * @param options
 */
Code
export function useTimestamp(options?: UseTimestampOptions<false>): ShallowRef<number>

Internal helpers

Declared inside another function in this file.

update(): any

Returns: any

Code
() => ts.value = timestamp() + offset

Interfaces

UseTimestampOptions<Controls extends boolean>

Interface Code
export interface UseTimestampOptions<Controls extends boolean> extends ConfigurableScheduler {
  /**
   * Expose more controls
   *
   * @default false
   */
  controls?: Controls

  /**
   * Offset value adding to the value
   *
   * @default 0
   */
  offset?: number

  /**
   * Callback on each update
   */
  callback?: (timestamp: number) => void
}

Properties

Name Type Optional Description
controls Controls not shown
offset number not shown
callback (timestamp: number) => void not shown

Type Aliases

UseTimestampReturn<Controls extends boolean>

type UseTimestampReturn<Controls extends boolean> = Controls extends true
  ? ({ timestamp: ShallowRef<number> } & Pausable)
  : ShallowRef<number>;

Generated by Syntax Scribe