Skip to content

Commit

Permalink
fix: export clients as both const and type (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Nov 5, 2020
1 parent 3d3e94c commit 2c8aece
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synthtool/gcp/templates/node_split_library/index.ts.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
// ** All changes to this file may be overwritten. **

{% for version in versions %}import * as {{ version }} from './{{ version}}';{{ "\n" }}{% endfor %}
{% for client in clients %}const {{ client }} = {{ default_version }}.{{ client }};{{ "\n" }}{% endfor %}
{% for client in clients %}const {{ client }} = {{ default_version }}.{{ client }};
type {{ client }} = {{ default_version }}.{{ client }};{{ "\n" }}{% endfor %}
export {{ "{" }}{{ versions|join(', ')}}, {{ clients|join(', ')}}{{ "}" }};
export default {{ "{" }}{{ versions|join(', ')}}, {{ clients|join(', ')}}{{ "}" }};
import * as protos from '../protos/protos';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as v1 from './v1';
import * as v1beta1 from './v1beta1';

const TextToSpeechClient = v1.TextToSpeechClient;
type TextToSpeechClient = v1.TextToSpeechClient;

export {v1, v1beta1, TextToSpeechClient};
export default {v1, v1beta1, TextToSpeechClient};
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/node_templates/index_samples/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as v1 from './v1';
import * as v1beta1 from './v1beta1';

const TextToSpeechClient = v1.TextToSpeechClient;
type TextToSpeechClient = v1.TextToSpeechClient;

export {v1, v1beta1, TextToSpeechClient};
export default {v1, v1beta1, TextToSpeechClient};
Expand Down

0 comments on commit 2c8aece

Please sign in to comment.