[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> private-apis.js (summary)

wordpress/private-apis – the utilities to enable private cross-package exports of private APIs. This "implementation.js" file is needed for the sake of the unit tests. It exports more than the public API of the package to aid in testing.

File Size: 234 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 functions

  lock()
  unlock()
  allowCoreModule()
  resetAllowedCoreModules()
  resetRegisteredPrivateApis()

Functions
Functions that are not part of a class:

lock(object, privateData)   X-Ref
Binds private data to an object.
It does not alter the passed object in any way, only
registers it in an internal map of private data.

The private data can't be accessed by any other means
than the `unlock` function.

param: {any} object      The object to bind the private data to.
param: {any} privateData The private data to bind to the object.

unlock(object)   X-Ref
Unlocks the private data bound to an object.

It does not alter the passed object in any way, only
returns the private data paired with it using the `lock()`
function.

return: {any} The private data bound to the object.
param: {any} object The object to unlock the private data from.

allowCoreModule(name)   X-Ref
Private function to allow the unit tests to allow
a mock module to access the private APIs.

param: {string} name The name of the module.

resetAllowedCoreModules()   X-Ref
Private function to allow the unit tests to set
a custom list of allowed modules.


resetRegisteredPrivateApis()   X-Ref
Private function to allow the unit tests to reset
the list of registered private apis.




Generated : Sun Apr 28 08:20:02 2024 Cross-referenced by PHPXref