I've created one angular library project that has one component and once api (UserApi) (abstract class). I've another project which consume this library. This project also has a service (UserService implements UserApi) that implements the api of the library.
In my project module file, I've added the provider using following code.
{ provide: UserApi, useExisting: UserService }
Now, there are two ways I can have an import statement for UserApi.
import { UserApi } from 'mylibrary';
or
import { UserApi } from 'projects/mylibrary/src/public_api';
First one is the proper way. However, It is not working when I use the first import. It works when I use the second import. But I cannot release my code with second line. Upon further checking, I found that as I am accessing the UserApi from the released library, it is accessed through the definition file.
and the code is like
import { Observable } from 'rxjs/Observable';
export declare abstract class UserApi {
abstract getConfigName(): Observable<string>;
}
In my original code, I don't have 'declare' keyword while the released code has it. And that is the reason my project isn't able to use the provided service.
How can this be fixed ?
Update: Code from public_api
`
export * from './lib/user-shared.service';
export * from './lib/user-shared.component';
export * from './lib/user-shared.module';
export * from './lib/component/usermanager.component';
export * from './lib/coreapi/userapi';
`