open-index/open-npm huggingface dataset:
npm package: @infogata/audiogata-plugin-typings
Description: Typings for the AudioGata Plugin API
Author: Elijah Green
Latest version: 1.16.0

# audiogata-plugin-typings

[![npm (scoped)](https://img.shields.io/npm/v/@infogata/audiogata-plugin-typings)](https://www.npmjs.com/package/@infogata/audiogata-plugin-typings)

Types for [audiogata](https://github.com/InfoGata/audiogata) plugins.

## Installation

```sh
npm i --save-dev @infogata/audiogata-plugin-typings
```

## Usage

Configure _tsconfig.json_

```js
{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@infogata"
    ]
  }
}
```

or

Import in script

```js
import "@infogata/audiogata-plugin-typings";
```
npm package: @infogata/extension-components
Description: React context and hook for browser extension detection with polling
Latest version: 0.1.0

# @infogata/extension-components

React context and hook for browser extension detection with configurable polling.

## Installation

```bash
npm install @infogata/extension-components
```

## Usage

### Basic Setup

Wrap your application with `ExtensionProvider` and provide a `hasExtension` function that returns `true` when the extension is detected:

```tsx
import { ExtensionProvider } from "@infogata/extension-components";

// Define your extension detection logic
const hasExtension = () => {
  return typeof window !== "undefined" && typeof window.MyExtensionAPI !== "undefined";
};

function App() {
  return (
    <ExtensionProvider hasExtension={hasExtension}>
      <YourApp />
    </ExtensionProvider>
  );
}
```

### Using the Hook

```tsx
import { useExtension } from "@infogata/extension-components";

function MyComponent() {
  const { extensionDetected } = useExtension();

  if (extensionDetected === null) {
    return <div>Checking for extension...</div>;
  }

  if (!extensionDetected) {
    return <div>Please install our browser extension</div>;
  }

  return <div>Extension detected! Full functionality available.</div>;
}
```

### Custom Polling Configuration

```tsx
<ExtensionProvider
  hasExtension={hasExtension}
  initialPollInterval={50}      // Poll every 50ms initially (default: 100ms)
  initialPollDuration={5000}    // Initial phase lasts 5 seconds (default: 3000ms)
  slowPollInterval={5000}       // After initial phase, poll every 5 seconds (default: 2000ms)
>
  <App />
</ExtensionProvider>
```

## API

### ExtensionProvider Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `React.ReactNode` | required | Child components |
| `hasExtension` | `() => boolean` | required | Function that returns true when extension is detected |
| `initialPollInterval` | `number` | `100` | Polling interval in ms during initial phase |
| `initialPollDuration` | `number` | `3000` | Duration of initial aggressive polling phase in ms |
| `slowPollInterval` | `number` | `2000` | Polling interval in ms after initial phase |

### useExtension Return Value

| Property | Type | Description |
|----------|------|-------------|
| `extensionDetected` | `boolean \| null` | `null` during initial detection, `true` if detected, `false` if not detected |

## How It Works

1. On mount, immediately checks for extension
2. If not immediately detected, polls at `initialPollInterval` for `initialPollDuration`
3. After initial phase, sets `extensionDetected` to `false` but continues polling at `slowPollInterval`
4. Once detected, stops polling and sets `extensionDetected` to `true`

This allows for fast detection when the extension loads quickly, while still detecting extensions that load after the page.

## Type Exports

```tsx
import type {
  ExtensionProviderProps,
  ExtensionContextType
} from "@infogata/extension-components";
```

## License

MIT
npm package: @infogata/readergata-plugin-typings
Description: Typings for the ReaderGata Plugin API
Author: Elijah Green
Latest version: 1.7.0

# readergata-plugin-typings

[![npm (scoped)](https://img.shields.io/npm/v/@infogata/readergata-plugin-typings)](https://www.npmjs.com/package/@infogata/readergata-plugin-typings)

Types for [readergata](https://github.com/InfoGata/readergata) plugins.

## Installation

```sh
npm i --save-dev @infogata/readergata-plugin-typings
```

## Usage

Configure _tsconfig.json_

```js
{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@infogata"
    ]
  }
}
```

or

Import in script

```js
import "@infogata/readergata-plugin-typings";
```
npm package: @infogata/shadcn-vite-theme-provider
Description: React dark mode theme provider based on shadcn/ui pattern for Vite
Latest version: 0.1.0

# @infogata/shadcn-vite-theme-provider

A React dark mode theme provider based on the [shadcn/ui](https://ui.shadcn.com/docs/dark-mode/vite) pattern for Vite applications.

## Installation

```bash
npm install @infogata/shadcn-vite-theme-provider
```

## Usage

### Wrap your app with ThemeProvider

```tsx
import { ThemeProvider } from "@infogata/shadcn-vite-theme-provider";

function App() {
  return (
    <ThemeProvider defaultTheme="system" storageKey="vite-ui-theme">
      <YourApp />
    </ThemeProvider>
  );
}
```

### Use the useTheme hook

```tsx
import { useTheme } from "@infogata/shadcn-vite-theme-provider";

function ThemeToggle() {
  const { theme, setTheme } = useTheme();

  return (
    <button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
      Toggle theme
    </button>
  );
}
```

### Example: Dropdown theme selector

```tsx
import { useTheme } from "@infogata/shadcn-vite-theme-provider";

function ModeToggle() {
  const { setTheme } = useTheme();

  return (
    <select onChange={(e) => setTheme(e.target.value as "light" | "dark" | "system")}>
      <option value="light">Light</option>
      <option value="dark">Dark</option>
      <option value="system">System</option>
    </select>
  );
}
```

## API

### ThemeProvider

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `React.ReactNode` | - | Child components |
| `defaultTheme` | `"light" \| "dark" \| "system"` | `"system"` | Default theme |
| `storageKey` | `string` | `"vite-ui-theme"` | localStorage key for persistence |

### useTheme

Returns an object with:

| Property | Type | Description |
|----------|------|-------------|
| `theme` | `"light" \| "dark" \| "system"` | Current theme |
| `setTheme` | `(theme: Theme) => void` | Function to change theme |

## Types

```typescript
import type { Theme, ThemeProviderProps, ThemeProviderState } from "@infogata/shadcn-vite-theme-provider";
```

## How it works

- Adds `dark` or `light` class to `document.documentElement`
- Persists theme selection to localStorage
- Respects system preference when set to `"system"`
- Works with Tailwind CSS dark mode (`darkMode: "class"`)

## License

MIT
npm package: @infogata/socialgata-plugin-typings
Description: Typings for the SocialGata Plugin API
Author: Elijah Green
Latest version: 0.4.0

# socialgata-plugin-typings

[![npm (scoped)](https://img.shields.io/npm/v/@infogata/socialgata-plugin-typings)](https://www.npmjs.com/package/@infogata/socialgata-plugin-typings)

Types for [socialgata](https://github.com/InfoGata/socialgata) plugins.

## Installation

```sh
npm i --save-dev @infogata/socialgata-plugin-typings
```

## Usage

Configure _tsconfig.json_

```json
{
  "compilerOptions": {
    "types": ["@infogata/socialgata-plugin-typings"]
  }
}
```

or

Import in script

```js
import "@infogata/socialgata-plugin-typings";
```

## Plugin Methods

SocialGata plugins can implement the following callback methods:

### Feed Methods
- `onGetFeed(request?: GetFeedRequest)` - Get the main feed/timeline
- `onGetCommunity(request: GetCommunityRequest)` - Get posts from a specific community
- `onGetCommunities(request: GetCommunitiesRequest)` - Get list of communities
- `onSearch(request: SearchRequest)` - Search for posts

### Comment Methods
- `onGetComments(request: GetCommentsRequest)` - Get comments for a post
- `onGetCommentReplies(request: GetCommentRepliesRequest)` - Get replies to a comment

### User Methods
- `onGetUser(request: GetUserRequest)` - Get a user's profile and posts

### Instance Methods (Federated Platforms)
- `onGetInstances(request?: GetInstancesRequest)` - Get available instances

### Trending Methods
- `onGetTrendingTopics(request?: GetTrendingTopicsRequest)` - Get trending topics/hashtags
- `onGetTrendingTopicFeed(request: GetTrendingTopicFeedRequest)` - Get posts for a trending topic

### Authentication Methods
- `onLogin(request: LoginRequest)` - Handle login
- `onLogout()` - Handle logout
- `onIsLoggedIn()` - Check login status
- `onPostLogin()` - Called after successful login
- `onPostLogout()` - Called after logout

### UI Methods
- `onUiMessage(message: any)` - Receive messages from UI frames
- `onChangeTheme(theme: Theme)` - Called when theme changes
- `onGetPlatformType()` - Return the platform type (forum, microblog, imageboard)
npm package: @infogata/utils
Description: Utility functions for infogata projects
Author: Infogata
Latest version: 0.1.2

# @infogata/utils

[![npm version](https://img.shields.io/npm/v/@infogata/utils.svg)](https://www.npmjs.com/package/@infogata/utils)

A TypeScript utility library providing common functions and helpers for Infogata projects.

## Projects Using This Library

- [VideoGata](https://github.com/InfoGata/videogata)
- [AudioGata](https://github.com/InfoGata/audiogata)

## Installation

```bash
npm install @infogata/utils
```

## Usage

```typescript
import { formatSeconds, getThumbnailImage, mergeItems } from '@infogata/utils';

// Format seconds to time string
const formatted = formatSeconds(125); // '02:05'

// Get appropriate thumbnail image
const images = [
  { height: 50, url: 'small.jpg' },
  { height: 100, url: 'medium.jpg' },
  { height: 200, url: 'large.jpg' }
];
const thumbnail = getThumbnailImage(images, 100); // 'medium.jpg'

// Merge arrays with unique IDs
const items1 = [{ id: '1', name: 'Item 1' }];
const items2 = [{ id: '2', name: 'Item 2' }];
const merged = mergeItems(items1, items2);
```

## API Reference

### Time Utilities

- `formatSeconds(seconds?: number): string` - Formats seconds into a time string (MM:SS or HH:MM:SS)

### Image Utilities

- `getThumbnailImage(images: Array<{ height?: number; url: string }> | undefined, size: number): string | undefined` - Retrieves the smallest image bigger than the target size, or the largest if none are big enough

### Async Utilities

- `mapAsync<T, U>(array: T[], callback: (value: T, index: number) => Promise<U>): Promise<U[]>` - Maps an array asynchronously using Promise.all
- `filterAsync<T>(array: T[], predicate: (value: T, index: number) => Promise<boolean>): Promise<T[]>` - Filters an array asynchronously

### Collection Utilities

- `mergeItems<T extends { id: string }>(items1: T[], items2: T[]): T[]` - Merges two arrays of items with IDs, removing duplicates and preserving the second array's values for duplicates

## Development

```bash
# Install dependencies
npm install

# Run development server
npm run dev

# Run tests
npm test
npm run test:watch

# Lint code
npm run lint

# Build for production
npm run build
```

## License

MIT
npm package: @infogata/videogata-plugin-typings
Description: Typings for the VideoGata Plugin API
Author: Elijah Green
Latest version: 1.12.0

# videogata-plugin-typings

[![npm (scoped)](https://img.shields.io/npm/v/@infogata/videogata-plugin-typings)](https://www.npmjs.com/package/@infogata/videogata-plugin-typings)

Types for [videogata](https://github.com/InfoGata/videogata) plugins.

## Installation

```sh
npm i --save-dev @infogata/videogata-plugin-typings
```

## Usage

Configure _tsconfig.json_

```js
{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@infogata"
    ]
  }
}
```

or

Import in script

```js
import "@infogata/videogata-plugin-typings";
```