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:
- Full TypeScript IntelliSense auto-complete in VS Code and IDEs.
- Eliminates type errors when sending POST/PUT payloads to Playground API.
- Includes Post, Comment, User, Todo, and Auth payload interfaces.
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
- Download playground-api.d.ts file below.
- Save the file in your project under src/types/playground-api.d.ts.
- Ensure tsconfig.json includes "src/**/*.d.ts" in the include array.
- Import types into your React/Next.js components!