Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

TsInfo improvements #33

@cristatus

Description

@cristatus

Consider the following case:

type Variant = "primary" | "secondary";

type Size = "sm" | "md" | "lg";

type Dimension = {
  w?: number;
  h?: number;
}

interface AsProp {
  as?: any;
}

interface BaseProps {
  size?: Size;
  wh?: Dimension;
}

interface ButtonProps extends BaseProps, AsProp {
  variant?: Variant | "link";
}

The TsInfo should show following output:

Name Description Type Default Value
variant "primary" | "secondary" | "link"
size "sm" | "md" | "lg"
wh { w: number, h: number }
as any

What I am getting:

Name Description Type Default Value
variant Variant | "link"

Suggested improvements:

  1. expand type references
  2. expand heritage clauses
  3. allow to skip certain heritage types

Examples:

  1. <TsInfo src="./Button.tsx" name="ButtonProps"/> should expand ButtonProps only no heritage types
  2. ` should expand inherited props too
  3. <TsInfo src="./Button.tsx" name="ButtonProps" heritage="AsProp"/> should expand inherited props from AsProp and not all (can be comma separated names).

And the jsx api should be like:

import _TsInfo0 from './types.ts?tsInfo=ButtonProps'

import _TsInfo0 from './types.ts?tsInfo=ButtonProps&heritage=true'

import _TsInfo0 from './types.ts?tsInfo=ButtonProps&heritage=AsProp'

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