Fix typing for initBlock call in password

This commit is contained in:
Matt Sherman 2023-09-26 21:15:04 -04:00
parent 54209362a0
commit c8ad1de579
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,19 +8,19 @@ import { registerWooBlockType } from '@woocommerce/block-templates';
*/
import blockConfiguration from './block.json';
import { Edit } from './edit';
import { RequirePasswordBlockAttributes } from './types';
const { name, ...metadata } =
blockConfiguration as BlockConfiguration< RequirePasswordBlockAttributes >;
const { name, ...metadata } = blockConfiguration;
export { metadata, name };
export const settings: Partial<
BlockConfiguration< RequirePasswordBlockAttributes >
> = {
export const settings = {
edit: Edit,
};
export function init() {
return registerWooBlockType( { name, metadata, settings } );
return registerWooBlockType( {
name,
metadata: metadata as never,
settings,
} );
}