Skip to content

Commit 2c8aece

Browse files
fix: export clients as both const and type (#841)
1 parent 3d3e94c commit 2c8aece

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

synthtool/gcp/templates/node_split_library/index.ts.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
// ** All changes to this file may be overwritten. **
1818

1919
{% for version in versions %}import * as {{ version }} from './{{ version}}';{{ "\n" }}{% endfor %}
20-
{% for client in clients %}const {{ client }} = {{ default_version }}.{{ client }};{{ "\n" }}{% endfor %}
20+
{% for client in clients %}const {{ client }} = {{ default_version }}.{{ client }};
21+
type {{ client }} = {{ default_version }}.{{ client }};{{ "\n" }}{% endfor %}
2122
export {{ "{" }}{{ versions|join(', ')}}, {{ clients|join(', ')}}{{ "}" }};
2223
export default {{ "{" }}{{ versions|join(', ')}}, {{ clients|join(', ')}}{{ "}" }};
2324
import * as protos from '../protos/protos';

tests/fixtures/node_templates/index_samples/sample_index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as v1 from './v1';
2020
import * as v1beta1 from './v1beta1';
2121

2222
const TextToSpeechClient = v1.TextToSpeechClient;
23+
type TextToSpeechClient = v1.TextToSpeechClient;
2324

2425
export {v1, v1beta1, TextToSpeechClient};
2526
export default {v1, v1beta1, TextToSpeechClient};

tests/fixtures/node_templates/index_samples/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as v1 from './v1';
2020
import * as v1beta1 from './v1beta1';
2121

2222
const TextToSpeechClient = v1.TextToSpeechClient;
23+
type TextToSpeechClient = v1.TextToSpeechClient;
2324

2425
export {v1, v1beta1, TextToSpeechClient};
2526
export default {v1, v1beta1, TextToSpeechClient};

0 commit comments

Comments
 (0)