Files
freewriting-prompts/types.ts
T
Jarvis 49e3f5523c fix: address Obsidian review bot issues
- Move inline styles from TypeScript to CSS for better theme compatibility
- Remove "Freewriting" from command names to follow Obsidian conventions
- Fix TypeScript type casting by properly typing model as AnthropicModel
- Update to latest Claude models including Opus 4.1 and Sonnet 4

Changes:
• commands/staggeredPrompts.ts: Replace inline styles with CSS class
• main.ts: Rename commands to "Show Staggered Prompts" and "Add Note Prompts"
• settings.ts: Remove 'as any' cast and update default model
• styles.css: Add .freewriting-prompt-notice class with proper styling
• types.ts: Change model field type from string to AnthropicModel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 10:32:35 +02:00

58 lines
1.3 KiB
TypeScript

// ABOUTME: Type definitions for the Freewriting Prompts plugin
// ABOUTME: Defines interfaces for settings, API responses, and plugin configuration
export interface FreewritingPromptsSettings {
apiKey: string;
model: AnthropicModel;
staggeredCount: number;
delaySeconds: number;
noteCount: number;
systemPrompt: string;
staggeredExamplePrompt: string;
freewritingExamplePrompt: string;
}
export interface AnthropicMessage {
role: 'user' | 'assistant' | 'system';
content: string;
}
export interface AnthropicRequest {
model: string;
max_tokens: number;
messages: AnthropicMessage[];
system?: string;
}
export interface AnthropicResponse {
content: Array<{
text: string;
type: 'text';
}>;
id: string;
model: string;
role: 'assistant';
stop_reason: string;
stop_sequence: null;
type: 'message';
usage: {
input_tokens: number;
output_tokens: number;
};
}
export interface GeneratedPrompt {
text: string;
timestamp: Date;
}
export const ANTHROPIC_MODELS = [
'claude-opus-4-1-20250805',
'claude-opus-4-20250514',
'claude-sonnet-4-20250514',
'claude-3-7-sonnet-latest',
'claude-3-5-haiku-latest',
'claude-3-haiku-20240307'
] as const;
export type AnthropicModel = typeof ANTHROPIC_MODELS[number];