Type definition for the Enonic XP library for serving assets
npm install @enonic-types/lib-asset``bash`
npm i --save-dev @enonic-types/lib-asset
Add lib-asset to compilerOptions.paths in the tsconfig.json file:
`json`
{
"compilerOptions": {
"paths": {
"/lib/enonic/asset": ["node_modules/@enonic-types/lib-asset"],
}
}
}
`typescript``
import {assetUrl} from '/lib/enonic/asset';
assetUrl should now be typed.