Skip to content

Is there a way to define reusable type definitions? #1513

@KonnorRogers

Description

@KonnorRogers

Hi there! I was wondering if there's any way to define a type alias with Yard.

For example in JSDOC i can use @typedef to define a reusable type. Is this possible with Yard?

Example:

# @​typedef [String, nil] NullableString

class MyClass
  # @​param nullOrStr [NullableString]
  def initialize(nullOrStr)
     @​nullOrStr = nullOrStr
  end
end

Thank you for your time! I tried searching through the docs and other issues but couldn't find anything.

I have read the Contributing Guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions