# 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
const public1: Public1 = new Public1(), private1 = new Private();

export { public1 }

class Public1 {
}

class Private {}

// can be left as-is because this is low cost inference
const ERROR_STATUS_MAP = {
  "BadRequest": 400,
  "Unauthorized": 401,
  "PaymentRequired": 402,
  "Forbidden": 403,
  // etc...
} as const;
export type ErrorStatusKeys = keyof typeof ERROR_STATUS_MAP;
export const asIs1 = [1, 2, 3];
export const asIs2 = {
  a: [1, 2, 3],
  b: true,
  c: 10,
  d: 10n,
  e: 1 * 2,
  [1]: 4,
  f: 1 ? true : false,
  g: 1++,
  h: [...[1, 2], ...["test"]],
};
export const func1 = function (): string { return "test" };
export const func2 = (): string => "test";
export const func3 = () => "test";
export const func4 = () => "test" as const;
export const func5 = async () => "test";
export const func6 = async () => 1 as 1;
export const func7 = async () => 1 as Promise<1>;
export const func8 = async () => "test" as const;


// inferring simple types
export const inferred1 = 1 as 1;
export const inferred2 = 1 as string;
export const inferred3 = 1 as true;
export const inferred4 = /test/;
export const inferred5 = 1 as boolean;
export const inferred6 = <boolean>2;
export const inferred7 = 1 as 1 | 2 | 3 & 4;
export const inferred8 = 1 as ["test", 1];
export const inferred9 = 1 as [...string];
export const inferred10 = 1 as (1 | 2n)[];
export const inferred11 = 1 as (keyof string)[];
export const inferred12 = (1);

# 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": 1434,
      "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:
  {}
  const public1: Public1 = {} as never;
  export { public1 };
  class Public1 {
  }
  const ERROR_STATUS_MAP = {
    "BadRequest": 400,
    "Unauthorized": 401,
    "PaymentRequired": 402,
    "Forbidden": 403
  } as const;
  export type ErrorStatusKeys = keyof typeof ERROR_STATUS_MAP;
  export const asIs1 = [
    1,
    2,
    3
  ];
  export const asIs2 = {
    a: [
      1,
      2,
      3
    ],
    b: true,
    c: 10,
    d: 10n,
    e: 1 * 2,
    [1]: 4,
    f: 1 ? true : false,
    g: 1++,
    h: [
      ...[
        1,
        2
      ],
      ...[
        "test"
      ]
    ]
  };
  export const func1 = function(): string {
    return {} as never;
  };
  export const func2 = (): string =>({} as never);
  export const func3 = (): string =>({} as never);
  export const func4 = ()=>"test" as const;
  export const func5 = (): Promise<string> =>({} as never);
  export const func6 = (): Promise<1> =>({} as never);
  export const func7 = (): Promise<1> =>({} as never);
  export const func8 = async ()=>"test" as const;
  export const inferred1: 1 = {} as never;
  export const inferred2: string = {} as never;
  export const inferred3: true = {} as never;
  export const inferred4: RegExp = {} as never;
  export const inferred5: boolean = {} as never;
  export const inferred6: boolean = {} as never;
  export const inferred7: 1 | 2 | 3 & 4 = {} as never;
  export const inferred8: ["test", 1] = {} as never;
  export const inferred9: [...string] = {} as never;
  export const inferred10: (1 | 2n)[] = {} as never;
  export const inferred11: (keyof string)[] = {} as never;
  export const inferred12: 1 = {} as never;
  --- DTS ---
  declare const public1: Public1;
  export { public1 };
  declare class Public1 {
  }
  declare const ERROR_STATUS_MAP: {
    readonly "BadRequest": 400;
    readonly "Unauthorized": 401;
    readonly "PaymentRequired": 402;
    readonly "Forbidden": 403;
  };
  export type ErrorStatusKeys = keyof typeof ERROR_STATUS_MAP;
  export declare const asIs1: readonly [number, number, number];
  export declare const asIs2: {
    readonly a: readonly [number, number, number];
    readonly b: boolean;
    readonly c: number;
    readonly d: bigint;
    readonly e;
    readonly [1]: number;
    readonly f;
    readonly g;
    readonly h: readonly [readonly [number, number], readonly [string]];
  };
  export declare const func1: () => string;
  export declare const func2: () => string;
  export declare const func3: () => string;
  export declare const func4: () => any;
  export declare const func5: () => Promise<string>;
  export declare const func6: () => Promise<1>;
  export declare const func7: () => Promise<1>;
  export declare const func8: () => any;
  export declare const inferred1: 1;
  export declare const inferred2: string;
  export declare const inferred3: true;
  export declare const inferred4: RegExp;
  export declare const inferred5: boolean;
  export declare const inferred6: boolean;
  export declare const inferred7: 1 | 2 | 3 & 4;
  export declare const inferred8: ["test", 1];
  export declare const inferred9: [...string];
  export declare const inferred10: (1 | 2n)[];
  export declare const inferred11: (keyof string)[];
  export declare const inferred12: 1;
