Skip to content

Can't extract types from namespace type. #245

Open
@sxhuan

Description

@sxhuan

I use namespace to define common types like below:

export declare namespace TypeAttributes {
  type Color =
    | "primary"
    | "secondary"
    | "success"
    | "warning"
    | "danger"
    | "info";
}

and use it in type definition.

export type ComponentProps = {
  /**
   * The color to apply to component
   */
  color?: TypeAttributes.Color;
}

it shows: Type: TypeAttributes.Color instead of "union, one of xxxxx".

any idea how to make this work?

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