countDeclarations

abstract fun countDeclarations(includeNested: Boolean = true, includeLocal: Boolean = true, predicate: (KoBaseDeclaration) -> Boolean): Int

Returns the number of declarations that satisfies the specified predicate present in the declaration.

Return

The number of declarations that satisfies the specified predicate in the declaration.

Parameters

includeNested

Specifies whether to include nested declarations in the count (optional, default is true).

includeLocal

Specifies whether to include local declarations in the count (optional, default is true).

predicate

The predicate function to determine if a declaration satisfies a condition.