Skip to content

Commit

Permalink
Converted api table
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveKeehl committed Apr 13, 2024
1 parent 1a2dcc8 commit da63df2
Showing 1 changed file with 75 additions and 14 deletions.
89 changes: 75 additions & 14 deletions docs/src/content/docs/reference/api.mdx
Expand Up @@ -12,17 +12,78 @@ import { Steps, Aside } from '@astrojs/starlight/components';

Svelte Reveal also exposes several functions you can call to change the [default options](./src/internal/default/options.ts) and [global configuration](./src/internal/default/config.ts) of this library. Since these functions operate on a global level across all components using Svelte Reveal, you are supposed to only call them from a single file, otherwise you'll keep overriding the default options and global config from multiple points.

| Name | Args | Return | Description |
| ----------------------- | ---------------------------------------------- | ---------------------------- | ------------------------------------------------------------- |
| `setOnce` | `(once: boolean)` | `RevealConfig` | Sets the reveal animations activation status on page reload. |
| `setDeviceStatus` | `(device: Device, status: boolean)` | `RevealConfig` | Sets the status of a device. |
| `setDevicesStatus` | `(devices: Device[], status: boolean)` | `RevealConfig` | Sets the status of multiple devices. |
| `setDeviceBreakpoint` | `(device: Device, breakpoint: number)` | `RevealConfig` | Sets the breakpoint of a device. |
| `setDevice` | `(device: Device, settings: IDevice)` | `RevealConfig` | Sets the settings of a device. |
| `setResponsive` | `(responsive: Responsive)` | `RevealConfig` | Updates how responsiveness is handled by the library. |
| `setObserverRoot` | `(root: Element \| Document \| null)` | `IntersectionObserverConfig` | Sets the Intersection Observer `root` element. |
| `setObserverRootMargin` | `(rootMargin: string)` | `IntersectionObserverConfig` | Sets the Intersection Observer `rootMargin` property. |
| `setObserverThreshold` | `(threshold: number)` | `IntersectionObserverConfig` | Sets the Intersection Observer `threshold` property. |
| `setObserverConfig` | `(observerConfig: IntersectionObserverConfig)` | `IntersectionObserverConfig` | Sets the Intersection Observer configuration. |
| `setConfig` | `(userConfig: RevealConfig)` | `RevealConfig` | Updates the library global configuration. |
| `setDefaultOptions` | `(options: RevealOptions)` | `RevealOptions` | Updates the default options to be used for the reveal effect. |
## Exposed functions

TODO

### `setOnce`

**signature**: `(once: boolean) => RevealConfig`

Sets the reveal animations activation status on page reload.

### `setDeviceStatus`

**signature**: `(device: Device, status: boolean) => RevealConfig`

Sets the status of a device.

### `setDevicesStatus`

**signature**: `(devices: Device[], status: boolean) => RevealConfig`

Sets the status of multiple devices.

### `setDeviceBreakpoint`

**signature**: `(device: Device, breakpoint: number) => RevealConfig`

Sets the breakpoint of a device.

### `setDevice`

**signature**: `(device: Device, settings: IDevice) => RevealConfig`

Sets the settings of a device.

### `setResponsive`

**signature**: `(responsive: Responsive) => RevealConfig`

Updates how responsiveness is handled by the library.

### `setObserverRoot`

**signature**: `(root: Element | Document | null) => IntersectionObserverConfig`

Sets the Intersection Observer `root` element.

### `setObserverRootMargin`

**signature**: `(rootMargin: string) => IntersectionObserverConfig`

Sets the Intersection Observer `rootMargin` property.

### `setObserverThreshold`

**signature**: `(threshold: number) => IntersectionObserverConfig`

Sets the Intersection Observer `threshold` property.

### `setObserverConfig`

**signature**: `(observerConfig: IntersectionObserverConfig) => IntersectionObserverConfig`

Sets the Intersection Observer configuration.

### `setConfig`

**signature**: `(userConfig: RevealConfig) => RevealConfig`

Updates the library global configuration.

### `setDefaultOptions`

**signature**: `(options: RevealOptions) => RevealOptions`

Updates the default options to be used for the reveal effect.

0 comments on commit da63df2

Please sign in to comment.