I'm using lerna + typescript to build an NPM package.
I have the following structure
.
├── lerna.json
├── package.json
├── packages
│ ├── darpi
│ │ ├── dist
│ │ │ └── index.d.ts
│ └── schema
│ └── dist
│ └── index.d.ts
└── tsconfig.json
The darpi package depends on the schema package types
packages/schema/dist/index.d.ts
// import types
import schema from './rules/schema'
import validate from './functions/validate'
import configure from './configure'
// and export
export { schema, validate, configure }
packages/darpi/dist/index.d.ts
import { defineComponent } from 'vue'
import type { schema, configure } from '@cataline.io/schema'
declare let Form: typeof defineComponent
declare let Field: typeof defineComponent
declare let Button: typeof defineComponent
export { Form, Field, Button, schema, configure }
the only package that actually goes to NPM is darpi
that is
packages/darpi/package.json
{
"types": "dist/index.d.ts"
// ...
}
and then it gets published on NPM, when trying to make use of
Form, Field, Button they are OK

configure or schema, although they work fine, don't have type declarations

Typescript can't know the types that came from @cataline.io/schema, clearly because this is a private package resolved by lerna at development time

my question is:
How to export types to NPM that comes from the private sibling packge?
I couldn't think of anything to fix it.
schema must not be made a public package in NPM and then installed together with darpi, no. darpi works perfectly, I just need to solve the typing problem that comes from the sibling package.