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

73 lines
1.8 KiB
Diff

--- old.jsDeclarationsImportAliasExposedWithinNamespaceCjs.js
+++ new.jsDeclarationsImportAliasExposedWithinNamespaceCjs.js
@@= skipped -53, +53 lines =@@
//// [file.d.ts]
+export { myTypes };
/**
* @namespace myTypes
* @global
* @type {Object<string,*>}
*/
-export const myTypes: {
- [x: string]: any;
-};
-export namespace myTypes {
- type typeA = string | RegExp | Array<string | RegExp>;
- type typeB = {
+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 -20, +21 lines =@@
*/
prop2: string;
};
- type typeC = myTypes.typeB | Function;
+}
+export declare namespace myTypes {
+ export type typeC = myTypes.typeB | Function;
}
//// [file2.d.ts]
+declare const _exports: {
+ testFn: typeof testFn;
+ testFnTypes: Record<string, any>;
+};
+export = _exports;
+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 */
/**
* @function testFn
@@= skipped -10, +27 lines =@@
* @param {testFnTypes.input} input - Input.
* @returns {number|null} Result.
*/
-export function testFn(input: testFnTypes.input): number | null;
-/**
- * @namespace testFnTypes
- * @global
- * @type {Object<string,*>}
- */
-export const testFnTypes: {
- [x: string]: any;
-};
-export namespace testFnTypes {
- type input = boolean | myTypes.typeC;
-}
-import { myTypes } from "./file.js";
+declare function testFn(input: testFnTypes.input): number | null;