extract-react-types icon indicating copy to clipboard operation
extract-react-types copied to clipboard

Can't extract types from namespace type.

Open sxhuan opened this issue 2 years ago • 0 comments

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?

sxhuan avatar Jan 14 '23 02:01 sxhuan