error TS2468: Cannot find global value 'Promise'.
/index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`.
/index.ts(3,31): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
/index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`.
/index.ts(6,14): error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
/index.ts(6,58): error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other.ts(3,22): error TS1005: 'assert' expected.
/other.ts(3,39): error TS1005: ';' expected.
/other.ts(3,50): error TS1128: Declaration or statement expected.
/other.ts(3,51): error TS1128: Declaration or statement expected.
/other.ts(3,52): error TS1128: Declaration or statement expected.
/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'.
/other.ts(4,7): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
/other.ts(4,22): error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'.
  Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'.
/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other.ts(6,49): error TS1005: 'assert' expected.
/other.ts(6,66): error TS1005: ';' expected.
/other.ts(6,77): error TS1128: Declaration or statement expected.
/other.ts(6,78): error TS1128: Declaration or statement expected.
/other.ts(6,79): error TS1128: Declaration or statement expected.
/other.ts(6,80): error TS1434: Unexpected keyword or identifier.
/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'.
/other.ts(6,96): error TS1128: Declaration or statement expected.
/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other.ts(7,49): error TS1005: 'assert' expected.
/other.ts(7,66): error TS1005: ';' expected.
/other.ts(7,76): error TS1128: Declaration or statement expected.
/other.ts(7,77): error TS1128: Declaration or statement expected.
/other.ts(7,78): error TS1128: Declaration or statement expected.
/other.ts(7,79): error TS1434: Unexpected keyword or identifier.
/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'.
/other.ts(7,94): error TS1128: Declaration or statement expected.
/other2.ts(3,32): error TS1455: `resolution-mode` is the only valid key for type import assertions.
/other2.ts(4,32): error TS1455: `resolution-mode` is the only valid key for type import assertions.
/other2.ts(4,52): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
/other2.ts(6,59): error TS1455: `resolution-mode` is the only valid key for type import assertions.
/other2.ts(7,59): error TS1455: `resolution-mode` is the only valid key for type import assertions.
/other2.ts(7,79): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other3.ts(3,21): error TS1005: '{' expected.
/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type.
/other3.ts(3,55): error TS1005: ';' expected.
/other3.ts(3,56): error TS1128: Declaration or statement expected.
/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'.
/other3.ts(4,7): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
/other3.ts(4,21): error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'.
/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other3.ts(6,48): error TS1005: '{' expected.
/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type.
/other3.ts(6,100): error TS1005: ',' expected.
/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other3.ts(7,48): error TS1005: '{' expected.
/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type.
/other3.ts(7,98): error TS1005: ',' expected.
/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other4.ts(6,21): error TS1005: '{' expected.
/other4.ts(6,21): error TS2448: Block-scoped variable 'Asserts1' used before its declaration.
/other4.ts(6,29): error TS1128: Declaration or statement expected.
/other4.ts(6,30): error TS1128: Declaration or statement expected.
/other4.ts(6,31): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration.
/other4.ts(7,7): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
/other4.ts(7,21): error TS2448: Block-scoped variable 'Asserts2' used before its declaration.
/other4.ts(7,31): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other4.ts(9,48): error TS1005: '{' expected.
/other4.ts(9,56): error TS1005: ',' expected.
/other4.ts(9,57): error TS1134: Variable declaration expected.
/other4.ts(9,74): error TS1005: ',' expected.
/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
/other4.ts(10,48): error TS1005: '{' expected.
/other4.ts(10,56): error TS1005: ',' expected.
/other4.ts(10,57): error TS1134: Variable declaration expected.
/other4.ts(10,73): error TS1005: ',' expected.
/other5.ts(2,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
/other5.ts(3,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
/other5.ts(3,37): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
/other5.ts(5,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
/other5.ts(6,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
/other5.ts(6,64): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.


!!! error TS2468: Cannot find global value 'Promise'.
==== /node_modules/pkg/package.json (0 errors) ====
    {
        "name": "pkg",
        "version": "0.0.1",
        "exports": {
            "import": "./import.js",
            "require": "./require.js"
        }
    }
==== /node_modules/pkg/import.d.ts (0 errors) ====
    export interface ImportInterface {}
==== /node_modules/pkg/require.d.ts (0 errors) ====
    export interface RequireInterface {}
==== /index.ts (5 errors) ====
    export type LocalInterface =
        & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface
                                                      ~~~~~~~~
!!! error TS1453: `resolution-mode` should be either `require` or `import`.
        & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface;
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
    
    export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface);
                                                                                 ~~~~~~~~
!!! error TS1453: `resolution-mode` should be either `require` or `import`.
    export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface);
                 ~
!!! error TS2841: The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4125: 'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
==== /other.ts (28 errors) ====
    // missing assert:
    export type LocalInterface =
        & import("pkg", {"resolution-mode": "require"}).RequireInterface
          ~~~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                         ~~~~~~~~~~~~~~~~~
!!! error TS1005: 'assert' expected.
!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here.
                                          ~
!!! error TS1005: ';' expected.
                                                     ~
!!! error TS1128: Declaration or statement expected.
                                                      ~
!!! error TS1128: Declaration or statement expected.
                                                       ~
!!! error TS1128: Declaration or statement expected.
                                                        ~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'RequireInterface'.
        & import("pkg", {"resolution-mode": "import"}).ImportInterface;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
                         ~~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'.
!!! error TS2322:   Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'.
                                                       ~~~~~~~~~~~~~~~
!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
    
    export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface);
                                     ~~~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                    ~~~~~~~~~~~~~~~~~
!!! error TS1005: 'assert' expected.
!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here.
                                                                     ~
!!! error TS1005: ';' expected.
                                                                                ~
!!! error TS1128: Declaration or statement expected.
                                                                                 ~
!!! error TS1128: Declaration or statement expected.
                                                                                  ~
!!! error TS1128: Declaration or statement expected.
                                                                                   ~~~~~~~~~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
                                                                                   ~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'RequireInterface'.
                                                                                                   ~
!!! error TS1128: Declaration or statement expected.
    export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface);
                                     ~~~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                    ~~~~~~~~~~~~~~~~~
