diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index e57beacd2559b0..1bba9f2d6b5e13 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -25,6 +25,7 @@ const MyVisitor2: Visitor = { }, ArrayExpression(path) { path.get("elements"); // $ExpectType NodePath[] + path.get("elements.0"); // $ExpectType NodePath }, Program(path) { path.parentPath; // $ExpectType null @@ -374,6 +375,7 @@ const objectTypeAnnotation: NodePath = new NodePath +objectTypeAnnotation.get("indexers.0"); // $ExpectType NodePath // Test that NodePath can be narrowed from union to single type const path: NodePath = new NodePath( @@ -427,7 +429,9 @@ binding.deopValue(); binding.clearValue(); binding.reassign(newPath.get("body")[0]); +binding.reassign(newPath.get("body.0")); binding.reference(newPath.get("body")[0]); +binding.reference(newPath.get("body.0")); binding.dereference(); newPath.scope.checkBlockScopedCollisions(binding, "local", "name", {}); diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index d6cccce88c306f..980425fd302aec 100644 --- a/types/babel__traverse/index.d.ts +++ b/types/babel__traverse/index.d.ts @@ -746,6 +746,7 @@ export class NodePath { getAllNextSiblings(): NodePath[]; get(key: K, context?: boolean | TraversalContext): NodePathResult; + get

(path: P, context?: boolean | TraversalContext): NodePathResult>; get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[]; getBindingIdentifiers(duplicates: true): Record; @@ -1448,6 +1449,27 @@ export interface TraversalContext { opts: TraverseOptions; } +// Based on `GetFieldType`s from `@types/lodash/common/object.d.ts`: +// dprint-ignore +type ImplGetOfArray = + K extends `${infer N extends number}` ? T[N] + : K extends keyof T ? T[K] + : never; + +// dprint-ignore +type ImplGetByKey + = T extends readonly unknown[] ? ImplGetOfArray + : K extends keyof T ? T[K] + : K extends `${infer N extends number}` + ? N extends keyof T ? T[N] : never + : never; + +// dprint-ignore +type ImplGetRecursive + = K extends `${infer L}.${infer R}` + ? ImplGetRecursive, R> + : ImplGetByKey; + export type NodePathResult = | (Extract extends never ? never : NodePath>) | (T extends Array ? Array> : never); diff --git a/types/dom-speech-recognition/dom-speech-recognition-tests.ts b/types/dom-speech-recognition/dom-speech-recognition-tests.ts index 16de0fd3f64e1c..8b6dd40f6dd9aa 100644 --- a/types/dom-speech-recognition/dom-speech-recognition-tests.ts +++ b/types/dom-speech-recognition/dom-speech-recognition-tests.ts @@ -64,6 +64,11 @@ const speechRecognition2: SpeechRecognition = { }; const speechRecognition3 = new webkitSpeechRecognition(); +const speechRecognition4: SpeechRecognition = { + ...speechRecognition2, + start: (audioTrack: MediaStreamTrack) => undefined, +}; + const speechRecognitionResultList = new SpeechRecognitionResultList(); const speechRecognitionEventInit: SpeechRecognitionEventInit = { diff --git a/types/dom-speech-recognition/index.d.ts b/types/dom-speech-recognition/index.d.ts index 7b063701854027..f03791e03e43a8 100644 --- a/types/dom-speech-recognition/index.d.ts +++ b/types/dom-speech-recognition/index.d.ts @@ -32,7 +32,7 @@ interface SpeechRecognition extends EventTarget { onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null; onstart: ((this: SpeechRecognition, ev: Event) => any) | null; abort(): void; - start(): void; + start(audioTrack?: MediaStreamTrack): void; stop(): void; addEventListener( type: K, diff --git a/types/gorilla-engine/components/MappingEditor.d.ts b/types/gorilla-engine/components/MappingEditor.d.ts index cf9429c2285d19..0d7174527642c7 100644 --- a/types/gorilla-engine/components/MappingEditor.d.ts +++ b/types/gorilla-engine/components/MappingEditor.d.ts @@ -12,6 +12,8 @@ declare namespace GorillaEngine.UI { interface MappingEditorProps extends Common, Bounds, Background { zones?: Zone[]; refreshView(index?: number): void; + selectAllZones(): void; + deselectAllZones(): void; addZone(zone: Partial): Zone; removeZone(zone: Partial): void; } diff --git a/types/gorilla-engine/gorilla-engine-tests.ts b/types/gorilla-engine/gorilla-engine-tests.ts index d2624d4c643e7a..7d4550b0ec9932 100644 --- a/types/gorilla-engine/gorilla-engine-tests.ts +++ b/types/gorilla-engine/gorilla-engine-tests.ts @@ -14,4 +14,4 @@ const label = new GorillaEngine.UI.Label({ margin: 5 }); const slider = new GorillaEngine.UI.Slider({ id: "slider", x: 0 }); -const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "myMappingEditor" }); +const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "MappingEditor" }); diff --git a/types/k6/package.json b/types/k6/package.json index f0dfba223b47f8..0e461a8438759b 100644 --- a/types/k6/package.json +++ b/types/k6/package.json @@ -44,10 +44,6 @@ "name": "Théo Crevon", "githubUsername": "oleiade" }, - { - "name": "Oleg Bespalov", - "githubUsername": "olegbespalov" - }, { "name": "Ankur Agarwal", "githubUsername": "ankur22" diff --git a/types/mailchimp__mailchimp_transactional/package.json b/types/mailchimp__mailchimp_transactional/package.json index 3f62653f1e7d45..e6ef2a9bc29f6c 100644 --- a/types/mailchimp__mailchimp_transactional/package.json +++ b/types/mailchimp__mailchimp_transactional/package.json @@ -6,7 +6,7 @@ "https://github.com/mailchimp/mailchimp-transactional-node" ], "dependencies": { - "axios": "^1.6.7" + "axios": "^1.8.2" }, "devDependencies": { "@types/mailchimp__mailchimp_transactional": "workspace:." diff --git a/types/mysql/index.d.ts b/types/mysql/index.d.ts index 45ae94f58360a3..43d133ce33130c 100644 --- a/types/mysql/index.d.ts +++ b/types/mysql/index.d.ts @@ -286,7 +286,7 @@ export type TypeCast = buffer(): null | Buffer; geometry(): null | GeometryType; }, - next: () => void, + next: () => any, ) => any); export type queryCallback = (err: MysqlError | null, results?: any, fields?: FieldInfo[]) => void; diff --git a/types/mysql/mysql-tests.ts b/types/mysql/mysql-tests.ts index 4ece1e096a8fc3..d3c90d745b9eda 100644 --- a/types/mysql/mysql-tests.ts +++ b/types/mysql/mysql-tests.ts @@ -442,7 +442,7 @@ connection.query({ if (field.type === "TINY" && field.length === 1) { return (field.string() === "1"); // 1 = true, 0 = false } - next(); + return next(); }, }); @@ -456,7 +456,7 @@ connection.query({ } return (JSON.parse(string)); } - next(); + return next(); }, }); diff --git a/types/semver/index.d.ts b/types/semver/index.d.ts index 62a994bbe3f1ab..341d4cfb885f4b 100644 --- a/types/semver/index.d.ts +++ b/types/semver/index.d.ts @@ -101,7 +101,7 @@ export const SEMVER_SPEC_VERSION: "2.0.0"; export const RELEASE_TYPES: ReleaseType[]; -export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease"; +export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease" | "release"; export interface Options { loose?: boolean | undefined; diff --git a/types/semver/package.json b/types/semver/package.json index 677f87a6e760c6..83c0bd1a8cb793 100644 --- a/types/semver/package.json +++ b/types/semver/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/semver", - "version": "7.5.9999", + "version": "7.7.9999", "projects": [ "https://github.com/npm/node-semver" ], diff --git a/types/semver/semver-tests.ts b/types/semver/semver-tests.ts index c0e60c4a05bcde..6988e73e9b360a 100644 --- a/types/semver/semver-tests.ts +++ b/types/semver/semver-tests.ts @@ -169,6 +169,7 @@ strn = semver.inc(str, "prerelease", "beta"); strn = semver.inc("1.2.3", "prerelease", "alpha", "0"); strn = semver.inc("1.2.3", "prerelease", "alpha", "1"); strn = semver.inc("1.2.3", "prerelease", "beta", false); +let res: string | null = semver.inc("1.2.3", "release"); // $ExpectType string | null num = semver.major(str, loose); num = semver.major(str, { loose: false }); // @ts-expect-error