diff --git a/packages/typescript/internal/ts_project.bzl b/packages/typescript/internal/ts_project.bzl
index c996ec26ad..fcd0f2d13c 100644
--- a/packages/typescript/internal/ts_project.bzl
+++ b/packages/typescript/internal/ts_project.bzl
@@ -117,8 +117,9 @@ def _ts_project_impl(ctx):
     outputs = json_outs + ctx.outputs.js_outs + ctx.outputs.map_outs + ctx.outputs.typings_outs + ctx.outputs.typing_maps_outs
     if ctx.outputs.buildinfo_out:
         outputs.append(ctx.outputs.buildinfo_out)
-    runtime_outputs = depset(json_outs + ctx.outputs.js_outs + ctx.outputs.map_outs)
+    runtime_outputs = json_outs + ctx.outputs.js_outs + ctx.outputs.map_outs
     typings_outputs = ctx.outputs.typings_outs + ctx.outputs.typing_maps_outs + [s for s in ctx.files.srcs if s.path.endswith(".d.ts")]
+    default_outputs_depset = depset(runtime_outputs) if len(runtime_outputs) else depset(typings_outputs)
 
     if len(outputs) > 0:
         run_node(
@@ -140,14 +141,14 @@ def _ts_project_impl(ctx):
         # Only the JavaScript outputs are intended for use in non-TS-aware
         # dependents.
         DefaultInfo(
-            files = runtime_outputs,
+            files = default_outputs_depset,
             runfiles = ctx.runfiles(
-                transitive_files = runtime_outputs,
+                transitive_files = default_outputs_depset,
                 collect_default = True,
             ),
         ),
         js_module_info(
-            sources = runtime_outputs,
+            sources = depset(runtime_outputs),
             deps = ctx.attr.deps,
         ),
         _TsConfigInfo(tsconfigs = depset([ctx.file.tsconfig] + ctx.files.extends, transitive = [
diff --git a/packages/typescript/test/ts_project/declaration_only/BUILD.bazel b/packages/typescript/test/ts_project/declaration_only/BUILD.bazel
new file mode 100644
index 0000000000..a167806756
--- /dev/null
+++ b/packages/typescript/test/ts_project/declaration_only/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test")
+load("//packages/typescript:index.bzl", "ts_project")
+
+ts_project(
+    declaration = True,
+    emit_declaration_only = True,
+)
+
+generated_file_test(
+    name = "test",
+    src = "a.d.ts_",
+    generated = ":tsconfig",
+)
diff --git a/packages/typescript/test/ts_project/declaration_only/a.d.ts_ b/packages/typescript/test/ts_project/declaration_only/a.d.ts_
new file mode 100644
index 0000000000..106d610ab9
--- /dev/null
+++ b/packages/typescript/test/ts_project/declaration_only/a.d.ts_
@@ -0,0 +1 @@
+export declare const a: string;
diff --git a/packages/typescript/test/ts_project/declaration_only/a.ts b/packages/typescript/test/ts_project/declaration_only/a.ts
new file mode 100644
index 0000000000..db233fb40c
--- /dev/null
+++ b/packages/typescript/test/ts_project/declaration_only/a.ts
@@ -0,0 +1 @@
+export const a: string = '';
diff --git a/packages/typescript/test/ts_project/declaration_only/tsconfig.json b/packages/typescript/test/ts_project/declaration_only/tsconfig.json
new file mode 100644
index 0000000000..e929240d2d
--- /dev/null
+++ b/packages/typescript/test/ts_project/declaration_only/tsconfig.json
@@ -0,0 +1,7 @@
+{
+    "compilerOptions": {
+        "declaration": true,
+        "emitDeclarationOnly": true,
+        "types": []
+    }
+}