!!! error TS1005: 'assert' expected.
!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here.
                                                                     ~
!!! error TS1005: ';' expected.
                                                                               ~
!!! error TS1128: Declaration or statement expected.
                                                                                ~
!!! error TS1128: Declaration or statement expected.
                                                                                 ~
!!! error TS1128: Declaration or statement expected.
                                                                                  ~~~~~~~~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
                                                                                  ~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ImportInterface'.
                                                                                                 ~
!!! error TS1128: Declaration or statement expected.
==== /other2.ts (6 errors) ====
    // wrong assertion key
    export type LocalInterface =
        & import("pkg", { assert: {"bad": "require"} }).RequireInterface
                                   ~~~~~
!!! error TS1455: `resolution-mode` is the only valid key for type import assertions.
        & import("pkg", { assert: {"bad": "import"} }).ImportInterface;
                                   ~~~~~
!!! error TS1455: `resolution-mode` is the only valid key for type import assertions.
                                                       ~~~~~~~~~~~~~~~
!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
    
    export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface);
                                                              ~~~~~
!!! error TS1455: `resolution-mode` is the only valid key for type import assertions.
    export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface);
                                                              ~~~~~
!!! error TS1455: `resolution-mode` is the only valid key for type import assertions.
                                                                                  ~~~~~~~~~~~~~~~
!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
==== /other3.ts (17 errors) ====
    // Array instead of object-y thing
    export type LocalInterface =
        & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface
          ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                        ~
!!! error TS1005: '{' expected.
!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here.
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type.
                                                          ~
!!! error TS1005: ';' expected.
                                                           ~
!!! error TS1128: Declaration or statement expected.
                                                            ~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'RequireInterface'.
        & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'.
                                                           ~~~~~~~~~~~~~~~
!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
    
    export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface);
                                     ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                   ~
!!! error TS1005: '{' expected.
!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here.
                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type.
                                                                                                       ~
!!! error TS1005: ',' expected.
    export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface);
                                     ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                   ~
!!! error TS1005: '{' expected.
!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here.
                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type.
                                                                                                     ~
!!! error TS1005: ',' expected.
==== /other4.ts (19 errors) ====
    // Indirected assertion objecty-thing - not allowed
    type Asserts1 = { assert: {"resolution-mode": "require"} };
    type Asserts2 = { assert: {"resolution-mode": "import"} };
    
    export type LocalInterface =
        & import("pkg", Asserts1).RequireInterface
          ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                        ~~~~~~~~
!!! error TS1005: '{' expected.
!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here.
                        ~~~~~~~~
!!! error TS2448: Block-scoped variable 'Asserts1' used before its declaration.
!!! related TS2728 /other4.ts:9:48: 'Asserts1' is declared here.
                                ~
!!! error TS1128: Declaration or statement expected.
                                 ~
!!! error TS1128: Declaration or statement expected.
                                  ~~~~~~~~~~~~~~~~
!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration.
!!! related TS2728 /other4.ts:9:58: 'RequireInterface' is declared here.
        & import("pkg", Asserts2).ImportInterface;
          ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
                        ~~~~~~~~
!!! error TS2448: Block-scoped variable 'Asserts2' used before its declaration.
!!! related TS2728 /other4.ts:10:48: 'Asserts2' is declared here.
                                  ~~~~~~~~~~~~~~~
!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'.
    
    export const a = (null as any as import("pkg", Asserts1).RequireInterface);
                                     ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                   ~~~~~~~~
!!! error TS1005: '{' expected.
!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here.
                                                           ~
!!! error TS1005: ',' expected.
                                                            ~
!!! error TS1134: Variable declaration expected.
                                                                             ~
!!! error TS1005: ',' expected.
    export const b = (null as any as import("pkg", Asserts2).ImportInterface);
                                     ~~~~~~~~~~~~~
!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'?
                                                   ~~~~~~~~
!!! error TS1005: '{' expected.
!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here.
                                                           ~
!!! error TS1005: ',' expected.
                                                            ~
!!! error TS1134: Variable declaration expected.
                                                                            ~
!!! error TS1005: ',' expected.
==== /other5.ts (6 errors) ====
    export type LocalInterface =
        & import("pkg", { assert: {} }).RequireInterface
                                  ~~
!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
        & import("pkg", { assert: {} }).ImportInterface;
                                  ~~
!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
                                        ~~~~~~~~~~~~~~~
!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
    
    export const a = (null as any as import("pkg", { assert: {} }).RequireInterface);
                                                             ~~
!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
    export const b = (null as any as import("pkg", { assert: {} }).ImportInterface);
                                                             ~~
!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`.
                                                                   ~~~~~~~~~~~~~~~
!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'.
    