> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# X (Twitter) API TypeScript types for radar & compose

> Copy TypeScript types for Xquik radar items, styles, drafts, tweet composer results, and X write responses. Use them to type each content call in your own code.

> For the complete documentation index, see [llms.txt](https://docs.xquik.com/llms.txt).

These types belong to the [X API TypeScript types](https://docs.xquik.com/guides/x-api-typescript-types.md) set. Copy them into your `xquik-types.ts` file.

## Types

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
// ─── Radar ──────────────────────────────────────────────

interface RadarItem {
  id: string;
  title: string;
  description?: string;
  url?: string;
  imageUrl?: string;
  source: RadarSource;
  sourceId: string;
  category: RadarCategory;
  region: string;
  language: string;
  score: number;
  metadata: Record<string, unknown>;
  publishedAt: string;
  createdAt: string;
}

interface RadarList {
  items: RadarItem[];
  hasMore: boolean;
  nextCursor?: string;
}

// ─── Styles ─────────────────────────────────────────────

interface StyleProfile {
  xUsername: string;
  isOwnAccount: boolean;
  tweetCount: number;
  fetchedAt: string;
  tweets: StyleTweet[];
}

interface StyleListItem {
  xUsername: string;
  isOwnAccount: boolean;
  tweetCount: number;
  fetchedAt: string;
}

interface StyleList {
  styles: StyleListItem[];
}

interface StyleComparison {
  style1: StyleProfile;
  style2: StyleProfile;
}

interface PerformanceAnalysis {
  xUsername: string;
  tweetCount: number;
  tweets: PerformanceTweet[];
}

// ─── Drafts ─────────────────────────────────────────────

interface Draft {
  id: string;
  text: string;
  topic?: string;
  goal?: "engagement" | "followers" | "authority" | "conversation";
  createdAt: string;
  updatedAt: string;
}

interface DraftList {
  drafts: Draft[];
  hasMore: boolean;
  nextCursor?: string;
}

// ─── Compose ──────────────────────────────────────────────

interface RadarRecommendation {
  endpoint: string;
  guidance: string;
  source: RadarSource;
  useFor: string;
}

// step="compose" response
interface ComposeTweetResult {
  contentRules: { rule: string }[];
  engagementMultipliers: { action: string; multiplier: string }[];
  engagementVelocity: string;
  followUpQuestions: string[];
  intentUrl: string;
  nextStep: string;
  radarRecommendations: RadarRecommendation[];
  savedStyles?: { tweetCount: number; username: string }[];
  scorerWeights: { signal: string; weight: null; context: string }[];
  source: string;
  styleNote?: string;
  styleTweets?: string[];
  topPenalties: string[];
}

// step="refine" response
interface RefineTweetResult {
  compositionGuidance: string[];
  examplePatterns: { description: string; pattern: string }[];
  intentUrl: string;
  nextStep: string;
}

// step="score" response
interface ScoreTweetResult {
  passed: boolean;
  passedCount: number;
  totalChecks: number;
  topSuggestion: string;
  nextStep: string;
  checklist: { factor: string; passed: boolean; suggestion?: string }[];
  intentUrl?: string;
}

// ─── X Write ──────────────────────────────────────────────

interface XWriteResponse {
  success: boolean;
  data?: Record<string, unknown>;
}
```

## Next steps

* [X API TypeScript types](https://docs.xquik.com/guides/x-api-typescript-types.md)
* [Shared types](https://docs.xquik.com/guides/x-api-typescript-shared-types.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.