rubicon
v0.3.0
Published
Merging typescript interfaces
Downloads
4
Readme
Rubicon
Tool for merging typescript interfaces and generate PropTypes used for BEM projects.
Install
npm i -D rubicon
Commands
merge
rubicon merge --module=library-name
Options
- target: Target for merging (default:
library
) - tech: Technology extension (default:
d.ts
) - output: Output path for declare file (default:
/index.d.ts
) - module: Module name for declare
Example
We have some interface placed on our file system:
// common.blocks/a/a.d.ts
interface AComponentProps {
a: string
}
// common.blocks/a/_mod/a_mod.d.ts
interface AComponentProps {
b: string
}
// common.blocks/b/b.d.ts
interface BComponentProps {
a: string
b: number
}
After merging:
declare module 'library-name' {
interface AComponentProps {
a: string
}
interface AComponentProps {
b: string
}
interface BComponentProps {
a: string
b: number
}
}