Skip to content

Commit 6a4b65e

Browse files
committed
Fixing node-library-build test project.
1 parent a15045f commit 6a4b65e

5 files changed

Lines changed: 634 additions & 3 deletions

File tree

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
/**
2+
* api-extractor-test-01
3+
*
4+
* @remarks
5+
* This library is consumed by api-extractor-test-02 and api-extractor-test-03.
6+
* It tests the basic types of definitions, and all the weird cases for following
7+
* chains of type aliases.
8+
*
9+
* @packagedocumentation
10+
*/
11+
12+
/// <reference types="jest" />
13+
14+
/**
15+
* Example of an abstract class that is directly exported.
16+
* @public
17+
*/
18+
export declare abstract class AbstractClass {
19+
abstract test(): void;
20+
}
21+
22+
/**
23+
* Example of an abstract class that is exported separately from its
24+
* definition.
25+
*
26+
* @public
27+
*/
28+
export declare abstract class AbstractClass2 {
29+
abstract test2(): void;
30+
}
31+
32+
/**
33+
* Example of an abstract class that is not the default export
34+
*
35+
* @public
36+
*/
37+
export declare abstract class AbstractClass3 {
38+
abstract test3(): void;
39+
}
40+
41+
/**
42+
* Test different kinds of ambient definitions
43+
* @public
44+
*/
45+
export declare class AmbientConsumer {
46+
/**
47+
* Found via tsconfig.json's "lib" setting, which specifies the built-in "es2015.collection"
48+
*/
49+
builtinDefinition1(): Map<string, string>;
50+
/**
51+
* Found via tsconfig.json's "lib" setting, which specifies the built-in "es2015.promise"
52+
*/
53+
builtinDefinition2(): Promise<void>;
54+
/**
55+
* Configured via tsconfig.json's "lib" setting, which specifies "@types/jest".
56+
* The emitted index.d.ts gets a reference like this: <reference types="jest" />
57+
*/
58+
definitelyTyped(): jest.Context;
59+
/**
60+
* Found via tsconfig.json's "include" setting point to a *.d.ts file.
61+
* This is an old-style Definitely Typed definition, which is the worst possible kind,
62+
* because consumers are expected to provide this, with no idea where it came from.
63+
*/
64+
localTypings(): IAmbientInterfaceExample;
65+
}
66+
67+
/**
68+
* Referenced by DefaultExportEdgeCaseReferencer.
69+
* @public
70+
*/
71+
export declare class ClassExportedAsDefault {
72+
}
73+
74+
/**
75+
* This class illustrates some cases involving type literals.
76+
* @public
77+
*/
78+
export declare class ClassWithTypeLiterals {
79+
/** type literal in */
80+
method1(vector: {
81+
x: number;
82+
y: number;
83+
}): void;
84+
/** type literal output */
85+
method2(): {
86+
classValue: ClassWithTypeLiterals;
87+
callback: () => number;
88+
} | undefined;
89+
}
90+
91+
/**
92+
* Tests a decorator
93+
* @public
94+
*/
95+
export declare class DecoratorTest {
96+
/**
97+
* Function with a decorator
98+
*/
99+
test(): void;
100+
}
101+
102+
/**
103+
* @public
104+
*/
105+
export declare class DefaultExportEdgeCase {
106+
/**
107+
* This reference is encountered before the definition of DefaultExportEdgeCase.
108+
* The symbol.name will be "default" in this situation.
109+
*/
110+
reference: ClassExportedAsDefault;
111+
}
112+
113+
/** @public */
114+
export declare class ForgottenExportConsumer1 {
115+
test1(): IForgottenExport | undefined;
116+
}
117+
118+
/** @public */
119+
export declare class ForgottenExportConsumer2 {
120+
test2(): IForgottenExport_2 | undefined;
121+
}
122+
123+
/**
124+
* This class directly consumes IForgottenDirectDependency
125+
* and indirectly consumes IForgottenIndirectDependency.
126+
* @beta
127+
*/
128+
export declare class ForgottenExportConsumer3 {
129+
test2(): IForgottenDirectDependency | undefined;
130+
}
131+
132+
/**
133+
* This class is directly consumed by ForgottenExportConsumer3.
134+
*/
135+
declare interface IForgottenDirectDependency {
136+
member: IForgottenIndirectDependency;
137+
}
138+
139+
/**
140+
* The ForgottenExportConsumer1 class relies on this IForgottenExport.
141+
*
142+
* This should end up as a non-exported "IForgottenExport" in the index.d.ts.
143+
*/
144+
declare interface IForgottenExport {
145+
instance1: string;
146+
}
147+
148+
/**
149+
* The ForgottenExportConsumer2 class relies on this IForgottenExport.
150+
*
151+
* This should end up as a non-exported "IForgottenExport_2" in the index.d.ts.
152+
* It is renamed to avoid a conflict with the IForgottenExport from ForgottenExportConsumer1.
153+
*/
154+
declare interface IForgottenExport_2 {
155+
instance2: string;
156+
}
157+
158+
/**
159+
* This class is indirectly consumed by ForgottenExportConsumer3.
160+
*/
161+
declare interface IForgottenIndirectDependency {
162+
}
163+
164+
/**
165+
* This interface is exported as the default export for its source file.
166+
* @public
167+
*/
168+
export declare interface IInterfaceAsDefaultExport {
169+
/**
170+
* A member of the interface
171+
*/
172+
member: string;
173+
}
174+
175+
/* Excluded from this release type: IMergedInterface */
176+
177+
/* Excluded from this release type: IMergedInterfaceReferencee */
178+
179+
/**
180+
* A simple, normal definition
181+
* @public
182+
*/
183+
export declare interface ISimpleInterface {
184+
}
185+
186+
/**
187+
* This class gets aliased twice before being exported from the package.
188+
* @public
189+
*/
190+
export declare class ReexportedClass {
191+
getSelfReference(): ReexportedClass;
192+
getValue(): string;
193+
}
194+
195+
/* Excluded from this release type: _TypeReferencesInAedoc */
196+
197+
/**
198+
* Example decorator
199+
* @public
200+
*/
201+
export declare function virtual(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>): void;

0 commit comments

Comments
 (0)