Fix typing for initBlock call in variation-items

This commit is contained in:
Matt Sherman 2023-09-26 21:18:09 -04:00
parent ef48cccc23
commit a4a44ef56b
1 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { BlockConfiguration } from '@wordpress/blocks';
import { registerWooBlockType } from '@woocommerce/block-templates';
/**
@ -9,20 +8,20 @@ import { registerWooBlockType } from '@woocommerce/block-templates';
*/
import blockConfiguration from './block.json';
import { Edit } from './edit';
import { VariationOptionsBlockAttributes } from './types';
const { name, ...metadata } =
blockConfiguration as BlockConfiguration< VariationOptionsBlockAttributes >;
const { name, ...metadata } = blockConfiguration;
export { metadata, name };
export const settings: Partial<
BlockConfiguration< VariationOptionsBlockAttributes >
> = {
export const settings = {
example: {},
edit: Edit,
};
export function init() {
return registerWooBlockType( { name, metadata, settings } );
return registerWooBlockType( {
name,
metadata: metadata as never,
settings,
} );
}