[storage-blob] abstract class StorageClient is not exported
See original GitHub issueThe @azure/storage-blob
v12 package doesn’t currently export the StorageClient
abstract class from its entry point.
This is causing a TypeScript compiler issue for one of our samples for the @azure/eventhubs-checkpointstore-blob
package because it can’t find the protected pipeline
member on a ContainerClient
, which would be inherited from the StorageClient
class.
Sample that causes the TypeScript error:
Details
It looks like the api review tool is warning that StorageClient
isn’t being exported:
https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/storage/storage-blob/review/storage-blob.api.md
// Warning: (ae-forgotten-export) The symbol “StorageClient” needs to be exported by the entry point index.d.ts
12.1.1 versus 12.1.2
It looks like StorageClient
was never exported, however the above sample was working when using storage-blob up to version 12.1.1
. It stopped working once upgrading to 12.1.2
. The reason it stopped working seems to be that the way the types are distributed changed between these versions.
In 12.1.1
, the types for each file were shipped with the package, so even though StorageClient
wasn’t being exported from the index.ts
file, the types for StorageClient
were still shipped and the compiler could still find them.
In 12.1.2
, the types are bundled up into a single file and exclude anything that’s not exported from the index.ts file. This means the types for StorageClient
are no longer being shipped.
Fix types by exporting StorageClient
It seems like we should be exporting StorageClient
from index.ts. api-extractor has actually been warning that it isn’t exported for a while, but due to the way we were shipping types prior to 12.1.2
the compiler was still able to find it. I’m not aware of a reason we would want to hide it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Yes, lets use the
newPipeline
way.Closing this since the type is exported and I was using a field that was marked
@internal
.