@wordpress/private-apis
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -5,3 +5,3 @@ /** | ||
* | ||
* This "implementation.js" file is needed for the sake of the unit tests. It | ||
* This "implementation.ts" file is needed for the sake of the unit tests. It | ||
* exports more than the public API of the package to aid in testing. | ||
@@ -13,3 +13,3 @@ */ | ||
*/ | ||
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields']; | ||
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils']; | ||
@@ -19,4 +19,2 @@ /** | ||
* the privateApis package. | ||
* | ||
* @type {string[]} | ||
*/ | ||
@@ -48,5 +46,5 @@ const registeredPrivateApis = []; | ||
* | ||
* @param {string} consent The consent string. | ||
* @param {string} moduleName The name of the module that is opting in. | ||
* @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions. | ||
* @param consent The consent string. | ||
* @param moduleName The name of the module that is opting in. | ||
* @return An object containing the lock and unlock functions. | ||
*/ | ||
@@ -94,4 +92,4 @@ export const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => { | ||
* | ||
* @param {any} object The object to bind the private data to. | ||
* @param {any} privateData The private data to bind to the object. | ||
* @param object The object to bind the private data to. | ||
* @param privateData The private data to bind to the object. | ||
*/ | ||
@@ -128,4 +126,4 @@ function lock(object, privateData) { | ||
* | ||
* @param {any} object The object to unlock the private data from. | ||
* @return {any} The private data bound to the object. | ||
* @param object The object to unlock the private data from. | ||
* @return The private data bound to the object. | ||
*/ | ||
@@ -155,3 +153,3 @@ function unlock(object) { | ||
* | ||
* @param {string} name The name of the module. | ||
* @param name The name of the module. | ||
*/ | ||
@@ -158,0 +156,0 @@ export function allowCoreModule(name) { |
/** | ||
* Private function to allow the unit tests to allow | ||
* a mock module to access the private APIs. | ||
* wordpress/private-apis – the utilities to enable private cross-package | ||
* exports of private APIs. | ||
* | ||
* @param {string} name The name of the module. | ||
* This "implementation.ts" file is needed for the sake of the unit tests. It | ||
* exports more than the public API of the package to aid in testing. | ||
*/ | ||
export function allowCoreModule(name: string): void; | ||
/** | ||
* Private function to allow the unit tests to set | ||
* a custom list of allowed modules. | ||
* Called by a @wordpress package wishing to opt-in to accessing or exposing | ||
* private private APIs. | ||
* | ||
* @param consent The consent string. | ||
* @param moduleName The name of the module that is opting in. | ||
* @return An object containing the lock and unlock functions. | ||
*/ | ||
export function resetAllowedCoreModules(): void; | ||
/** | ||
* Private function to allow the unit tests to reset | ||
* the list of registered private apis. | ||
*/ | ||
export function resetRegisteredPrivateApis(): void; | ||
export function __dangerousOptInToUnstableAPIsOnlyForCoreModules(consent: string, moduleName: string): { | ||
export declare const __dangerousOptInToUnstableAPIsOnlyForCoreModules: (consent: string, moduleName: string) => { | ||
lock: typeof lock; | ||
@@ -43,6 +41,6 @@ unlock: typeof unlock; | ||
* | ||
* @param {any} object The object to bind the private data to. | ||
* @param {any} privateData The private data to bind to the object. | ||
* @param object The object to bind the private data to. | ||
* @param privateData The private data to bind to the object. | ||
*/ | ||
declare function lock(object: any, privateData: any): void; | ||
declare function lock(object: Record<symbol, WeakKey>, privateData: unknown): void; | ||
/** | ||
@@ -68,7 +66,24 @@ * Unlocks the private data bound to an object. | ||
* | ||
* @param {any} object The object to unlock the private data from. | ||
* @return {any} The private data bound to the object. | ||
* @param object The object to unlock the private data from. | ||
* @return The private data bound to the object. | ||
*/ | ||
declare function unlock(object: any): any; | ||
declare function unlock(object: Record<symbol, WeakKey>): any; | ||
/** | ||
* Private function to allow the unit tests to allow | ||
* a mock module to access the private APIs. | ||
* | ||
* @param name The name of the module. | ||
*/ | ||
export declare function allowCoreModule(name: string): void; | ||
/** | ||
* Private function to allow the unit tests to set | ||
* a custom list of allowed modules. | ||
*/ | ||
export declare function resetAllowedCoreModules(): void; | ||
/** | ||
* Private function to allow the unit tests to reset | ||
* the list of registered private apis. | ||
*/ | ||
export declare function resetRegisteredPrivateApis(): void; | ||
export {}; | ||
//# sourceMappingURL=implementation.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "./implementation"; | ||
export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
* | ||
* This "implementation.js" file is needed for the sake of the unit tests. It | ||
* This "implementation.ts" file is needed for the sake of the unit tests. It | ||
* exports more than the public API of the package to aid in testing. | ||
@@ -22,3 +22,3 @@ */ | ||
*/ | ||
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields']; | ||
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils']; | ||
@@ -28,4 +28,2 @@ /** | ||
* the privateApis package. | ||
* | ||
* @type {string[]} | ||
*/ | ||
@@ -57,5 +55,5 @@ const registeredPrivateApis = []; | ||
* | ||
* @param {string} consent The consent string. | ||
* @param {string} moduleName The name of the module that is opting in. | ||
* @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions. | ||
* @param consent The consent string. | ||
* @param moduleName The name of the module that is opting in. | ||
* @return An object containing the lock and unlock functions. | ||
*/ | ||
@@ -103,4 +101,4 @@ const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => { | ||
* | ||
* @param {any} object The object to bind the private data to. | ||
* @param {any} privateData The private data to bind to the object. | ||
* @param object The object to bind the private data to. | ||
* @param privateData The private data to bind to the object. | ||
*/ | ||
@@ -138,4 +136,4 @@ exports.__dangerousOptInToUnstableAPIsOnlyForCoreModules = __dangerousOptInToUnstableAPIsOnlyForCoreModules; | ||
* | ||
* @param {any} object The object to unlock the private data from. | ||
* @return {any} The private data bound to the object. | ||
* @param object The object to unlock the private data from. | ||
* @return The private data bound to the object. | ||
*/ | ||
@@ -165,3 +163,3 @@ function unlock(object) { | ||
* | ||
* @param {string} name The name of the module. | ||
* @param name The name of the module. | ||
*/ | ||
@@ -168,0 +166,0 @@ function allowCoreModule(name) { |
@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. --> | ||
## 1.12.0 (2024-11-16) | ||
## 1.11.0 (2024-10-30) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "@wordpress/private-apis", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "Internal experimental APIs for WordPress core.", | ||
@@ -29,2 +29,3 @@ "author": "The WordPress Contributors", | ||
"react-native": "src/index", | ||
"wpScript": true, | ||
"types": "build-types", | ||
@@ -38,4 +39,3 @@ "sideEffects": false, | ||
}, | ||
"wpScript": true, | ||
"gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f" | ||
"gitHead": "510540d99f3d222a96f08d3d7b66c9e7a726f705" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112189
946