Skip to content

Export types with export type #1284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ private void generateCommandMiddlewareResolver(String configType) {

private void addInputAndOutputTypes() {
writer.writeDocs("@public");
writer.write("export { __MetadataBearer, $$Command };");
writer.write("export type { __MetadataBearer };");
writer.write("export { $$Command };");
Comment on lines +387 to +388
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


writeInputType(inputType.getName(), operationIndex.getInput(operation), symbol.getName());
writeOutputType(outputType.getName(), operationIndex.getOutput(operation), symbol.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ private static void writeClientExports(
}

// Export Runtime Extension and Client ExtensionConfiguration interfaces
writer.write("export { RuntimeExtension } from \"./runtimeExtensions\";");
writer.write("export { $LExtensionConfiguration } from \"./extensionConfiguration\";", normalizedClientName);
writer.write("export type { RuntimeExtension } from \"./runtimeExtensions\";");
writer.write(
"export type { $LExtensionConfiguration } from \"./extensionConfiguration\";",
normalizedClientName
);

// Write export statement for commands.
writer.write("export * from \"./commands\";");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ private void writeAdditionalFiles(
TypeScriptDependency.AWS_SMITHY_CLIENT);
// Export ServiceException information to allow
// documentation inheritance to consume their types
writer.write("export { __ServiceException, __ServiceExceptionOptions }\n");
writer.write("export type { __ServiceExceptionOptions }\n");
writer.write("export { __ServiceException }\n");
writer.writeDocs("@public\n\nBase exception class for all service exceptions from "
+ serviceName + " service.");
writer.openBlock("export class $L extends __ServiceException {", serviceExceptionName);
Expand Down
Loading