|
| 1 | +Input:: |
| 2 | +//// [/lib/lib.d.ts] |
| 3 | +/// <reference no-default-lib="true"/> |
| 4 | +interface Boolean {} |
| 5 | +interface Function {} |
| 6 | +interface CallableFunction {} |
| 7 | +interface NewableFunction {} |
| 8 | +interface IArguments {} |
| 9 | +interface Number { toExponential: any; } |
| 10 | +interface Object {} |
| 11 | +interface RegExp {} |
| 12 | +interface String { charAt: any; } |
| 13 | +interface Array<T> { length: number; [n: number]: T; } |
| 14 | +interface ReadonlyArray<T> {} |
| 15 | +declare const console: { log(msg: any): void; }; |
| 16 | + |
| 17 | +//// [/src/solution/src/common/nominal.ts] |
| 18 | +/// <reference path="./types.d.ts" /> |
| 19 | +export declare type Nominal<T, Name extends string> = MyNominal<T, Name>; |
| 20 | + |
| 21 | +//// [/src/solution/src/common/tsconfig.json] |
| 22 | + |
| 23 | + |
| 24 | +//// [/src/solution/src/common/types.d.ts] |
| 25 | +declare type MyNominal<T, Name extends string> = T & { |
| 26 | + specialKey: Name; |
| 27 | +}; |
| 28 | + |
| 29 | +//// [/src/solution/src/subProject/index.ts] |
| 30 | +import { Nominal } from '../common/nominal'; |
| 31 | +export type MyNominal = Nominal<string, 'MyNominal'>; |
| 32 | + |
| 33 | +//// [/src/solution/src/subProject/tsconfig.json] |
| 34 | + |
| 35 | + |
| 36 | +//// [/src/solution/src/subProject2/index.ts] |
| 37 | +import { MyNominal } from '../subProject/index'; |
| 38 | +const variable = { |
| 39 | + key: 'value' as MyNominal, |
| 40 | +}; |
| 41 | +export function getVar(): keyof typeof variable { |
| 42 | + return 'key'; |
| 43 | +} |
| 44 | + |
| 45 | +//// [/src/solution/src/subProject2/tsconfig.json] |
| 46 | + |
| 47 | + |
| 48 | +//// [/src/solution/src/tsconfig.json] |
| 49 | + |
| 50 | + |
| 51 | +//// [/src/solution/tsconfig.base.json] |
| 52 | +{"compilerOptions":{"rootDir":"./","outDir":"lib"}} |
| 53 | + |
| 54 | +//// [/src/solution/tsconfig.json] |
| 55 | +{"extends":"./tsconfig.base.json","compilerOptions":{"composite":true},"include":["./src/**/*.ts"]} |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +Output:: |
| 60 | +/lib/tsc --b /src/solution/tsconfig.json --verbose |
| 61 | +[[90m12:00:00 AM[0m] Projects in this build: |
| 62 | + * src/solution/tsconfig.json |
| 63 | + |
| 64 | +[[90m12:00:00 AM[0m] Project 'src/solution/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist |
| 65 | + |
| 66 | +[[90m12:00:00 AM[0m] Building project '/src/solution/tsconfig.json'... |
| 67 | + |
| 68 | +exitCode:: ExitStatus.Success |
| 69 | + |
| 70 | + |
| 71 | +//// [/src/solution/lib/src/common/nominal.d.ts] |
| 72 | +/// <reference path="../../../src/common/types.d.ts" /> |
| 73 | +export declare type Nominal<T, Name extends string> = MyNominal<T, Name>; |
| 74 | + |
| 75 | + |
| 76 | +//// [/src/solution/lib/src/common/nominal.js] |
| 77 | +"use strict"; |
| 78 | +exports.__esModule = true; |
| 79 | +/// <reference path="./types.d.ts" /> |
| 80 | + |
| 81 | + |
| 82 | +//// [/src/solution/lib/src/subProject/index.d.ts] |
| 83 | +import { Nominal } from '../common/nominal'; |
| 84 | +export declare type MyNominal = Nominal<string, 'MyNominal'>; |
| 85 | + |
| 86 | + |
| 87 | +//// [/src/solution/lib/src/subProject/index.js] |
| 88 | +"use strict"; |
| 89 | +exports.__esModule = true; |
| 90 | + |
| 91 | + |
| 92 | +//// [/src/solution/lib/src/subProject2/index.d.ts] |
| 93 | +declare const variable: { |
| 94 | + key: globalThis.MyNominal<string, "MyNominal">; |
| 95 | +}; |
| 96 | +export declare function getVar(): keyof typeof variable; |
| 97 | +export {}; |
| 98 | + |
| 99 | + |
| 100 | +//// [/src/solution/lib/src/subProject2/index.js] |
| 101 | +"use strict"; |
| 102 | +exports.__esModule = true; |
| 103 | +exports.getVar = void 0; |
| 104 | +var variable = { |
| 105 | + key: 'value' |
| 106 | +}; |
| 107 | +function getVar() { |
| 108 | + return 'key'; |
| 109 | +} |
| 110 | +exports.getVar = getVar; |
| 111 | + |
| 112 | + |
| 113 | +//// [/src/solution/lib/tsconfig.tsbuildinfo] |
| 114 | +{ |
| 115 | + "program": { |
| 116 | + "fileInfos": { |
| 117 | + "../../../lib/lib.d.ts": { |
| 118 | + "version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", |
| 119 | + "signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", |
| 120 | + "affectsGlobalScope": true |
| 121 | + }, |
| 122 | + "../src/common/types.d.ts": { |
| 123 | + "version": "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};", |
| 124 | + "signature": "23815050294-declare type MyNominal<T, Name extends string> = T & {\n specialKey: Name;\n};", |
| 125 | + "affectsGlobalScope": true |
| 126 | + }, |
| 127 | + "../src/common/nominal.ts": { |
| 128 | + "version": "4107369137-/// <reference path=\"./types.d.ts\" />\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;", |
| 129 | + "signature": "-18894149496-/// <reference path=\"../../../src/common/types.d.ts\" />\r\nexport declare type Nominal<T, Name extends string> = MyNominal<T, Name>;\r\n", |
| 130 | + "affectsGlobalScope": false |
| 131 | + }, |
| 132 | + "../src/subproject/index.ts": { |
| 133 | + "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal<string, 'MyNominal'>;", |
| 134 | + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal<string, 'MyNominal'>;\r\n", |
| 135 | + "affectsGlobalScope": false |
| 136 | + }, |
| 137 | + "../src/subproject2/index.ts": { |
| 138 | + "version": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", |
| 139 | + "signature": "-448645961-declare const variable: {\r\n key: globalThis.MyNominal<string, \"MyNominal\">;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n", |
| 140 | + "affectsGlobalScope": false |
| 141 | + } |
| 142 | + }, |
| 143 | + "options": { |
| 144 | + "rootDir": "..", |
| 145 | + "outDir": "./", |
| 146 | + "composite": true, |
| 147 | + "configFilePath": "../tsconfig.json" |
| 148 | + }, |
| 149 | + "referencedMap": { |
| 150 | + "../src/common/nominal.ts": [ |
| 151 | + "../src/common/types.d.ts" |
| 152 | + ], |
| 153 | + "../src/subproject/index.ts": [ |
| 154 | + "../src/common/nominal.ts" |
| 155 | + ], |
| 156 | + "../src/subproject2/index.ts": [ |
| 157 | + "../src/subproject/index.ts" |
| 158 | + ] |
| 159 | + }, |
| 160 | + "exportedModulesMap": { |
| 161 | + "../src/subproject/index.ts": [ |
| 162 | + "../src/common/nominal.ts" |
| 163 | + ] |
| 164 | + }, |
| 165 | + "semanticDiagnosticsPerFile": [ |
| 166 | + "../../../lib/lib.d.ts", |
| 167 | + "../src/common/nominal.ts", |
| 168 | + "../src/common/types.d.ts", |
| 169 | + "../src/subproject/index.ts", |
| 170 | + "../src/subproject2/index.ts" |
| 171 | + ] |
| 172 | + }, |
| 173 | + "version": "FakeTSVersion" |
| 174 | +} |
| 175 | + |
0 commit comments