File: jsDeclarationsImportAliasExposedWithinNamespace.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (75 lines) | stat: -rw-r--r-- 1,835 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
=== tests/cases/conformance/jsdoc/declarations/file.js ===
/**
 * @namespace myTypes
 * @global
 * @type {Object<string,*>}
 */
const myTypes = {
>myTypes : { [x: string]: any; }
>{    // SOME PROPS HERE} : {}

    // SOME PROPS HERE
};

/** @typedef {string|RegExp|Array<string|RegExp>} myTypes.typeA */

/**
 * @typedef myTypes.typeB
 * @property {myTypes.typeA}    prop1 - Prop 1.
 * @property {string}           prop2 - Prop 2.
 */

/** @typedef {myTypes.typeB|Function} myTypes.typeC */

export {myTypes};
>myTypes : { [x: string]: any; }

=== tests/cases/conformance/jsdoc/declarations/file2.js ===
import {myTypes} from './file.js';
>myTypes : { [x: string]: any; }

/**
 * @namespace testFnTypes
 * @global
 * @type {Object<string,*>}
 */
const testFnTypes = {
>testFnTypes : { [x: string]: any; }
>{    // SOME PROPS HERE} : {}

    // SOME PROPS HERE
};

/** @typedef {boolean|myTypes.typeC} testFnTypes.input */

/**
 * @function testFn
 * @description A test function.
 * @param {testFnTypes.input} input - Input.
 * @returns {number|null} Result.
 */
function testFn(input) {
>testFn : (input: testFnTypes.input) => number | null
>input : import("tests/cases/conformance/jsdoc/declarations/file2").testFnTypes.input

    if (typeof input === 'number') {
>typeof input === 'number' : boolean
>typeof input : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
>input : import("tests/cases/conformance/jsdoc/declarations/file2").testFnTypes.input
>'number' : "number"

        return 2 * input;
>2 * input : number
>2 : 2
>input : never

    } else {
        return null;
>null : null
    }
}

export {testFn, testFnTypes};
>testFn : (input: testFnTypes.input) => number
>testFnTypes : { [x: string]: any; }