xquik-types.ts file.
Types
// ─── 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>;
}