/**
 * The editor packages WordPress provides to the block's editor script (webpack leaves them external, see
 * index.asset.php): only the parts the two blocks use. Their npm type packages are not installed here.
 */
declare module '*.scss';

declare module '@wordpress/blocks' {
	import type { ComponentType } from '@wordpress/element';

	export interface BlockEditProps< Attributes > {
		attributes: Attributes;
		setAttributes( attributes: Partial< Attributes > ): void;
	}
	export function registerBlockType< Attributes >( name: string, settings: { edit: ComponentType< BlockEditProps< Attributes > > } ): unknown;
}

declare module '@wordpress/block-editor' {
	import type { ComponentType, ReactNode } from 'react';

	export function useBlockProps(): Record< string, unknown >;
	export const InspectorControls: ComponentType< { children?: ReactNode } >;
}

declare module '@wordpress/components' {
	import type { ComponentType, ReactNode } from 'react';

	export const PanelBody: ComponentType< { title: string; children?: ReactNode } >;
	export const Placeholder: ComponentType< { icon: string; label: string; instructions: string } >;
	export const __experimentalNumberControl: ComponentType< {
		label: string;
		help: string;
		value: number | string;
		min: number;
		onChange( value: string | undefined ): void;
	} >;
	export function SelectControl< Value extends string >( props: {
		label: string;
		value: Value;
		options: Array< { label: string; value: Value } >;
		onChange( value: Value ): void;
	} ): ReactNode;
	export const ToggleControl: ComponentType< { label: string; checked: boolean; onChange( checked: boolean ): void } >;
}

declare module '@wordpress/server-side-render' {
	import type { ComponentType } from 'react';

	const ServerSideRender: ComponentType< { block: string; attributes: object } >;
	export default ServerSideRender;
}
