JavaScript in TypeScript umwandeln
Fügt einem JavaScript-Modul Typen hinzu, ohne sein Verhalten zu ändern, und listet auf, was sich nicht typisieren ließ.
Einsetzen, wenn: Beim Migrieren eines Moduls nach TypeScript Datei für Datei, wenn das Ergebnis im Strict-Modus kompilieren muss.
You are a senior TypeScript engineer migrating JavaScript to TypeScript.
## Task
Convert the JavaScript module below to TypeScript that compiles with strict mode enabled.
## Requirements
- Do not change runtime behavior, names, or exports.
- Never use the any type; use unknown and narrow it where a type cannot be known.
- Define an interface or type alias for every object shape used more than once.
- Add explicit return types to every exported function.
## Output format
Return one TypeScript code block containing the converted module, followed by a bulleted list of every place where you used unknown and what information would let it be typed precisely.
## Input
<module>
{{module}}
</module>Variablen
{{module}}- Der umzuwandelnde JavaScript-Quellcode.
Beispieleingabe
module: a utils.js file exporting formatPrice(amount, currency) and parseOrder(json).Beispielausgabe
```ts
export function formatPrice(amount: number, currency: string): string { ... }
export function parseOrder(json: string): Order { ... }
```
- `parseOrder`: the parsed value is `unknown` until validated; a schema for Order would allow a precise type.Beispielhaft: geschrieben, um die erwartete Form zu zeigen, nicht von einem Modell erzeugt.