Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dashicon } from "@wordpress/components";
import { ComponentType, JSX, MouseEventHandler } from "react";
import { ComponentProps, ComponentType, JSX, MouseEventHandler } from "react";

declare namespace PluginBlockSettingsMenuItem {
interface Props {
Expand All @@ -13,7 +13,7 @@ declare namespace PluginBlockSettingsMenuItem {
* A dashicon slug, or a custom JSX element.
* @defaultValue `"admin-plugins"`
*/
icon?: JSX.Element | Dashicon.Icon | undefined;
icon?: JSX.Element | ComponentProps<typeof Dashicon>["icon"] | undefined;
/**
* The menu item text.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Dashicon, MenuItem } from "@wordpress/components";
import { ComponentType, JSX, ReactNode } from "react";
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";

declare namespace PluginMoreMenuItem {
interface Props extends Omit<MenuItem.Props, "href"> {
interface Props extends Omit<ComponentProps<typeof MenuItem>, "href" | "icon"> {
children: ReactNode;
/**
* When `href` is provided then the menu item is represented as an anchor rather than
Expand All @@ -13,7 +13,7 @@ declare namespace PluginMoreMenuItem {
* A Dashicon slug or a custom JSX element to be rendered to the left of the menu item
* label.
*/
icon?: Dashicon.Icon | JSX.Element | undefined;
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
/**
* The callback function to be executed when the user clicks the menu item.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dashicon } from "@wordpress/components";
import { ComponentType, JSX, ReactNode } from "react";
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";

declare namespace PluginSidebarMoreMenuItem {
interface Props {
Expand All @@ -13,7 +13,7 @@ declare namespace PluginSidebarMoreMenuItem {
* A Dashicon slug or a custom JSX element to be rendered to the left of the menu item
* label.
*/
icon?: Dashicon.Icon | JSX.Element | undefined;
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dashicon, Slot } from "@wordpress/components";
import { FC, JSX, ReactNode } from "react";
import { ComponentProps, FC, JSX, ReactNode } from "react";

declare namespace PluginDocumentSettingPanel {
interface Props {
Expand All @@ -20,7 +20,7 @@ declare namespace PluginDocumentSettingPanel {
* A Dashicon slug or a custom JSX element to be rendered when the sidebar is pinned to
* toolbar.
*/
icon?: Dashicon.Icon | JSX.Element | undefined;
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
}
}

Expand All @@ -43,7 +43,7 @@ declare namespace PluginDocumentSettingPanel {
*/
declare const PluginDocumentSettingPanel: {
(props: PluginDocumentSettingPanel.Props): JSX.Element;
Slot: FC<Omit<Slot.Props, "name">>;
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
};

export default PluginDocumentSettingPanel;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot } from "@wordpress/components";
import { FC, JSX, ReactNode } from "react";
import { ComponentProps, FC, JSX, ReactNode } from "react";

declare namespace PluginPostPublishPanel {
interface Props {
Expand Down Expand Up @@ -42,7 +42,7 @@ declare namespace PluginPostPublishPanel {
*/
declare const PluginPostPublishPanel: {
(props: PluginPostPublishPanel.Props): JSX.Element;
Slot: FC<Omit<Slot.Props, "name">>;
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
};

export default PluginPostPublishPanel;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot } from "@wordpress/components";
import { FC, JSX, ReactNode } from "react";
import { ComponentProps, FC, JSX, ReactNode } from "react";

declare namespace PluginPostStatusInfo {
interface Props {
Expand Down Expand Up @@ -29,7 +29,7 @@ declare namespace PluginPostStatusInfo {
*/
declare const PluginPostStatusInfo: {
(props: PluginPostStatusInfo.Props): JSX.Element;
Slot: FC<Omit<Slot.Props, "name">>;
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
};

export default PluginPostStatusInfo;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot } from "@wordpress/components";
import { FC, JSX, ReactNode } from "react";
import { ComponentProps, FC, JSX, ReactNode } from "react";

declare namespace PluginPrePublishPanel {
interface Props {
Expand Down Expand Up @@ -42,7 +42,7 @@ declare namespace PluginPrePublishPanel {
*/
declare const PluginPrePublishPanel: {
(props: PluginPrePublishPanel.Props): JSX.Element;
Slot: FC<Omit<Slot.Props, "name">>;
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
};

export default PluginPrePublishPanel;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dashicon } from "@wordpress/components";
import { ComponentType, JSX, ReactNode } from "react";
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";

declare namespace PluginSidebar {
interface Props {
Expand All @@ -12,7 +12,7 @@ declare namespace PluginSidebar {
* A Dashicon slug or a custom JSX element to be rendered when the sidebar is pinned to
* toolbar.
*/
icon?: Dashicon.Icon | JSX.Element | undefined;
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
/**
* Whether to allow to pin sidebar to toolbar.
* @defaultValue `true`
Expand Down
2 changes: 1 addition & 1 deletion types/wordpress__edit-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"dependencies": {
"@types/react": "*",
"@types/wordpress__components": "*",
"@wordpress/components": "^27.3.0",
"@wordpress/data": "^9.13.0",
"@wordpress/element": "^5.0.0"
},
Expand Down