/** * The top-level type of an `api.json` file. * * `api.json` is a superset of custom-elements-manifest. * * @see https://custom-elements-manifest.open-wc.org/analyzer/getting-started/ */ export interface ApiJson { /** * The name of the package this api.json describes. * * > Not present in vanilla custom-elements-manifest. * * @example "@arcgis/map-components" */ name: string; /** * The timestamp at which the api.json was generated, in the format * `YYYY-MM-DDThh:mm:ss`. * * > Not present in vanilla custom-elements-manifest. * * @example "2000-00-00T00:00:00" */ timestamp: string; /** > Not present in vanilla custom-elements-manifest. */ compiler: ApiJsonCompiler; /** * The version of the schema used in this file. * * @example "1.0.0" */ schemaVersion: string; /** * The Markdown to use for the main readme of this package. * * This can be used to override the readme used by Github or npm if that file * contains information irrelevant to custom element catalogs and * documentation viewers. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ readme?: string; /** * An array of the modules this package contains. * * The modules should be public entrypoints that other packages may import * from. */ modules: ApiModule[]; /** * Whether the package is deprecated. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. * @default false */ deprecated?: string | true; } export interface ApiJsonCompiler { /** * The name of the compiler that generated the metadata. * * @example "@arcgis/api-extractor" */ name: string; /** * The version of the compiler that generated the metadata. * * @example "4.32.0" */ version: string; /** * The version of TypeScript that was used to generate the metadata. * * @example "5.4.5" */ typescriptVersion: string; } export type ApiModule = ApiJavaScriptModule; export interface ApiJavaScriptModule extends ApiWithDescription, ApiWithDocsTags, ApiWithUnusedSummary { kind: "javascript-module"; /** * Public import path for the module. If package.json "exports" was used, this * is the import path, not the .d.ts file path. * * @example "components/arcgis-map" */ path: string; /** * The original source file path, relative to extraction root (most commonly * src/ folder). * * > Not present in vanilla custom-elements-manifest. * * @example "components/map/map.tsx" */ sourcePath: string; /** * Whether the module is deprecated. * If the value is a string, it's the reason for the deprecation. * * If module is marked as deprecated, all its declarations should also be * marked as deprecated. This is because in TypeScript, a usage of a * declaration will only be marked as deprecated if the declaration itself * is marked as deprecated, rather than its module. * * @default false */ deprecated?: string | true; /** * The declarations of a module. * * For documentation purposes, all declarations that are reachable from * exports should be described here. Ie, functions and objects that may be * properties of exported objects, or passed as arguments to functions. */ declarations: ApiDeclaration[]; /** * The exports of a module. This includes JavaScript exports and * custom element definitions. */ exports?: ApiExport[]; } export interface ApiWithDescription { /** A markdown description of an api node */ description?: string; } export interface ApiWithDocsTags { docsTags?: ApiDocsTag[]; } export interface ApiWithDeprecated { /** * Whether the node is deprecated. * If the value is a string, it's the reason for the deprecation. * * @default false */ deprecated?: string | true; } export interface ApiWithUnusedSummary { /** * A markdown summary suitable for display in a listing. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ summary?: string; } /** * A descriptor for a single JSDoc tag found in a block comment. * * @remarks * Some tags have dedicated fields. Those will be excluded from array of * "docsTags". */ export interface ApiDocsTag { /** * The tag name (immediately following the '@'). * * @example "since" */ name: string; /** * The description that immediately follows the tag name. * * @example "4.31" */ text?: string; } export type ApiExport = ApiCustomElementExport | ApiJavaScriptExport | ApiTypeScriptExport; export interface ApiJavaScriptExport { kind: "js"; /** * The name of the exported symbol. * * JavaScript has a number of ways to export objects which determine the * correct name to use. * * - Default exports must use the name "default". * - Named exports use the name that is exported. If the export is renamed * with the "as" clause, use the exported name. * - Aggregating exports (`* from`) should use the name `*` */ name: string; /** * A reference to the exported declaration. * * In the case of aggregating exports, the reference's `module` field must be * defined and the `name` field must be `"*"`. */ declaration: ApiReference; /** * Whether the export is deprecated. For example, the name of the export was changed. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. Read the deprecated status from the declaration. * @default false */ deprecated?: string | true; } /** * Indicates that the export is type-only and has no runtime impact (is a type alias * or an interface). * * > Not present in vanilla custom-elements-manifest, but may be added in the future. * > See https://github.com/webcomponents/custom-elements-manifest/pull/77#issuecomment-873552677 */ export interface ApiTypeScriptExport extends Omit { kind: "ts"; } /** * A global custom element definition, ie the result of a * `customElements.define()` call. * * This is represented as an export because a definition makes the element * available outside of the module it's defined it. */ export interface ApiCustomElementExport { kind: "custom-element-definition"; /** * The tag name of the custom element. * * @example "arcgis-counter" */ name: string; /** * A reference to the class or other declaration that implements the * custom element. */ declaration: ApiReference; /** * Whether the custom-element export is deprecated. * For example, a future version will not register the custom element in this file. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. Read the deprecated status from the declaration. * @default false */ deprecated?: string | true; } export type ApiDeclaration = ApiClassDeclaration | ApiCustomElementDeclaration | ApiCustomElementMixinDeclaration | ApiFunctionDeclaration | ApiInterfaceDeclaration | ApiMixinDeclaration | ApiVariableDeclaration; /** * A reference to an export of a module. * * All references are required to be publicly accessible, so the canonical * representation of a reference is the export it's available from. * * `package` should generally refer to an npm package name. If `package` is * undefined then the reference is local to this package. If `module` is * undefined the reference is local to the containing module. * * References to global symbols like `Array`, `HTMLElement`, or `Event` should * use a `package` name of `"global:"`. */ export interface ApiReference { /** @example "AreaMeasurementAnalysis" */ name: string; /** @example "interfaces.d.ts" */ module?: string; /** @example "@arcgis/core" */ package?: string; /** * A URL to see user-friendly documentation for the type. * * @example "https://developers.arcgis.com/javascript/latest/references/core/views/MapView/" */ viewUrl?: string; } /** > Not present in vanilla custom-elements-manifest. */ export interface ApiReferenceWithTypeArguments extends ApiReference { typeArguments?: ApiType[]; } /** * Custom elements are JavaScript classes, so this extends from * `ClassDeclaration` and adds custom-element-specific features like attributes, * events, and slots. * * Note that `tagName` in this interface is optional. Tag names are not * necessarily part of a custom element class, but belong to the definition * (often called the "registration") or the `customElements.define()` call. * * Because classes and tag names can only be registered once, there's a * one-to-one relationship between classes and tag names. For ease of use, we * allow the tag name here. * * Some packages define and register custom elements in separate modules. In * these cases one `Module` should contain the `CustomElement` without a * tagName, and another `Module` should contain the `CustomElementExport`. */ export interface ApiCustomElementDeclaration extends ApiClassDeclaration, ApiWithPrivacy { /** * An optional tag name that should be specified if this is a * self-registering element. * * Self-registering elements must also include a CustomElementExport in the * module's exports. * * @example "arcgis-counter" */ tagName: string; /** * Tag name converted to PascalCase. * The interfaces for the custom element are based on this name. * * > Not present in vanilla custom-elements-manifest. * * @deprecated * Use `import { kebabToPascal } from "@arcgis/toolkit/string";` * utility to convert tag name to pascal case. * @example "ArcgisCounter" (even if class name is `Counter`) */ pascalCaseName: string; /** * True if the custom element is * [form-associated](https://html.spec.whatwg.org/dev/custom-elements.html). * * @default false */ formAssociated?: boolean; members: ApiCustomElementMember[]; /** * The attributes that this element is known to understand. * * For most use cases, the "members" array includes properties will all the * information included in the "attributes" array. Thus directly accessing * "attributes" is not necessary. */ attributes?: ApiAttribute[]; /** The shadow dom content slots that this element accepts. */ slots?: ApiSlot[]; cssParts?: ApiCssPart[]; cssProperties?: ApiCssCustomProperty[]; cssStates?: ApiCssCustomState[]; demos?: ApiDemo[]; /** Distinguishes a regular JavaScript class from a custom element class */ customElement: true; /** * > Not present in vanilla custom-elements-manifest. * * @default "shadow" */ encapsulation?: "none" | "shadow"; /** * The path from which the component can be imported. * * > Not present in vanilla custom-elements-manifest. * * @deprecated Use ApiModule.path instead. * @example "components/arcgis-area-measurement-2d" */ importPath: string; } export interface ApiWithPrivacy { /** * If this field is absent, default value is assumed. * All private fields are excluded from the api.json. * So in practice, this value will be either "protected" or undefined. * * \@arcgis/api-extractor may only ever set this field on class members, even * though the original spec also allows it on classes and events. * * @default "public" */ privacy?: "private" | "protected" | "public"; } /** * For most use cases, the "members" array includes properties with all the * information included in the "attributes" array. Thus directly accessing * "attributes" is not necessary. */ export interface ApiAttribute extends ApiWithDeprecated, ApiWithDescription, ApiWithInheritance, ApiWithUnusedSummary { /** @example "initial-count" */ name: string; /** The type that the attribute will be serialized/deserialized as. */ type: ApiType; /** * The default value of the attribute, if any. * * As attributes are always strings, this is the actual value, not a human * readable description. * * @example "10" */ default?: string; /** * The name of the field this attribute is associated with. * * @example "initialCount" */ fieldName?: string; } export interface ApiEvent extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithInheritance, ApiWithPrivacy, ApiWithUnusedSummary { /** @example "arcgisClick" */ name: string; /** The type of the event object that's fired. */ type: ApiType; /** * > Not present in vanilla custom-elements-manifest. * * @default true */ bubbles?: false; /** * > Not present in vanilla custom-elements-manifest. * * @default true */ cancelable?: false; /** * > Not present in vanilla custom-elements-manifest. * * @default true */ composed?: false; } export interface ApiWithInheritance { /** * To keep api.json size in check, `inheritedFrom` object does not include * `viewUrl`. */ inheritedFrom?: ApiReference; } /** @see [MDN Slot](https://developer.mozilla.org/docs/Web/HTML/Element/slot) */ export interface ApiSlot extends ApiWithDescription, ApiWithUnusedSummary { /** * The slot name, or the empty string for an unnamed slot. * * @example "header" */ name: string; /** * Whether the slot is deprecated. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. * @default false */ deprecated?: string | true; } /** * The description of exposed CSS Parts * * @see https://developer.mozilla.org/docs/Web/CSS/CSS_shadow_parts */ export interface ApiCssPart extends ApiWithDescription, ApiWithUnusedSummary { /** @example "tab" */ name: string; /** * Whether the CSS shadow part is deprecated. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. * @default false */ deprecated?: string | true; } /** * The description of a CSS Custom State. * * @see https://developer.mozilla.org/docs/Web/API/CustomStateSet */ export interface ApiCssCustomState extends ApiWithDescription, ApiWithUnusedSummary { /** * The name of the state. Note: Unlike CSS custom properties, custom states * do not have a leading `--`. * * @example "active" */ name: string; /** * Whether the CSS custom state is deprecated. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. * @default false */ deprecated?: string | true; } export interface ApiCssCustomProperty extends ApiWithDescription, ApiWithUnusedSummary { /** * The name of the property, including leading `--`. * * @example "--calcite-text-color" */ name: string; /** * The expected syntax of the defined property. Defaults to "*". * * The syntax must be a valid CSS * [syntax string](https://developer.mozilla.org/docs/Web/CSS/@property/syntax) * as defined in the CSS Properties and Values API. * * Examples: * * "": accepts a color * " | ": accepts lengths or percentages but not calc expressions with a combination of the two * "small | medium | large": accepts one of these values set as custom indents. * "*": any valid token * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ syntax?: string; default?: string; /** * Whether the CSS custom property is deprecated. * If the value is a string, it's the reason for the deprecation. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. * @default false */ deprecated?: string | true; } export interface ApiType extends ApiWithUnusedSource { /** * The full string representation of the type, in whatever type syntax is * used, such as JSDoc, Closure, or TypeScript. * * This represents a 'resolved' type, where e.g. imported types have been * resolved and inlined. * * @example Array<"active" | "inactive"> */ text: string; /** * An array of references to the types in the type string. * * These references have optional indices into the type string so that tools * can understand the references in the type string independently of the type * system and syntax. For example, a documentation viewer could display the * type `Array` with cross-references to `FooElement` * and `BarElement` without understanding arrays, generics, or union types. */ references?: ApiTypeReference[]; /** * An enum of possible values for this type. * * > Not present in vanilla custom-elements-manifest. */ values?: ApiValue[]; } export interface ApiWithUnusedSource { /** * A reference to the source of a declaration or member. * An absolute URL to the source (ie. a GitHub URL). * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ source?: { href: string; }; } export interface ApiValue { /** @example "string" */ type: string; /** @example "active" */ value?: string; } /** * A reference that is associated with a type string and optionally a range * within the string. * * Start and end must both be present or not present. If they're present, they * are indices into the associated type string. If they are missing, the entire * type string is the symbol referenced and the name should match the type * string. */ export interface ApiTypeReference extends ApiReference { start?: number; end?: number; } export interface ApiObjectLikeDeclaration extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSource, ApiWithUnusedSummary, ApiWithTypeParameters { /** @example "ArcgisCounter" */ name: string; members?: ApiClassMember[]; } export interface ApiWithTypeParameters { typeParameters?: ApiTypeParameter[]; } /** > Not present in vanilla custom-elements-manifest. */ export interface ApiTypeParameter { name: string; constraint?: ApiType; default?: ApiType; /** @default false */ const?: true; /** * @default false * @see [Type Parameter variance annotations](https://www.typescriptlang.org/docs/handbook/2/generics.html#variance-annotations) */ in?: true; /** @default false */ out?: true; } /** The common interface of classes and mixins. */ export interface ApiClassDeclaration extends ApiObjectLikeDeclaration, ApiWithEvents { kind: "class"; /** * The superclass of this class. * * If this class is defined with mixin applications, the prototype chain * includes the mixin applications and the true superclass is computed * from them. */ superclass?: ApiReferenceWithTypeArguments; /** * Any class mixins applied in the extends clause of this class. * * If mixins are applied in the class definition, then the true superclass * of this class is the result of applying mixins in order to the superclass. * * Mixins must be listed in order of their application to the superclass or * previous mixin application. This means that the innermost mixin is listed * first. This may read backwards from the common order in JavaScript, but * matches the order of language used to describe mixin application, like * "S with A, B". * * @see https://webgis.esri.com/sdk/contributing/core/core/mixins */ mixins?: ApiReferenceWithTypeArguments[]; } export interface ApiWithEvents { /** The events that this object fires. */ events?: ApiEvent[]; } /** * An interface that describes the properties and methods of an object. * * > Not yet part of vanilla custom-elements-manifest, but may be added in the * > future. See https://github.com/webcomponents/custom-elements-manifest/pull/77 */ export interface ApiInterfaceDeclaration extends ApiObjectLikeDeclaration { kind: "interface"; /** The interfaces that this interface extends. */ supertypes?: ApiReferenceWithTypeArguments[]; /** * Present in type aliases only. If type alias is an intersection, then type * reference members will be represented in the `supertypes` field. If type * alias is an object literal, then object members will be represented in * the `members` field. Thus, the `type` field will only be used for unions, * mapped types, conditional types, and other types that cannot be represented * as supertypes/members. */ type?: ApiType; } export type ApiClassMember = ApiClassCallSignature | ApiClassConstructor | ApiClassField | ApiClassMethod; export type ApiCustomElementMember = ApiClassMethod | ApiCustomElementField; /** * The common interface of variables, class fields, and function * parameters. */ export interface ApiPropertyLike extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSummary { /** * @example "initialCount" * @example // Special names appear unquoted and unescaped: "@eventTypes" * @example // Computed Symbol properties appear as "[Symbol.iterator]" */ name: string; type: ApiType; /** @example 10 */ default?: string; } export interface ApiClassField extends ApiPropertyLike, ApiWithInheritance, ApiWithStatic, ApiWithPrivacy, ApiWithUnusedSource { kind: "field"; /** * Whether the property is read-only. * * @default false */ readonly?: true; /** * Getter type if any. * * This property will only be set if it differs from `type` property in order * to keep documentation UI cleaner, and api.json smaller. * * If the property is read-only, only the `type` property will be set. * * > Not present in vanilla custom-elements-manifest. * * @default undefined */ getterType?: ApiType; } export interface ApiWithStatic { /** @default false */ static?: true; } /** Additional metadata for fields on custom elements. */ export interface ApiCustomElementField extends ApiClassField { /** * The corresponding attribute name if there is one. * * If this property is defined, the attribute must be listed in the classes' * `attributes` array. * * @example "initial-counter" */ attribute?: string; /** * If the property reflects to an attribute. * * If this is true, the `attribute` property must be defined. * * @default false */ reflects?: true; /** * For some properties, we show them as read-only in the docs and in the * types but don't actually enforce read-only at runtime. * * Such properties are represented in the manifest with both `readonly` and * `docsOnlyReadonly` set to true. * * Runtime read-only properties are represented with only `readonly` true. * * > Not present in vanilla custom-elements-manifest. * * @deprecated fuse regular .readonly field instead * @default false */ docsOnlyReadonly?: true; } export interface ApiClassMethod extends ApiFunctionLike, ApiWithInheritance, ApiWithStatic, ApiWithPrivacy, ApiWithUnusedSource { kind: "method"; /** @default false */ static?: true; /** * > Not present in vanilla custom-elements-manifest. * * @deprecated * If documentation UI shows a table with parameters and the return type, then * displaying the signature is redundant. * Still, if needed, you can use printSignature() util from * `@arcgis/api-extractor`. * @example "(options?: PopupViewOpenPopupOptions): Promise" */ signature: string; } /** > Not present in vanilla custom-elements-manifest. */ export interface ApiClassConstructor extends Omit, ApiWithInheritance, ApiWithPrivacy { kind: "constructor"; } /** > Not present in vanilla custom-elements-manifest. */ export interface ApiClassCallSignature extends Omit, ApiWithInheritance, ApiWithPrivacy { kind: "call-signature"; } /** * A description of a class mixin. * * @see [WebGIS - Mixins](https://webgis.esri.com/sdk/contributing/core/core/mixins) */ export interface ApiMixinDeclaration extends Omit, ApiObjectLikeDeclaration, ApiWithEvents { kind: "mixin"; /** The mixins that this mixin uses, if any. */ mixins?: ApiReferenceWithTypeArguments[]; /** * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ return?: ApiFunctionLikeReturn; } /** * A class mixin that also adds custom element related properties. * * @deprecated * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility * with custom-elements-manifest. */ export interface ApiCustomElementMixinDeclaration extends Omit, Omit {} export interface ApiVariableDeclaration extends ApiPropertyLike, ApiWithUnusedSource { kind: "variable"; } export interface ApiFunctionDeclaration extends ApiFunctionLike, ApiWithUnusedSource { kind: "function"; } export interface ApiParameter extends ApiPropertyLike { /** * Whether the parameter had `?`. If there is a default value, that takes * precedence over `optional` flag. * * @default false */ optional?: true; /** * Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter. * Undefined implies single parameter. * * @default false */ rest?: true; } export interface ApiFunctionLike extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSummary, ApiWithTypeParameters { /** * @example "increment" * @example // Special names appear unquoted and unescaped: "@eventTypes" * @example // Computed Symbol properties appear as "[Symbol.iterator]" */ name: string; /** @default [] */ parameters?: ApiParameter[]; return: ApiFunctionLikeReturn; } export interface ApiFunctionLikeReturn extends ApiWithDescription, ApiWithUnusedSummary { type: ApiType; } export interface ApiDemo extends ApiWithUnusedSource { /** * Relative URL of the demo if it's published with the package. Absolute URL * if it's hosted. */ url: string; description: NonNullable; }