Skip to content

Commit fd41831

Browse files
committed
Add api-extractor API
1 parent 4e1bef9 commit fd41831

File tree

46 files changed

+617
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+617
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [ApiJsonFile](api-extractor.apijsonfile.md) > [jsonSchema](api-extractor.apijsonfile.jsonschema.md)
2+
3+
# ApiJsonFile.jsonSchema property
4+
5+
The JSON Schema for API Extractor's \*.api.json files (api-json.schema.json).
6+
7+
**Signature:**
8+
```javascript
9+
jsonSchema: JsonSchema
10+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [ApiJsonFile](api-extractor.apijsonfile.md) > [loadFromFile](api-extractor.apijsonfile.loadfromfile.md)
2+
3+
# ApiJsonFile.loadFromFile method
4+
5+
Loads an \*.api.json data file, and validates that it conforms to the api-json.schema.json schema.
6+
7+
**Signature:**
8+
```javascript
9+
public static loadFromFile(apiJsonFilePath: string): IApiPackage;
10+
```
11+
**Returns:** `IApiPackage`
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| `apiJsonFilePath` | `string` | |
18+

api/api-extractor.apijsonfile.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [ApiJsonFile](api-extractor.apijsonfile.md)
2+
3+
# ApiJsonFile class
4+
5+
Support for loading the \*.api.json file.
6+
7+
## Properties
8+
9+
| Property | Access Modifier | Type | Description |
10+
| --- | --- | --- | --- |
11+
| [`jsonSchema`](api-extractor.apijsonfile.jsonschema.md) | | `JsonSchema` | The JSON Schema for API Extractor's \*.api.json files (api-json.schema.json). |
12+
13+
## Methods
14+
15+
| Method | Access Modifier | Returns | Description |
16+
| --- | --- | --- | --- |
17+
| [`loadFromFile(apiJsonFilePath)`](api-extractor.apijsonfile.loadfromfile.md) | `public` | `IApiPackage` | Loads an \*.api.json data file, and validates that it conforms to the api-json.schema.json schema. |
18+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [ExternalApiHelper](api-extractor.externalapihelper.md) > [generateApiJson](api-extractor.externalapihelper.generateapijson.md)
2+
3+
# ExternalApiHelper.generateApiJson method
4+
5+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
6+
7+
8+
**Signature:**
9+
```javascript
10+
public static generateApiJson(rootDir: string, libFolder: string, externalPackageFilePath: string): void;
11+
```
12+
**Returns:** `void`
13+
14+
## Parameters
15+
16+
| Parameter | Type | Description |
17+
| --- | --- | --- |
18+
| `rootDir` | `string` | the absolute path containing a 'package.json' file and is also a parent of the external package file. Ex: build.absolute\_build\_path. |
19+
| `libFolder` | `string` | the path to the lib folder relative to the rootDir, this is where 'external-api-json/external\_package.api.json' file will be written. Ex: 'lib'. |
20+
| `externalPackageFilePath` | `string` | the path to the '\*.d.ts' file of the external package relative to the rootDir. Ex: 'resources/external-api-json/es6-collection/index.t.ds' |
21+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [ExternalApiHelper](api-extractor.externalapihelper.md)
2+
3+
# ExternalApiHelper class
4+
5+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
6+
7+
ExternalApiHelper has the specific use case of generating an API json file from third-party definition files. This class is invoked by the gulp-core-build-typescript gulpfile, where the external package names are hard wired. The job of this method is almost the same as the API Extractor task that is executed on first party packages, with the exception that all packages analyzed here are external packages with definition files.
8+
9+
## Methods
10+
11+
| Method | Access Modifier | Returns | Description |
12+
| --- | --- | --- | --- |
13+
| [`generateApiJson(rootDir, libFolder, externalPackageFilePath)`](api-extractor.externalapihelper.generateapijson.md) | `public` | `void` | |
14+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [Extractor](api-extractor.extractor.md) > [analyzeProject](api-extractor.extractor.analyzeproject.md)
2+
3+
# Extractor.analyzeProject method
4+
5+
Invokes the API Extractor engine, using the configuration that was passed to the constructor.
6+
7+
**Signature:**
8+
```javascript
9+
public analyzeProject(options?: IAnalyzeProjectOptions): void;
10+
```
11+
**Returns:** `void`
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| `options` | `IAnalyzeProjectOptions` | |
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [Extractor](api-extractor.extractor.md) > [constructor](api-extractor.extractor.constructor.md)
2+
3+
# Extractor.constructor method
4+
5+
Constructs a new instance of the [Extractor](api-extractor.extractor.md) class
6+
7+
**Signature:**
8+
```javascript
9+
public constructor(config: IExtractorConfig, options?: IExtractorOptions);
10+
```
11+
12+
## Parameters
13+
14+
| Parameter | Type | Description |
15+
| --- | --- | --- |
16+
| `config` | `IExtractorConfig` | |
17+
| `options` | `IExtractorOptions` | |
18+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [Extractor](api-extractor.extractor.md) > [jsonSchema](api-extractor.extractor.jsonschema.md)
2+
3+
# Extractor.jsonSchema property
4+
5+
The JSON Schema for API Extractor config file (api-extractor-config.schema.json).
6+
7+
**Signature:**
8+
```javascript
9+
jsonSchema: JsonSchema
10+
```

api/api-extractor.extractor.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [Extractor](api-extractor.extractor.md)
2+
3+
# Extractor class
4+
5+
Used to invoke the API Extractor tool.
6+
7+
## Properties
8+
9+
| Property | Access Modifier | Type | Description |
10+
| --- | --- | --- | --- |
11+
| [`jsonSchema`](api-extractor.extractor.jsonschema.md) | | `JsonSchema` | The JSON Schema for API Extractor config file (api-extractor-config.schema.json). |
12+
13+
## Methods
14+
15+
| Method | Access Modifier | Returns | Description |
16+
| --- | --- | --- | --- |
17+
| [`constructor(config, options)`](api-extractor.extractor.constructor.md) | | | Constructs a new instance of the [Extractor](api-extractor.extractor.md) class |
18+
| [`analyzeProject(options)`](api-extractor.extractor.analyzeproject.md) | `public` | `void` | Invokes the API Extractor engine, using the configuration that was passed to the constructor. |
19+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Home](./index) > [@microsoft/api-extractor](api-extractor.md) > [IAnalyzeProjectOptions](api-extractor.ianalyzeprojectoptions.md)
2+
3+
# IAnalyzeProjectOptions interface
4+
5+
Options for [Extractor.analyzeProject](api-extractor.extractor.analyzeproject.md) .
6+
7+
## Properties
8+
9+
| Property | Type | Description |
10+
| --- | --- | --- |
11+
| [`projectConfig`](api-extractor.ianalyzeprojectoptions.projectconfig.md) | `IExtractorProjectConfig` | If omitted, then the [IExtractorConfig.project](api-extractor.iextractorconfig.project.md) config will be used by default. |
12+

0 commit comments

Comments
 (0)