Add ProductEditorContext and ProductEditorBlockEditProps interfaces
This commit is contained in:
parent
1e35d45c99
commit
2f1a5f82ec
|
@ -6,6 +6,11 @@ export {
|
|||
TRACKS_SOURCE,
|
||||
} from './constants';
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export * from './types';
|
||||
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue