Skip to content

Commit 197493f

Browse files
committed
Add unit test that repros GitHub microsoft#1679
1 parent 9134a9d commit 197493f

5 files changed

Lines changed: 93 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"scenarioFolderNames": [
33
"ambientNameConflict",
44
"ambientNameConflict2",
5+
"ancillaryDeclarations",
56
"apiItemKinds",
67
"bundledPackages",
78
"circularImport",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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": "Class",
20+
"canonicalReference": "api-extractor-scenarios!MyClass:class",
21+
"docComment": "/**\n * @public\n */\n",
22+
"excerptTokens": [
23+
{
24+
"kind": "Content",
25+
"text": "export declare class MyClass "
26+
}
27+
],
28+
"releaseTag": "Public",
29+
"name": "MyClass",
30+
"members": [],
31+
"implementsTokenRanges": []
32+
}
33+
]
34+
}
35+
]
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// @internal (undocumented)
8+
export interface _IInternalThing {
9+
// (undocumented)
10+
title: string;
11+
}
12+
13+
// @public (undocumented)
14+
export class MyClass {
15+
// @internal (undocumented)
16+
get _thing(): _IInternalThing;
17+
// Warning: (ae-incompatible-release-tags) The symbol "_thing" is marked as @public, but its signature references "_IInternalThing" which is marked as @internal
18+
set _thing(value: _IInternalThing);
19+
}
20+
21+
22+
// (No @packageDocumentation comment for this package)
23+
24+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
/** @internal */
3+
export declare interface _IInternalThing {
4+
title: string;
5+
}
6+
7+
/** @public */
8+
export declare class MyClass {
9+
/** @internal */
10+
get _thing(): _IInternalThing;
11+
set _thing(value: _IInternalThing);
12+
}
13+
14+
export { }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
/** @internal */
5+
export interface _IInternalThing {
6+
title: string;
7+
}
8+
9+
/** @public */
10+
export class MyClass {
11+
/** @internal */
12+
public get _thing(): _IInternalThing {
13+
return { title: 'thing' };
14+
}
15+
// The setter should also be considered @internal because the getter was marked as internal.
16+
public set _thing(value: _IInternalThing) {
17+
}
18+
}

0 commit comments

Comments
 (0)