# https://jsr.io/@scope/a/meta.json
{"versions": { "1.0.0": {} } }

# https://jsr.io/@scope/a/1.0.0_meta.json
{ "exports": { ".": "./mod.ts" } }

# https://jsr.io/@scope/a/1.0.0/mod.ts
export function test() {
}

// should not raise a diagnostic because `sub` doesn't conflict with anything
test.localDecl = sub.localDecl;
// shouldn't raise diagnostic for localDecl here either
test.other = function (localDecl: number): void {};

export namespace sub {
  export function localDecl(): string {
  }
}

# mod.ts
import 'jsr:@scope/a'

# output
{
  "roots": [
    "file:///mod.ts"
  ],
  "modules": [
    {
      "kind": "esm",
      "dependencies": [
        {
          "specifier": "jsr:@scope/a",
          "code": {
            "specifier": "jsr:@scope/a",
            "resolutionMode": "import",
            "span": {
              "start": {
                "line": 0,
                "character": 7
              },
              "end": {
                "line": 0,
                "character": 21
              }
            }
          }
        }
      ],
      "size": 22,
      "mediaType": "TypeScript",
      "specifier": "file:///mod.ts"
    },
    {
      "kind": "esm",
      "size": 316,
      "mediaType": "TypeScript",
      "specifier": "https://jsr.io/@scope/a/1.0.0/mod.ts"
    }
  ],
  "redirects": {
    "jsr:@scope/a": "https://jsr.io/@scope/a/1.0.0/mod.ts"
  },
  "packages": {
    "@scope/a@*": "@scope/a@1.0.0"
  }
}

Fast check https://jsr.io/@scope/a/1.0.0/mod.ts:
  {}
  export function test(): void {}
  export namespace sub {
    export function localDecl(): string {
      return {} as never;
    }
  }
  export namespace test {
    export var localDecl = sub.localDecl, other = function(localDecl: number): void {};
  }
  --- DTS ---
  export declare function test(): void;
  export declare namespace sub {
    export function localDecl(): string;
  }
  export declare namespace test {
    export var localDecl: any, other: (localDecl: number) => void;
  }
  --- DTS Diagnostics ---
  unable to infer type, falling back to any type
      at https://jsr.io/@scope/a/1.0.0/mod.ts@111
