Skip to content

Export RTK-owned Draft and WritableDraft types #5516

Closed

Description

@markerikson

Part of #5491.

Inferred types for slices and RTKQ cache updaters reference Immer's internal draft types (for example WritableNonArrayDraft). When an app or library emits declarations, TypeScript either writes an import of Immer internals into the .d.ts or fails because it can't name the type. Kibana ran into this (elastic/kibana#282216).

We should export our own Draft and WritableDraft types from RTK and use them in our public signatures, so declaration output only references @reduxjs/toolkit. Add a declaration-emit fixture test that fails if an Immer type name shows up in the output.

Activity

  1. added this to the 2.14 milestone on Nov 1, 2026
  2. added
    TypeScript
    ws-createapi
    on Nov 1, 2026
  3. added theissue type on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptws-createapi

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions