From de02dc4f9ea755406ef451e4225ba7533882be42 Mon Sep 17 00:00:00 2001 From: itsrubberduck Date: Tue, 17 Feb 2026 18:19:55 +0100 Subject: [PATCH] typescript --- server/api/atc/say.post.ts | 1 - server/api/service/tools/airportGeocode.ts | 5 +++-- server/api/service/tools/latency.get.ts | 2 -- shared/data/learnModules.ts | 12 ++++++------ types/aos.d.ts | 21 +++++++++++++++++++++ 5 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 types/aos.d.ts diff --git a/server/api/atc/say.post.ts b/server/api/atc/say.post.ts index 50b2c77..b916ea2 100644 --- a/server/api/atc/say.post.ts +++ b/server/api/atc/say.post.ts @@ -193,7 +193,6 @@ export default defineEventHandler(async (event) => { const tts = await normalize.audio.speech.create({ model: TTS_MODEL, voice, - format: "wav", input: normalized, speed }); diff --git a/server/api/service/tools/airportGeocode.ts b/server/api/service/tools/airportGeocode.ts index f2bd69a..e8bdc54 100644 --- a/server/api/service/tools/airportGeocode.ts +++ b/server/api/service/tools/airportGeocode.ts @@ -214,8 +214,9 @@ function createFeature(element: OsmElement): AirportFeature | null { if (lat === undefined || lon === undefined) return null - const { aliases, primaryAlias } = buildAliases(tags, featureType) - if (aliases.length === 0 || !primaryAlias) return null + const aliasResult = buildAliases(tags, featureType) + if (aliasResult.aliases.length === 0 || !aliasResult.primaryAlias) return null + const { aliases, primaryAlias } = aliasResult as { aliases: string[]; primaryAlias: string } const normalizedAliases = new Map() for (const alias of aliases) { diff --git a/server/api/service/tools/latency.get.ts b/server/api/service/tools/latency.get.ts index 0e7dbaa..f779f47 100644 --- a/server/api/service/tools/latency.get.ts +++ b/server/api/service/tools/latency.get.ts @@ -20,9 +20,7 @@ export default defineEventHandler(async () => { try { const response = await client.chat.completions.create({ model, - reasoning_effort: 'low', n: 1, - verbosity: 'low', messages: [ { role: 'system', content: SYSTEM_PROMPT }, { role: 'user', content: `${READBACK}` } diff --git a/shared/data/learnModules.ts b/shared/data/learnModules.ts index 3f93e49..2f34ca8 100644 --- a/shared/data/learnModules.ts +++ b/shared/data/learnModules.ts @@ -1,5 +1,5 @@ import { createBaseScenario, createScenarioSeries, digitsToWords, formatTemp, lettersToNato } from '~~/shared/learn/scenario' -import type { ModuleDef, Scenario } from '~~/shared/learn/types' +import type { Lesson, ModuleDef, Scenario } from '~~/shared/learn/types' function gradientArt(colors: string[]): string { const stops = colors @@ -14,7 +14,7 @@ function randInt(min: number, max: number): number { } function sample(values: readonly T[]): T { - return values[randInt(0, values.length - 1)] + return values[randInt(0, values.length - 1)]! } const identifierCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' @@ -75,7 +75,7 @@ function createComplexTaxiScenario(): Scenario { return scenario } -const fundamentalsLessons = [ +const fundamentalsLessons: Lesson[] = [ { id: 'icao-alphabet', title: 'Decode ICAO Letters & Numbers', @@ -564,7 +564,7 @@ const fundamentalsLessons = [ } ] -const readbackLessons = [ +const readbackLessons: Lesson[] = [ { id: 'clearance-readback', title: 'Clearance Readback', @@ -1810,7 +1810,7 @@ const readbackLessons = [ } ] -const decisionTreeLessons = [ +const decisionTreeLessons: Lesson[] = [ { id: 'clearance-contact', title: 'Delivery: Initial contact', @@ -2534,7 +2534,7 @@ const makeFullFlightGenerator = (reset = false) => () => { return fullFlightScenario() } -const fullFlightLessons = [ +const fullFlightLessons: Lesson[] = [ { id: 'full-clearance-contact', title: 'Delivery Contact', diff --git a/types/aos.d.ts b/types/aos.d.ts new file mode 100644 index 0000000..897f7bf --- /dev/null +++ b/types/aos.d.ts @@ -0,0 +1,21 @@ +declare module 'aos' { + interface AOSOptions { + offset?: number + delay?: number | string + duration?: number | string + easing?: string + once?: boolean + mirror?: boolean + anchorPlacement?: string + disable?: boolean | string | (() => boolean) + } + + interface AOS { + init(options?: AOSOptions): void + refresh(force?: boolean): void + refreshHard(): void + } + + const aos: AOS + export default aos +}