API
@agape/metadata

Description Decorator

Attaches a human-readable description to the class, property, method, or parameter.

API

@Description(  description: string)

Description

Attaches a human-readable description to the class, property, method, or parameter.

@paramdescription:  string

Description

Attaches a human-readable description to the class, property, method, or parameter.

This decorator sets the description property on the associated MetadataDescriptor.

Usage

Class

@Description('Represents a user profile with personal and contact information')
class Profile {
  fullName: string;
  email: string;
}

Property

class Profile {
  @Description('The full name of the user as displayed on their profile')
  fullName: string;
}

Method

class ProfileService {
  @Description('Updates the user profile with the provided information')
  updateProfile(profile: Profile): void {
    // ...
  }
}

Parameter

class ProfileService {
  updateProfile(
    @Description('The updated profile data to be saved')
    profile: Profile
  ): void {
    // ...
  }
}