Skip to content

Commit 613880a

Browse files
octogonzjavier-garcia-meteologica
authored andcommitted
Add dynamicImportType2 test that illustrates how dotted namespaces are handled
1 parent 187dbf9 commit 613880a

File tree

8 files changed

+110
-0
lines changed

8 files changed

+110
-0
lines changed

build-tests/api-extractor-scenarios/config/build-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"docReferences2",
1616
"docReferences3",
1717
"dynamicImportType",
18+
"dynamicImportType2",
1819
"ecmaScriptPrivateFields",
1920
"exportDuplicate",
2021
"exportEquals",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"metadata": {
3+
"toolPackage": "@microsoft/api-extractor",
4+
"toolVersion": "[test mode]",
5+
"schemaVersion": 1003,
6+
"oldestForwardsCompatibleVersion": 1001
7+
},
8+
"kind": "Package",
9+
"canonicalReference": "api-extractor-scenarios!",
10+
"docComment": "",
11+
"name": "api-extractor-scenarios",
12+
"members": [
13+
{
14+
"kind": "EntryPoint",
15+
"canonicalReference": "api-extractor-scenarios!",
16+
"name": "",
17+
"members": [
18+
{
19+
"kind": "Interface",
20+
"canonicalReference": "api-extractor-scenarios!IExample:interface",
21+
"docComment": "/**\n * @public\n */\n",
22+
"excerptTokens": [
23+
{
24+
"kind": "Content",
25+
"text": "export interface IExample "
26+
}
27+
],
28+
"releaseTag": "Public",
29+
"name": "IExample",
30+
"members": [
31+
{
32+
"kind": "PropertySignature",
33+
"canonicalReference": "api-extractor-scenarios!IExample#dottedImportType:member",
34+
"docComment": "",
35+
"excerptTokens": [
36+
{
37+
"kind": "Content",
38+
"text": "dottedImportType: "
39+
},
40+
{
41+
"kind": "Content",
42+
"text": "import('api-extractor-lib1-test')."
43+
},
44+
{
45+
"kind": "Reference",
46+
"text": "Lib1Namespace.Inner.X",
47+
"canonicalReference": "api-extractor-lib1-test!Lib1Namespace.Inner.X:class"
48+
},
49+
{
50+
"kind": "Content",
51+
"text": ";"
52+
}
53+
],
54+
"releaseTag": "Public",
55+
"name": "dottedImportType",
56+
"propertyTypeTokenRange": {
57+
"startIndex": 1,
58+
"endIndex": 3
59+
}
60+
}
61+
],
62+
"extendsTokenRanges": []
63+
}
64+
]
65+
}
66+
]
67+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## API Report File for "api-extractor-scenarios"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import * as Lib1Namespace_Inner_X from 'api-extractor-lib1-test';
8+
9+
// @public (undocumented)
10+
export interface IExample {
11+
// (undocumented)
12+
dottedImportType: Lib1Namespace_Inner_X.Lib1Namespace.Inner.X;
13+
}
14+
15+
16+
// (No @packageDocumentation comment for this package)
17+
18+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Lib1Namespace_Inner_X from 'api-extractor-lib1-test';
2+
3+
/** @public */
4+
export declare interface IExample {
5+
dottedImportType: Lib1Namespace_Inner_X.Lib1Namespace.Inner.X;
6+
}
7+
8+
export { }

build-tests/api-extractor-scenarios/src/dynamicImportType/Item.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
/** @public */
25
export class Item {
36
options: import('./Options').Options;

build-tests/api-extractor-scenarios/src/dynamicImportType/Options.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
export interface Options {
25
name: string;
36
color: 'red' | 'blue';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
export { Lib2Class } from 'api-extractor-lib2-test';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
/** @public */
5+
export interface IExample {
6+
dottedImportType: import('api-extractor-lib1-test').Lib1Namespace.Inner.X;
7+
}

0 commit comments

Comments
 (0)