Skip to content

Commit 0aeb619

Browse files
committed
Add WordPress type definitions to the list of names recognized by JSDoc linter
1 parent 920ec1d commit 0aeb619

88 files changed

Lines changed: 356 additions & 309 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/designers-developers/developers/data/data-core-block-editor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ _Parameters_
233233

234234
_Returns_
235235

236-
- `null`: Block objects.
236+
- `Array<WPBlock>`: Block objects.
237237

238238
<a name="getBlockSelectionEnd" href="#getBlockSelectionEnd">#</a> **getBlockSelectionEnd**
239239

@@ -345,7 +345,7 @@ _Parameters_
345345

346346
_Returns_
347347

348-
- `Array<EditorInserterItem>`: Items that appear in inserter.
348+
- `Array<WPEditorInserterItem>`: Items that appear in inserter.
349349

350350
<a name="getLastMultiSelectedBlockClientId" href="#getLastMultiSelectedBlockClientId">#</a> **getLastMultiSelectedBlockClientId**
351351

docs/designers-developers/developers/data/data-core-editor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ _Parameters_
203203

204204
_Returns_
205205

206-
- `null`: Filtered set of blocks for save.
206+
- `Array<WPBlock>`: Filtered set of blocks for save.
207207

208208
<a name="getClientIdsOfDescendants" href="#getClientIdsOfDescendants">#</a> **getClientIdsOfDescendants**
209209

packages/block-editor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ _Parameters_
137137

138138
_Returns_
139139

140-
- `null`: The component to be rendered.
140+
- `WPComponent`: The component to be rendered.
141141

142142
<a name="BlockSelectionClearer" href="#BlockSelectionClearer">#</a> **BlockSelectionClearer**
143143

packages/block-editor/src/components/block-edit/context.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export { Provider as BlockEditContextProvider };
2727
* expected to return object of props to
2828
* merge with the component's own props.
2929
*
30-
* @return {import('@wordpress/element').WPComponent} Enhanced component with injected context as props.
30+
* @return {WPComponent} Enhanced component with injected context as props.
3131
*/
3232
export const withBlockEditContext = ( mapContextToProps ) => createHigherOrderComponent( ( OriginalComponent ) => {
3333
return ( props ) => (
@@ -46,9 +46,9 @@ export const withBlockEditContext = ( mapContextToProps ) => createHigherOrderCo
4646
* A Higher Order Component used to render conditionally the wrapped
4747
* component only when the BlockEdit has selected state set.
4848
*
49-
* @param {import('@wordpress/element').WPComponent} OriginalComponent Component to wrap.
49+
* @param {WPComponent} OriginalComponent Component to wrap.
5050
*
51-
* @return {import('@wordpress/element').WPComponent} Component which renders only when the BlockEdit is selected.
51+
* @return {WPComponent} Component which renders only when the BlockEdit is selected.
5252
*/
5353
export const ifBlockEditSelected = createHigherOrderComponent( ( OriginalComponent ) => {
5454
return ( props ) => (

packages/block-editor/src/components/block-list/breadcrumb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import BlockTitle from '../block-title';
1616
* the root block.
1717
*
1818
* @param {string} props.clientId Client ID of block.
19-
* @return {import('@wordpress/element').WPComponent} The component to be rendered.
19+
* @return {WPComponent} The component to be rendered.
2020
*/
2121
const BlockBreadcrumb = forwardRef( ( { clientId }, ref ) => {
2222
const { setNavigationMode } = useDispatch( 'core/block-editor' );

packages/block-editor/src/components/block-preview/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export function BlockPreview( { blocks, viewportWidth = 700, padding, settings }
137137
*
138138
* @param {Array|Object} blocks A block instance (object) or an array of blocks to be previewed.
139139
* @param {number} viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.
140-
* @return {import('@wordpress/element').WPComponent} The component to be rendered.
140+
* @return {WPComponent} The component to be rendered.
141141
*/
142142
export default withSelect( ( select ) => {
143143
return {

packages/block-editor/src/components/colors/with-colors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const withEditorColorPalette = () => withSelect( ( select ) => {
4949
* @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).
5050
* @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.
5151
*
52-
* @return {import('@wordpress/element').WPComponent} The component that can be used as a HOC.
52+
* @return {WPComponent} The component that can be used as a HOC.
5353
*/
5454
function createColorHOC( colorTypes, withColorPalette ) {
5555
const colorMap = reduce( colorTypes, ( colorObject, colorType ) => {

packages/block-editor/src/components/ignore-nested-events/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Component, forwardRef, createElement } from '@wordpress/element';
2020
* element should stop propagation but not invoke a callback handler, since it
2121
* would be assumed these are invoked by the child element.
2222
*
23-
* @type {import('@wordpress/element').WPComponent}
23+
* @type {WPComponent}
2424
*/
2525
export class IgnoreNestedEvents extends Component {
2626
constructor() {

packages/block-editor/src/components/inserter/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Inserter extends Component {
5151
* pressed.
5252
* @param {boolean} options.isOpen Whether dropdown is currently open.
5353
*
54-
* @return {import('@wordpress/element').WPElement} Dropdown toggle element.
54+
* @return {WPElement} Dropdown toggle element.
5555
*/
5656
renderToggle( { onToggle, isOpen } ) {
5757
const {
@@ -69,7 +69,7 @@ class Inserter extends Component {
6969
* @param {Function} options.onClose Callback to invoke when dropdown is
7070
* closed.
7171
*
72-
* @return {import('@wordpress/element').WPElement} Dropdown content element.
72+
* @return {WPElement} Dropdown content element.
7373
*/
7474
renderContent( { onClose } ) {
7575
const { rootClientId, clientId, isAppender, showInserterHelpPanel } = this.props;

packages/block-editor/src/components/inserter/index.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Inserter extends Component {
5050
* pressed.
5151
* @param {boolean} options.isOpen Whether dropdown is currently open.
5252
*
53-
* @return {import('@wordpress/element').WPElement} Dropdown toggle element.
53+
* @return {WPElement} Dropdown toggle element.
5454
*/
5555
renderToggle( { onToggle, isOpen } ) {
5656
const {
@@ -69,7 +69,7 @@ class Inserter extends Component {
6969
* @param {Function} options.onClose Callback to invoke when dropdown is
7070
* closed.
7171
*
72-
* @return {import('@wordpress/element').WPElement} Dropdown content element.
72+
* @return {WPElement} Dropdown content element.
7373
*/
7474
renderContent( { onClose, isOpen } ) {
7575
const { rootClientId, clientId, isAppender } = this.props;

0 commit comments

Comments
 (0)