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