Skip to main content

@package

Syntax​

@package

Overview​

@package marks a symbol as package-private. It is more restrictive than @protected (which allows subclass access) but less restrictive than @private (which allows only the defining class). This concept maps to package-private access in Java.

Example​

/**
* Internal registry – not part of the public API.
* @package
*/
class PluginRegistry {
register(plugin) {}
}

See also​