Skip to content
Back to skills

Defining Typescript Models

ASecurity

Defines standard TypeScript interfaces for Appwrite Collections. Use when creating new models for Tours, Users, or Bookings to ensure full type safety.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
developmenttypescriptdatabasefrontend

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill defining-typescript-models --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Defining Typescript Models?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Defining Typescript Models
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-defining-typescript-models/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-defining-typescript-models)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: defining-typescript-models
description: Defines standard TypeScript interfaces for Appwrite Collections. Use when creating new models for Tours, Users, or Bookings to ensure full type safety.
---

# TypeScript Models and Interfaces

## When to use this skill
- When defining the data structure for a new Appwrite collection.
- When creating props for components that data-fetch.
- To avoid using `any` across the codebase.

## Workflow
- [ ] Export interfaces from a central `types/` directory.
- [ ] Include standard Appwrite fields (`$id`, `$createdAt`, `$updatedAt`, `$permissions`).
- [ ] Use Enums for fields with fixed values (e.g., `BookingStatus`).

## Example Template
```typescript
import { Models } from 'appwrite';

export interface Tour extends Models.Document {
    title: string;
    description: string;
    price: number;
    location: string;
    images: string[];
    rating: number;
    availableDates: string[]; // ISO Strings
}

export type BookingStatus = 'pending' | 'confirmed' | 'cancelled';

export interface Booking extends Models.Document {
    userId: string;
    tourId: string;
    status: BookingStatus;
    totalPrice: number;
}
```

## Instructions
- **Generics**: Use these interfaces with Appwrite SDK methods: `databases.listDocuments<Tour>(...)`.
- **Readonly**: Mark fields as `readonly` if they shouldn't be mutated by the frontend.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.