@arcgis/api-extractor 5.0.0-next.136 → 5.0.0-next.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiExtractor-DXDxS3Cb.js +2644 -0
- package/dist/apiJson.d.ts +706 -760
- package/dist/cli.js +26 -2
- package/dist/compilerHints.d.ts +62 -0
- package/dist/diff/diffApiJson.d.ts +6 -3
- package/dist/diff/diffApiJson.js +142 -0
- package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
- package/dist/diff/fetchApiJsonFromNpm.js +9 -0
- package/dist/diff/types.d.ts +70 -56
- package/dist/diffTypes/index.d.ts +20 -23
- package/dist/diffTypes/index.js +4 -2
- package/dist/extractor/ApiExtractor.d.ts +72 -137
- package/dist/extractor/ApiExtractor.js +9 -0
- package/dist/extractor/config.d.ts +425 -39
- package/dist/extractor/config.js +17 -0
- package/dist/extractor/extractors/copyDoc.d.ts +25 -0
- package/dist/extractor/privateContext.d.ts +19 -0
- package/dist/extractor/privateContext.js +84 -0
- package/dist/extractor/processing/links.d.ts +12 -0
- package/dist/extractor/processing/links.js +177 -0
- package/dist/extractor/types.d.ts +40 -0
- package/dist/extractor/webComponent/findComponents.d.ts +19 -0
- package/dist/extractor/webComponent/findComponents.js +36 -0
- package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
- package/dist/extractor/webComponent/pathMapping.js +44 -0
- package/dist/index.d.ts +164 -12
- package/dist/index.js +3 -841
- package/dist/typeScript-9f8GK91w.js +64 -0
- package/dist/uiUtils/index.d.ts +10 -19
- package/dist/uiUtils/index.js +3 -55
- package/dist/utils/apiHelpers.d.ts +28 -61
- package/dist/utils/apiHelpers.js +80 -0
- package/dist/utils/astHelpers.d.ts +22 -21
- package/dist/utils/astHelpers.js +67 -0
- package/dist/utils/hydrateApiType.d.ts +26 -0
- package/dist/utils/hydrateApiType.js +62 -0
- package/dist/utils/inferEntrypoints.d.ts +17 -0
- package/dist/utils/inferEntrypoints.js +26 -0
- package/dist/utils/internalTypeScriptApis.d.ts +92 -0
- package/dist/utils/internalTypeScriptApis.js +58 -0
- package/dist/utils/partPrinter.d.ts +25 -19
- package/dist/utils/partPrinter.js +82 -0
- package/dist/vite/plugin.d.ts +53 -0
- package/dist/vite/plugin.js +107 -0
- package/dist/vite/typeScript.d.ts +16 -0
- package/dist/vite/typeScript.js +6 -0
- package/dist/worker-DuJtWFW5.js +3599 -0
- package/package.json +40 -9
- package/dist/cli.d.ts +0 -2
- package/dist/config/typeReferences/docLinkAdditions.d.ts +0 -51
- package/dist/config/typeReferences/globals.d.ts +0 -11
- package/dist/config/typeReferences/stringDocLinkAdditions.d.ts +0 -17
- package/dist/config/typeReferences/typeScriptGlobals.json.d.ts +0 -3
- package/dist/diff/index.d.ts +0 -3
- package/dist/diff/index.js +0 -149
- package/dist/ensureCemCompatibility.d.ts +0 -1
- package/dist/internalTypeScriptApis.d.ts +0 -31
- package/dist/types.d.ts +0 -22
- package/dist/utils/error.d.ts +0 -17
- package/dist/utils/jsDocHelpers.d.ts +0 -2
- package/dist/utils/jsDocParser.d.ts +0 -46
- package/dist/utils/jsDocPrinter.d.ts +0 -13
- package/dist/utils/print.d.ts +0 -6
|
@@ -1,139 +1,74 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** The path relative to which module.path will be resolved */
|
|
7
|
-
cwd: string;
|
|
8
|
-
environment: "development" | "production";
|
|
9
|
-
};
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { ApiModule } from "../apiJson.js";
|
|
3
|
+
import type { ApiExtractorConfig, ResolvedApiExtractorConfig } from "./config.js";
|
|
4
|
+
import type { ApiExtractorResult, ApiExtractorWatcher } from "./types.js";
|
|
5
|
+
|
|
10
6
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* ApiExtractor's main JavaScript entrypoint.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```js
|
|
11
|
+
*
|
|
12
|
+
* import { loadApiExtractorConfig, mergeApiExtractorConfigs } from "@arcgis/api-extractor/extractor/config";
|
|
13
|
+
* import { ApiExtractor } from "@arcgis/api-extractor/extractor/ApiExtractor";
|
|
14
|
+
*
|
|
15
|
+
* const baseConfig = await loadApiExtractorConfig(process.cwd(), "api-extractor.config.ts");
|
|
16
|
+
*
|
|
17
|
+
* // Optionally override parts of the config
|
|
18
|
+
* const mergedConfig = mergeApiExtractorConfigs(baseConfig, {
|
|
19
|
+
* types: {
|
|
20
|
+
* fullTypeCheck: true,
|
|
21
|
+
* },
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const extractor = new ApiExtractor(mergedConfig);
|
|
25
|
+
*
|
|
26
|
+
* const { apiJson, dtsFiles } = await extractor.run();
|
|
27
|
+
* // OR, start a watcher:
|
|
28
|
+
* const watcher = await extractor.watch();
|
|
29
|
+
* ```
|
|
13
30
|
*/
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* components or default exports.
|
|
59
|
-
*/
|
|
60
|
-
addExport(declaration: ApiDeclaration, isDefault: boolean): void;
|
|
61
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["properties"], apiProperty: ApiCustomElementField, apiComponent: ApiObjectLikeDeclaration, apiModule: ApiModule): void;
|
|
62
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["methods"], method: ApiClassMethod, component: ApiObjectLikeDeclaration, apiModule: ApiModule): void;
|
|
63
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["events"], event: ApiEvent, component: ApiObjectLikeDeclaration, apiModule: ApiModule): void;
|
|
64
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["functions"], apiFunction: ApiFunctionDeclaration, apiModule: ApiModule): void;
|
|
65
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["variables"], variable: ApiVariableDeclaration, apiModule: ApiModule): void;
|
|
66
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["classes"], classDeclaration: ApiClassDeclaration, apiModule: ApiModule): void;
|
|
67
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["customElements"], componentDeclaration: ApiCustomElementDeclaration, apiModule: ApiModule): void;
|
|
68
|
-
copyDoc(errorReportingNode: ts.Node, copyDocDefinitions: CopyDocDefinitions["interfaces"], interfaceDeclaration: ApiInterfaceDeclaration, apiModule: ApiModule): void;
|
|
69
|
-
/**
|
|
70
|
-
* Inherit public members from mixins and superclass.
|
|
71
|
-
*
|
|
72
|
-
* In cast of Lumina, for this to work, the superclass needs to be in a file
|
|
73
|
-
* named like a component (src/components/name/name.tsx), even if it is not a
|
|
74
|
-
* standalone component. See
|
|
75
|
-
* https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/3212
|
|
76
|
-
*/
|
|
77
|
-
inheritMembers(moduleName: string, component: ApiClassDeclaration | ApiMixinDeclaration, modules: ApiModule[]): void;
|
|
78
|
-
/**
|
|
79
|
-
* Inherit members from a superclass or mixin.
|
|
80
|
-
*/
|
|
81
|
-
protected inheritMembersFrom(parent: ApiExtractorInheritanceData, destination: ApiClassDeclaration | ApiMixinDeclaration, eventsWereExplicitlyInherited: boolean): void;
|
|
82
|
-
protected inheritMembersOfKind<T extends ApiAttribute | ApiCssCustomProperty | ApiCssCustomState | ApiCssPart | ApiEvent | ApiSlot>(members: T[] | undefined, parentMembers: T[], parentIndexedMembers: Record<string, T>, inheritedFrom?: ApiReference): T[];
|
|
83
|
-
resolvedInheritance: Record<string,
|
|
84
|
-
/**
|
|
85
|
-
* `false` means don't inherit (or resolution failed).
|
|
86
|
-
*
|
|
87
|
-
* `undefined` means we already inherited the members, but have not yet
|
|
88
|
-
* computed the inheritance data for this module (almost every class
|
|
89
|
-
* inherits some class, but only a few are inherited by other classes, so
|
|
90
|
-
* we compute inheritance data lazily).
|
|
91
|
-
*/
|
|
92
|
-
ApiExtractorInheritanceData | false | undefined>;
|
|
93
|
-
noInheritMembers: Readonly<Record<string, readonly string[]>>;
|
|
94
|
-
/**
|
|
95
|
-
* Based on the superclass name, find the actual declaration in the modules.
|
|
96
|
-
*/
|
|
97
|
-
protected resolveInheritance(superClassModule: string, modules: ApiModule[], isMixin: boolean): ApiExtractorInheritanceData | false;
|
|
98
|
-
/**
|
|
99
|
-
* Overwrite point
|
|
100
|
-
*
|
|
101
|
-
* FINAL: jsapi-extractor has a more efficient implementation because it
|
|
102
|
-
* has to deal with inheritance a lot. Unify it with Lumina.
|
|
103
|
-
*/
|
|
104
|
-
protected findSuperclassDeclaration(moduleName: string, modules: ApiModule[], _isMixin: boolean): readonly [string, ApiClassDeclaration | ApiMixinDeclaration] | false;
|
|
105
|
-
protected handleEventTypesProperty(_apiMember: ApiClassMember, _apiComponent: ApiClassDeclaration | ApiMixinDeclaration, _moduleName: string): void;
|
|
106
|
-
protected resolvePropertyAutoCastingType(_apiMember: ApiClassMember, _moduleName: string): void;
|
|
107
|
-
/**
|
|
108
|
-
* This method should check if the super property is an accessor, then the
|
|
109
|
-
* override property should be promoted to an accessor too.
|
|
110
|
-
* This is necessary until we migrate to standard decorators since - after
|
|
111
|
-
* that internal accessor status will match the status in the public typings.
|
|
112
|
-
*/
|
|
113
|
-
protected maybePromotePropertyToAutoAccessor(_apiProperty: ApiClassField, _superApiProperty: ApiClassField): void;
|
|
114
|
-
protected maybeResolveMixinBaseClass(_apiReference: ApiReferenceWithTypeArguments, _currentModule: string): ApiInterfaceDeclaration | undefined;
|
|
115
|
-
}
|
|
116
|
-
type ApiExtractorInheritanceData = {
|
|
117
|
-
inheritanceData: ApiReference;
|
|
118
|
-
declaration: ApiClassDeclaration | ApiMixinDeclaration;
|
|
119
|
-
/**
|
|
120
|
-
* Used for validation only. If class has any settable fields, and class is
|
|
121
|
-
* extended by another one, require that the class module exports the
|
|
122
|
-
* `<className>Properties` interface. It will be extended by the superclass'
|
|
123
|
-
* properties interface.
|
|
124
|
-
*/
|
|
125
|
-
hasSettableField: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Indexed by name for quick lookup of "overridden" status.
|
|
128
|
-
* Using a map because we do .get() during constructor of the Map, and because
|
|
129
|
-
* there are often 10+ items with random access.
|
|
130
|
-
*/
|
|
131
|
-
indexedMembers: Map<string, ApiClassMember | ApiCustomElementMember | undefined> | undefined;
|
|
132
|
-
indexedEvents: Record<string, ApiEvent> | undefined;
|
|
133
|
-
indexedAttributes: Record<string, ApiAttribute> | undefined;
|
|
134
|
-
indexedSlots: Record<string, ApiSlot> | undefined;
|
|
135
|
-
indexedCssParts: Record<string, ApiCssPart> | undefined;
|
|
136
|
-
indexedCssProperties: Record<string, ApiCssCustomProperty> | undefined;
|
|
137
|
-
indexedCssStates: Record<string, ApiCssCustomState> | undefined;
|
|
138
|
-
};
|
|
139
|
-
export {};
|
|
31
|
+
export class ApiExtractor {
|
|
32
|
+
constructor(rawConfig?: ApiExtractorConfig);
|
|
33
|
+
readonly config: ResolvedApiExtractorConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Number of errors logged during the extraction process.
|
|
36
|
+
* Errors will be logged using the `config.logger.error` callback if provided.
|
|
37
|
+
* Otherwise, they will be logged using `console.error`.
|
|
38
|
+
*
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
errorCount: number;
|
|
42
|
+
/** @experimental */
|
|
43
|
+
moduleMap: Map<string, ApiModule>;
|
|
44
|
+
/**
|
|
45
|
+
* @experimental
|
|
46
|
+
* @example "https://developers.arcgis.com/javascript/latest/api-reference/esri-"
|
|
47
|
+
*/
|
|
48
|
+
readonly normalizedApiReferencePrefix: string;
|
|
49
|
+
/**
|
|
50
|
+
* If doing typed extraction or full type check, this will be the ts.Program.
|
|
51
|
+
* If doing untyped watch, this will be a minimal Program-like object to reuse
|
|
52
|
+
* SourceFiles for unchanged files.
|
|
53
|
+
* Otherwise, undefined.
|
|
54
|
+
*/
|
|
55
|
+
program?: {
|
|
56
|
+
getSourceFile: ts.Program["getSourceFile"];
|
|
57
|
+
getSourceFiles: ts.Program["getSourceFiles"];
|
|
58
|
+
getTypeChecker?: ts.Program["getTypeChecker"];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
* @default 0
|
|
63
|
+
*/
|
|
64
|
+
silencedBrokenLinkCount: number;
|
|
65
|
+
/** The high-level API for running the extractor on the current project. */
|
|
66
|
+
run(): Promise<ApiExtractorResult>;
|
|
67
|
+
/**
|
|
68
|
+
* The high-level API for starting a watch-mode extraction on the current project.
|
|
69
|
+
* When watching, double check that the configuration options the ApiExtractor
|
|
70
|
+
* was created with are appropriate for watch mode (disable full type check
|
|
71
|
+
* and type verifier if not necessary).
|
|
72
|
+
*/
|
|
73
|
+
watch(): Promise<ApiExtractorWatcher>;
|
|
74
|
+
}
|