Files
tsgo/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespace.js.diff

78 lines
2.0 KiB
Diff

--- old.jsDeclarationsImportAliasExposedWithinNamespace.js
+++ new.jsDeclarationsImportAliasExposedWithinNamespace.js
@@= skipped -53, +53 lines =@@
//// [file.d.ts]
-export namespace myTypes {
- type typeA = string | RegExp | Array<string | RegExp>;
- type typeB = {
+/**
+ * @namespace myTypes
+ * @global
+ * @type {Object<string,*>}
+ */
+declare const myTypes: Record<string, any>;
+export declare namespace myTypes {
+ export type typeA = string | RegExp | Array<string | RegExp>;
+}
+export declare namespace myTypes {
+ export type typeB = {
/**
* - Prop 1.
*/
@@= skipped -12, +20 lines =@@
*/
prop2: string;
};
- type typeC = myTypes.typeB | Function;
-}
+}
+export declare namespace myTypes {
+ export type typeC = myTypes.typeB | Function;
+}
+/** @typedef {string|RegExp|Array<string|RegExp>} myTypes.typeA */
/**
- * @namespace myTypes
- * @global
- * @type {Object<string,*>}
+ * @typedef myTypes.typeB
+ * @property {myTypes.typeA} prop1 - Prop 1.
+ * @property {string} prop2 - Prop 2.
*/
-export const myTypes: {
- [x: string]: any;
-};
+/** @typedef {myTypes.typeB|Function} myTypes.typeC */
+export { myTypes };
//// [file2.d.ts]
-export namespace testFnTypes {
- type input = boolean | myTypes.typeC;
+import { myTypes } from './file.js';
+/**
+ * @namespace testFnTypes
+ * @global
+ * @type {Object<string,*>}
+ */
+declare const testFnTypes: Record<string, any>;
+export declare namespace testFnTypes {
+ export type input = boolean | myTypes.typeC;
}
/** @typedef {boolean|myTypes.typeC} testFnTypes.input */
/**
@@= skipped -21, +30 lines =@@
* @param {testFnTypes.input} input - Input.
* @returns {number|null} Result.
*/
-export function testFn(input: testFnTypes.input): number | null;
-import { myTypes } from './file.js';
-/**
- * @namespace testFnTypes
- * @global
- * @type {Object<string,*>}
- */
-export const testFnTypes: {
- [x: string]: any;
-};
+declare function testFn(input: testFnTypes.input): number | null;
+export { testFn, testFnTypes };