ng-packagr: ng-packagr does not export angular interfaces
Type of Issue
Either a bug or a feature request
[ ] Bug Report [X] Feature Request
Description
Im trying to export an interface to the package in order to can be imported somewhere else. Im doing this on the public_api.ts file and i get everything exported but the interface.
PUBLIC API
export { SearchbarLibModule } from './src/app/searchbar-lib/searchbar-lib.module';
export { SearchbarInterface, SearchbarInterfaceInitialState } from './src/app/store/searchbar.store';
export { searchbarReducer } from './src/app/store/searchbar.reducers';
Interface code
import { SearchOption, SearchOptionInitialState } from '../shared/searchbar/searchbar.model';
import { FilterOption, FilterOptionInitialState } from '../shared/dialog-modal/filter.model';
interface SearchbarInterface {
searchInterface: SearchOption;
filterInterface: FilterOption;
}
const SearchbarInterfaceInitialState: SearchbarInterface = {
searchInterface: SearchOptionInitialState,
filterInterface: FilterOptionInitialState
}
export { SearchbarInterface, SearchbarInterfaceInitialState };
How To Reproduce
Just try to add an interface export in the public api and you will check why is not importing.
Expected Behaviour
for bugs: please describe what behaviour or result you expected
for features: do you have a first draft or an idea how to implement?
Version Information
ng-packagr: 1.6.0 @angular/*: 1.3.0 typescript: 2.3.3 rxjs: 5.4.2 node: 8.9.3 npm/yarn: 5.0.0
Im using the https://github.com/angular-redux/store for handling redux in my project.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (5 by maintainers)
I’m struggling to export interfaces. Can someone please explain how a user of my Angular package can import an interface from it?
I tried putting the following in my
public_api.tsbut without success:Export your components, modules, services DIRECTLY, not from index.ts: replace: export { Tab } from ‘./src/app/tabs/tab’;
with something like this: export { TabModule } from ‘./src/app/tabs/tab/tab.module’;