TypeScript SDK

TypeScript Type Declarations (.d.ts)

Overview

Strongly typed interface declarations for Posts, Users, Comments, Todos, Auth, and Custom payload schemas for full auto-complete in VS Code.

Using Our TypeScript SDK Collection

We've prepared a comprehensive TypeScript SDK collection that includes all available endpoints in our API, properly organized and documented. This collection will help you:

  1. Full TypeScript IntelliSense auto-complete in VS Code and IDEs.
  2. Eliminates type errors when sending POST/PUT payloads to Playground API.
  3. Includes Post, Comment, User, Todo, and Auth payload interfaces.
TypeScript SDK Workspace Preview
1
import { Post, User, AuthPayload } from './types/playground-api';
2
3
const post: Post = {
4
id: 'local-123',
5
title: 'Typed Sandbox Post',
6
body: 'Full type safety!',
7
user_id: 1
8
};

Getting Started

  1. Download playground-api.d.ts file below.
  2. Save the file in your project under src/types/playground-api.d.ts.
  3. Ensure tsconfig.json includes "src/**/*.d.ts" in the include array.
  4. Import types into your React/Next.js components!