Add ProductEditorContext and ProductEditorBlockEditProps interfaces

This commit is contained in:
Matt Sherman 2023-09-26 20:55:22 -04:00
parent 1e35d45c99
commit 2f1a5f82ec
2 changed files with 23 additions and 0 deletions

View File

@ -6,6 +6,11 @@ export {
TRACKS_SOURCE,
} from './constants';
/**
* Types
*/
export * from './types';
/**
* Utils
*/

View File

@ -0,0 +1,18 @@
/**
* External dependencies
*/
import { BlockEditProps } from '@wordpress/blocks';
import { Product } from '@woocommerce/data';
export interface ProductEditorContext {
editedProduct: Product;
postId: number;
postType: string;
selectedTab: string | null;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface ProductEditorBlockEditProps< T extends Record< string, any > >
extends BlockEditProps< T > {
readonly context: ProductEditorContext;
}