Issue 1:
My mod.ts is simply:

/// <reference lib="dom" />

export function example(): number {
return 42;
}

and test file:

import { assertEquals } from "../deps.ts";
import { example } from "../src/mod.ts";

Deno.test({
name: "example test",
fn(): void {
// Arrange
const expectedResult = 42;
// Act
const result = example();
// Assert
assertEquals(result, expectedResult);
},
});

Without /// <reference lib="dom" /> it works great, with I get:

error: TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: CompileError, Global, Instance, LinkError, Memory, Module, RuntimeError, Table, ImportExportKind, TableKind, ValueType, ExportValue, Exports, ImportValue, ModuleImports, Imports, BufferSource, MessageEvent, ErrorEvent, Worker, PerformanceEntryList, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, CustomEvent
interface Account {
~~~~~~~~~
at asset:///lib.dom.d.ts:25:1

Conflicts are in this file.
declare namespace WebAssembly {
~~~~~~~
at asset:///lib.deno.shared_globals.d.ts:15:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: DOMException, Event, EventTarget, EventListenerOrEventListenerObject, ProgressEvent, TextDecoder, TextEncoder, AbortController
interface Account {
~~~~~~~~~
at asset:///lib.dom.d.ts:25:1

Conflicts are in this file.
declare class DOMException extends Error {
~~~~~~~
at asset:///lib.deno.web.d.ts:8:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: ReadableStreamReader, CountQueuingStrategy, ByteLengthQueuingStrategy, BlobPart, Blob, File, FormDataEntryValue, FormData, HeadersInit, Headers, RequestInfo, RequestCache, RequestCredentials, RequestMode, RequestRedirect, ReferrerPolicy, BodyInit, RequestDestination, Request, ResponseType, Response
interface Account {
~~~~~~~~~
at asset:///lib.dom.d.ts:25:1

Conflicts are in this file.
interface DomIterable<K, V> {
~~~~~~~~~
at asset:///lib.deno.fetch.d.ts:8:1

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
interface CloseEvent extends Event {
~~~~~~~~~~
at asset:///lib.dom.d.ts:3642:11

'CloseEvent' was also declared here.
declare class CloseEvent extends Event {
~~~~~~~~~~
at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'CloseEvent'.
declare var CloseEvent: {
~~~~~~~~~~
at asset:///lib.dom.d.ts:3657:13

'CloseEvent' was also declared here.
declare class CloseEvent extends Event {
~~~~~~~~~~
at asset:///lib.deno.websocket.d.ts:14:15

TS2300 [ERROR]: Duplicate identifier 'Location'.
interface Location {
~~~~~~~~
at asset:///lib.dom.d.ts:9794:11

'Location' was also declared here.
declare class Location {
~~~~~~~~
at asset:///lib.deno.window.d.ts:70:15

... and it goes on

I don't see why this is not working, mod.ts will be for the browser using the DOM.

Issue 2:
Any updates?

I got a lot of ts errors when I used @deno-types to include type definitions for the ky libarry.

// @deno-types="https://deno.land/x/ky@v0.23.0/index.d.ts"
export { default as ky } from "https://deno.land/x/ky@v0.23.0/index.js

From the error message, it is the lib.dom.d.ts which causes conflicts with other definitions.

TS2300 [ERROR]: Duplicate identifier 'Event'.
declare class Event {
~~~~~
at asset:///lib.deno.web.d.ts:21:15

'Event' was also declared here.
interface Event {
~~~~~
at asset:///lib.dom.d.ts:5285:11 and here.
declare var Event: {
~~~~~
at asset:///lib.dom.d.ts:5353:13
...

Originally posted by @cj1128 in #3726 (comment)