Skip to content

[Web API type definition issue] Missing properties in interface CookieListItem #2203

@HakurouKen

Description

@HakurouKen

Summary

CookieListItem is missing properties such as domain and expires.

Expected vs. Actual Behavior

async function exampleForCookieStoreGet() {
  const cookieItem = await cookieStore.get('test');
  if (cookieItem) {
    console.log(cookieItem.domain); // Property 'domain' does not exist on type 'CookieListItem'.
  }
}

According to MDN documentation, CookieListItem should be something like:

interface CookieListitem {
    name: string;
    value: string;
    domain?: string | null;
    expires?: DOMHighResTimeStamp | null;
    partitioned?: boolean;
    path?: string;
    sameSite?: CookieSameSite;
    secure?: boolean;
}

Playground Link

https://www.typescriptlang.org/play/?ts=6.0.0-dev.20251023#code/IYZwngdgxgBAZgV2gFwJYHsIwKYA9gC2ADgDbYAUAlDAN4BQMMUmIyT66A1qtgJLLYCMALwxgAd2Co2zLjwDKydACdsAOgDm2ZOQDkA1rsoBuBjFRwY5Wdz4CC1eo0bMIIdGTUl0G6x1v8gmoAJugEUhAmZgC+dNFAA

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions