Skip to content

Types with index signatures lose all attribute signatures when using keyof or Omit #43478

Closed
@nuintun

Description

@nuintun

Bug Report

企业微信截图_16172737442928

💻 Code

interface Route {
  name: string;
  path: string;
  href?: string;
  exact?: boolean;
  strict?: boolean;
  [key: string]: string | boolean | undefined | object;
}

type RouteNode = Omit<Route, 'name'>;

const route: RouteNode = {} as RouteNode;

route.p;

🙁 Actual behavior

Lose all attribute signatures

🙂 Expected behavior

Do not lose attribute signatures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions