Fix typing for initBlock call in section
This commit is contained in:
parent
edaf1154d0
commit
e94de74d00
|
@ -1,7 +1,6 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { BlockConfiguration } from '@wordpress/blocks';
|
||||
import { registerWooBlockType } from '@woocommerce/block-templates';
|
||||
|
||||
/**
|
||||
|
@ -9,19 +8,20 @@ import { registerWooBlockType } from '@woocommerce/block-templates';
|
|||
*/
|
||||
import blockConfiguration from './block.json';
|
||||
import { Edit } from './edit';
|
||||
import { SectionBlockAttributes } from './types';
|
||||
|
||||
const { name, ...metadata } =
|
||||
blockConfiguration as BlockConfiguration< SectionBlockAttributes >;
|
||||
const { name, ...metadata } = blockConfiguration;
|
||||
|
||||
export { metadata, name };
|
||||
|
||||
export const settings: Partial< BlockConfiguration< SectionBlockAttributes > > =
|
||||
{
|
||||
example: {},
|
||||
edit: Edit,
|
||||
};
|
||||
export const settings = {
|
||||
example: {},
|
||||
edit: Edit,
|
||||
};
|
||||
|
||||
export function init() {
|
||||
return registerWooBlockType( { name, metadata, settings } );
|
||||
return registerWooBlockType( {
|
||||
name,
|
||||
metadata: metadata as never,
|
||||
settings,
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue