-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Andrew Branch <[email protected]>
- Loading branch information
1 parent
17933ee
commit 45b1e3c
Showing
6 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/baselines/reference/reuseTypeAnnotationImportTypeInGlobalThisTypeArgument.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/types.js(3,21): error TS2304: Cannot find name 'Keyword'. | ||
/types.js(3,30): error TS2304: Cannot find name 'ParamValueTyped'. | ||
|
||
|
||
==== /contractHelper.d.ts (0 errors) ==== | ||
export function handleParamGovernance(zcf: any): { | ||
publicMixin: { | ||
getGovernedParams: () => globalThis.ERef<import("./types.js").ParamStateRecord>; | ||
}; | ||
}; | ||
|
||
==== /exported.d.ts (0 errors) ==== | ||
type _ERef<T> = T | Promise<T>; | ||
import { ParamStateRecord as _ParamStateRecord } from './types.js'; | ||
declare global { | ||
// @ts-ignore TS2666 | ||
export { | ||
_ERef as ERef, | ||
_ParamStateRecord as ParamStateRecord, | ||
}; | ||
} | ||
|
||
==== /types.js (2 errors) ==== | ||
export {}; | ||
/** | ||
* @typedef {Record<Keyword, ParamValueTyped>} ParamStateRecord a Record containing | ||
~~~~~~~ | ||
!!! error TS2304: Cannot find name 'Keyword'. | ||
~~~~~~~~~~~~~~~ | ||
!!! error TS2304: Cannot find name 'ParamValueTyped'. | ||
* keyword pairs with descriptions of parameters under governance. | ||
*/ | ||
|
||
==== /index.js (0 errors) ==== | ||
import { handleParamGovernance } from './contractHelper.js'; | ||
export const blah = handleParamGovernance({}); | ||
|
46 changes: 46 additions & 0 deletions
46
tests/baselines/reference/reuseTypeAnnotationImportTypeInGlobalThisTypeArgument.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//// [tests/cases/compiler/reuseTypeAnnotationImportTypeInGlobalThisTypeArgument.ts] //// | ||
|
||
//// [contractHelper.d.ts] | ||
export function handleParamGovernance(zcf: any): { | ||
publicMixin: { | ||
getGovernedParams: () => globalThis.ERef<import("./types.js").ParamStateRecord>; | ||
}; | ||
}; | ||
|
||
//// [exported.d.ts] | ||
type _ERef<T> = T | Promise<T>; | ||
import { ParamStateRecord as _ParamStateRecord } from './types.js'; | ||
declare global { | ||
// @ts-ignore TS2666 | ||
export { | ||
_ERef as ERef, | ||
_ParamStateRecord as ParamStateRecord, | ||
}; | ||
} | ||
|
||
//// [types.js] | ||
export {}; | ||
/** | ||
* @typedef {Record<Keyword, ParamValueTyped>} ParamStateRecord a Record containing | ||
* keyword pairs with descriptions of parameters under governance. | ||
*/ | ||
|
||
//// [index.js] | ||
import { handleParamGovernance } from './contractHelper.js'; | ||
export const blah = handleParamGovernance({}); | ||
|
||
|
||
|
||
|
||
//// [types.d.ts] | ||
/** | ||
* a Record containing | ||
* keyword pairs with descriptions of parameters under governance. | ||
*/ | ||
export type ParamStateRecord = Record<Keyword, ParamValueTyped>; | ||
//// [index.d.ts] | ||
export const blah: { | ||
publicMixin: { | ||
getGovernedParams: () => globalThis.ERef<import("./types.js").ParamStateRecord>; | ||
}; | ||
}; |
34 changes: 34 additions & 0 deletions
34
tests/cases/compiler/reuseTypeAnnotationImportTypeInGlobalThisTypeArgument.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @checkJs: true | ||
// @declaration: true | ||
// @module: preserve | ||
// @emitDeclarationOnly: true | ||
// @noTypesAndSymbols: true | ||
|
||
// @Filename: /contractHelper.d.ts | ||
export function handleParamGovernance(zcf: any): { | ||
publicMixin: { | ||
getGovernedParams: () => globalThis.ERef<import("./types.js").ParamStateRecord>; | ||
}; | ||
}; | ||
|
||
// @Filename: /exported.d.ts | ||
type _ERef<T> = T | Promise<T>; | ||
import { ParamStateRecord as _ParamStateRecord } from './types.js'; | ||
declare global { | ||
// @ts-ignore TS2666 | ||
export { | ||
_ERef as ERef, | ||
_ParamStateRecord as ParamStateRecord, | ||
}; | ||
} | ||
|
||
// @Filename: /types.js | ||
export {}; | ||
/** | ||
* @typedef {Record<Keyword, ParamValueTyped>} ParamStateRecord a Record containing | ||
* keyword pairs with descriptions of parameters under governance. | ||
*/ | ||
|
||
// @Filename: /index.js | ||
import { handleParamGovernance } from './contractHelper.js'; | ||
export const blah = handleParamGovernance({}); |