|
| 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 | +/** |
| 5 | + * Example package docs. |
| 6 | + */ |
| 7 | +declare const packageDescription: void; // tslint:disable-line:no-unused-variable |
| 8 | + |
| 9 | +/** |
| 10 | + * Test the alias-following logic: This class gets aliased twice before being |
| 11 | + * exported from the package. |
| 12 | + */ |
| 13 | +export { ReexportedClass1 as ReexportedClass } from './ReexportedClass1'; |
| 14 | + |
| 15 | +/** |
| 16 | + * A simple, normal definition |
| 17 | + * @public |
| 18 | + */ |
| 19 | +export interface ISimpleInterface { |
| 20 | +} |
| 21 | + |
| 22 | +/** |
| 23 | + * Test different kinds of ambient definitions |
| 24 | + * @public |
| 25 | + */ |
| 26 | +export class AmbientConsumer { |
| 27 | + // Found via tsconfig.json's "lib" setting, which specifies the built-in "es2015.collection" |
| 28 | + public builtinDefinition1(): Map<string, string> { |
| 29 | + return new Map<string, string>(); |
| 30 | + } |
| 31 | + |
| 32 | + // Found via tsconfig.json's "lib" setting, which specifies the built-in "es2015.promise" |
| 33 | + public builtinDefinition2(): Promise<void> { |
| 34 | + return new Promise<void>(() => { /* */ }); |
| 35 | + } |
| 36 | + |
| 37 | + // Configured via tsconfig.json's "lib" setting, which specifies "@types/jest". |
| 38 | + // The emitted index.d.ts gets a reference like this: <reference types="jest" /> |
| 39 | + public definitelyTyped(): jest.Context { |
| 40 | + return {} as jest.Context; |
| 41 | + } |
| 42 | + |
| 43 | + // Found via tsconfig.json's "include" setting point to a *.d.ts file. |
| 44 | + // This is an old-style Definitely Typed definition, which is the worst possible kind, |
| 45 | + // because consumers are expected to provide this, with no idea where it came from. |
| 46 | + public localTypings(): IAmbientInterfaceExample { |
| 47 | + return {} as IAmbientInterfaceExample; |
| 48 | + } |
| 49 | +} |
0 commit comments