Type expression

Other utility types

  • Utility types
  • Tested with TypeScript 5.9

Besides the common utility types that have their own pages, TypeScript ships several more. All of them work inside JSDoc braces unchanged; this page covers the rest, with what each is for.

Record<K, V> has its own page under Collections.

At a glance

Use JSDoc in a .js file TypeScript in a .ts file
The instance of a class {InstanceType<typeof Cart>} InstanceType<typeof Cart>
A constructor's parameters {ConstructorParameters<typeof Cart>} ConstructorParameters<typeof Cart>
Infer from one argument only /** @param {NoInfer<T>} fallback */ (fallback: NoInfer<T>)
Change a string's case {Uppercase<Kind>} Uppercase<Kind>
A function's this type {ThisParameterType<typeof fn>} ThisParameterType<typeof fn>

Examples

cart.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
export class Cart {
  /**
   * @param {string} owner
   * @param {string} [currency]
   */
  constructor(owner, currency = "USD") {
    this.owner = owner;
    this.currency = currency;
  }
}

/** @typedef {InstanceType<typeof Cart>} CartInstance */
/** @typedef {ConstructorParameters<typeof Cart>} CartArgs */

/** @type {CartArgs} */
const args = ["Jane", "EUR"];

/** @type {CartInstance} */
const cart = new Cart(...args);
cart.currency.toLowerCase();

export { cart };
InstanceType and ConstructorParameters.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}
codes.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: codes.js(8,7): error TS2820: Type '"Tee"' is not assignable to type '"TEE" | "MUG"'. Did you mean '"TEE"'? 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. codes.js(8,7): error TS2820: Type '"Tee"' is not assignable to type '"TEE" | "MUG"'. Did you mean '"TEE"'? 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. codes.js(8,7): error TS2820: Type '"Tee"' is not assignable to type '"MUG" | "TEE"'. Did you mean '"TEE"'? checked 21 October 2026
/** @typedef {"tee" | "mug"} Kind */
/** @typedef {Uppercase<Kind>} KindCode */

/** @type {KindCode} */
const ok = "TEE";
/** @type {KindCode} */
const wrong = "Tee";error TS2820: Type '"Tee"' is not assignable to type '"TEE" | "MUG"'. Did you mean '"TEE"'?

/** @type {Capitalize<Kind>} */
const label = "Mug";

export { ok, wrong, label };
The intrinsic string types.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}
pick.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: pick.js(12,27): error TS2345: Argument of type '"XL"' is not assignable to parameter of type '"S" | "M" | "L"'. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. pick.js(12,27): error TS2345: Argument of type '"XL"' is not assignable to parameter of type '"S" | "M" | "L"'. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. pick.js(12,27): error TS2345: Argument of type '"XL"' is not assignable to parameter of type '"L" | "M" | "S"'. checked 21 October 2026
/**
 * @template {string} T
 * @param {T[]} sizes
 * @param {NoInfer<T>} fallback
 */
export function pickSize(sizes, fallback) {
  return sizes[0] ?? fallback;
}

pickSize(["S", "M", "L"], "M");
pickSize(["S", "M", "L"], "XL");error TS2345: Argument of type '"XL"' is not assignable to parameter of type '"S" | "M" | "L"'.
NoInfer<T>: infer from one argument only.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

InstanceType and ConstructorParameters

InstanceType<typeof Cart> is the type of new Cart(…), and ConstructorParameters<typeof Cart> is the tuple of the constructor's parameter types. They matter when a class arrives as a value, for example in a factory typed with a generic constructor type; for a class you can name, {Cart} is already the instance type. The handbook lists InstanceType from TypeScript 2.8 and ConstructorParameters from 3.1.

NoInfer

NoInfer<T> stops TypeScript from using an argument to infer T. In the third example, T is inferred from sizes alone, so the fallback must be one of those sizes and "XL" is TS2345. Without NoInfer, the fallback would widen T to include "XL". The handbook lists it from TypeScript 5.4.

Uppercase, Lowercase, Capitalize, Uncapitalize

These change the case of string literal types: Uppercase<"tee" | "mug"> is "TEE" | "MUG", so "Tee" is rejected (TS2820, with a suggestion), as the second example shows. They are mostly used inside template literal types.

ThisParameterType and OmitThisParameter

ThisParameterType<F> is the declared this type of a function type, and OmitThisParameter<F> is the same function type without it, which is what fn.bind(obj) returns. The handbook lists both from TypeScript 3.3.

Gotchas

  • ThisType<T> is a marker for object literals that sets the type of this inside their methods; it does nothing on its own and needs noImplicitThis.
  • Utility types are ordinary type declarations in TypeScript's standard library, so they need no import and work in every JSDoc tag that takes a type.

Questions

Can I use every TypeScript utility type in JSDoc?

Yes. They are part of TypeScript's built-in library, and a JSDoc type is TypeScript type syntax, so Partial, Pick, NoInfer and the rest all work inside the braces.

Sources

Last reviewed 20 October 2026.