This commit is contained in:
Gregory Schier
2026-02-05 15:46:59 -08:00
parent 3ad57c125f
commit f3bd552b15

View File

@@ -1,5 +1,5 @@
import { type HarRequest, availableTargets, HTTPSnippet } from '@readme/httpsnippet'; import { type HarRequest, availableTargets, HTTPSnippet } from '@readme/httpsnippet';
import type { HttpRequest, PluginDefinition } from '@yaakapp/api'; import type { EditorLanguage, HttpRequest, PluginDefinition } from '@yaakapp/api';
// Get all available targets and build select options // Get all available targets and build select options
const targets = availableTargets(); const targets = availableTargets();
@@ -44,7 +44,7 @@ const defaultTarget = 'javascript';
const defaultClient = 'fetch'; const defaultClient = 'fetch';
// Map httpsnippet target key to editor language for syntax highlighting // Map httpsnippet target key to editor language for syntax highlighting
const editorLanguageMap: Record<string, string> = { const editorLanguageMap: Record<string, EditorLanguage> = {
c: 'c', c: 'c',
clojure: 'clojure', clojure: 'clojure',
csharp: 'csharp', csharp: 'csharp',
@@ -66,7 +66,7 @@ const editorLanguageMap: Record<string, string> = {
swift: 'swift', swift: 'swift',
}; };
function getEditorLanguage(targetKey: string): string { function getEditorLanguage(targetKey: string): EditorLanguage {
return editorLanguageMap[targetKey] ?? 'text'; return editorLanguageMap[targetKey] ?? 'text';
} }