Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (types-woocommerce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
types-woocommerce
Install:
bun install types-woocommerce -D
tsconfig.json
{
"include": ["src", "node_modules/types-woocommerce"]
}
Usage example
import { registerPaymentMethod } from '@woocommerce/blocks-registry'
import type { CanMakePaymentReturnType } from '@woocommerce/types'
const create = {
ariaLabel: '',
canMakePayment(): CanMakePaymentReturnType {
return true
},
content: <div>A react node</div>,
edit: <div>A React node</div>,
label: <div>A React node</div>,
name: 'gatewayId',
supports: {
features: ['products'],
},
}
document.addEventListener('DOMContentLoaded', function () {
registerPaymentMethod(create)
})
Vite
To replace these aliases in vite, use the rollup-plugin-woocommerce-dependency-extraction plugin