Docgeni generates API documentation from JSDoc annotation tags on components, directives, services, pipes, classes, interfaces, properties, and methods.
ts/** * General Button Component description. * @name alib-button * @order 1 */ @Component({ selector: 'alib-button,[alibButton]', template: '<ng-content></ng-content>', }) export class AlibButtonComponent extends Base implements OnInit { /** * Button Type: `'primary' | 'secondary' | 'danger'` * @description 按钮类型 * @default primary * @type 'primary' | 'secondary' | 'danger' */ @Input() set alibButton(value: string) { this.alibType = value; } ngOnInit(): void {} }
string{ClassName}The name shown in the API docs. For components, directives, services, classes, and interfaces, the class name is used by default. For pipes, the name is used.
stringnullThe description text. If a @description tag is present, its content takes precedence; otherwise the main comment body is used.
ts/** * Default description. * @name alib-button * @description This is description * @order 1 */
numbernullSort order in the API docs. Lower values appear first.
booleanfalseinternalThe following members are included in the API docs by default:
@Input and @Output properties on components and directivesAdd @private or @internal to exclude internal members that should not appear in the docs.
ts/** * General Button Component description. * @private */
booleanfalsepublicApiClasses and interfaces are excluded from the API docs by default. Add @public or @publicApi to include them.
ts/** * Some Class description. * @public */ export class SomeClass {}
stringnullThe default value is inferred from the TypeScript assignment when available. You can also set it explicitly with @default.
tsexport class AlibButtonComponent { /** * Button Type * @default primary */ @Input() alibType = 'primary' }
stringnullThe property type is inferred from the TypeScript type definition when available. You can also set it explicitly with @type.
tsexport class AlibButtonComponent { /** * Button Type * @type 'primary' | 'success' */ @Input() alibType = 'primary' }
stringnullDescribes a method parameter. Format: @param {type} name description.
ts@Injectable({ providedIn: 'root' }) export class DialogService { /** * Open a dialog * @param {string} param1 param1 desc * @param {number} param2 param2 desc * @returns DialogRef */ open(param1: string, param2: number): DialogRef {} }