open-index/open-npm huggingface dataset:
npm package: @kovaldev/shelter-sanity-types
Description: This package contains automatically generated TypeScript types for the Sanity CMS schema used in the shelter project.
Latest version: 0.1.14

# @kovaldev/shelter-sanity-types

This package contains automatically generated TypeScript types for the Sanity CMS schema used in the shelter project.

## Installation

```bash
npm install @kovaldev/shelter-sanity-types
```

## Usage

```typescript
import type {SanityDocument, SanityImageAsset} from '@kovaldev/shelter-sanity-types'

// Use the types in your components
interface MyComponentProps {
  document: SanityDocument
  image: SanityImageAsset
}
```

## Auto-updates

This package is automatically updated and published whenever the Sanity schema changes. The types are generated from:

- `schemaTypes/**` - All schema type definitions
- `schema.json` - The compiled schema
- `sanity.config.*` - Sanity configuration files

## Development

To generate types locally, run from the root of the project:

```bash
npm run gen:types
```

This will update the `sanity.types.ts` file in this package.

## TypeScript Integration

The generated types in this package provide full TypeScript support for your Sanity content:

```typescript
import type { Event, Page, Service } from '@kovaldev/shelter-sanity-types'

// Your content will be properly typed
interface ContentResponse {
  events: Event[]
  pages: Page[]
  services: Service[]
}

// Use the types for your components
interface EventCardProps {
  event: Event
}

const EventCard: React.FC<EventCardProps> = ({ event }) => {
  return (
    <div>
      <h3>{event.title}</h3>
      <p>{event.description}</p>
      {/* TypeScript will provide autocomplete and type checking */}
    </div>
  )
}
```

## Benefits

- **Type-safe**: Full TypeScript integration with generated types
- **Auto-updating**: Types are automatically generated from your schema
- **Comprehensive**: Covers all your Sanity schema types
- **Performance**: No runtime overhead, compile-time type checking only