ts-morph-structures

Home > ts-morph-structures > MemberedTypeToClass > defineStatementsByPurpose

MemberedTypeToClass.defineStatementsByPurpose() method

Define a statement purpose group for the target class.

Signature:

defineStatementsByPurpose(purposeKey: string, isBlockStatement: boolean, regionName?: string): void;

Parameters

Parameter Type Description
purposeKey string The purpose of the statmeent group (validation, preconditions, body, postconditions, etc.)
isBlockStatement boolean true if the statement block should be enclosed in curly braces.
regionName string <p>(Optional) an optional #region / #endregion comment name.</p><p>Call this in the order of statement purpose groups you intend.</p>

Returns:

void