import { CompilerContext } from '../context/index.ts'; import { ApiDocsTag } from '@arcgis/api-extractor/apiJson'; /** * To avoid having a dependency on Stencil, we inline Stencil types rather than * importing them. */ export interface JsonDocs { components: JsonDocsComponent[]; timestamp: string; compiler: { name: string; version: string; typescriptVersion: string; }; typeLibrary: Record; } interface JsonDocsComponent { filePath?: string; encapsulation: "none" | "scoped" | "shadow"; tag: string; readme: string; docs: string; docsTags: ApiDocsTag[]; overview?: string; usage: Record; props: JsonDocsProp[]; methods: JsonDocsMethod[]; events: JsonDocsEvent[]; listeners: never[]; styles: { name: string; docs: string; annotation: string; mode: string | undefined; }[]; slots: { name: string; docs: string; }[]; parts: { name: string; docs: string; }[]; dependents: string[]; dependencies: string[]; dependencyGraph: Record; deprecation?: string; } interface JsonDocsEvent { event: string; bubbles: boolean; cancelable: boolean; composed: boolean; complexType: ComplexType; docs: string; docsTags: ApiDocsTag[]; deprecation?: string; detail: string; } interface ComponentCompilerMethodComplexType { signature: string; parameters: { name: string; type: string; docs: string; }[]; references: ComponentCompilerTypeReferences; return: string; } type ComponentCompilerTypeReferences = Record; interface JsonDocsMethod { name: string; docs: string; docsTags: ApiDocsTag[]; deprecation?: string; signature: string; returns: { type: string; docs: string; }; parameters: ComponentCompilerMethodComplexType["parameters"]; complexType: ComponentCompilerMethodComplexType; } interface ComplexType { original: string; resolved: string; references: ComponentCompilerTypeReferences; } export interface JsonDocsProp { name: string; complexType?: ComplexType; type: string; mutable: boolean; attr?: string; reflectToAttr: boolean; docs: string; docsTags: ApiDocsTag[]; default?: string; deprecation?: string; values: { value?: string; type: string; }[]; optional: boolean; required: boolean; } /** * Create a stencil-compatible docs.json file describing the library components. * * While custom-elements-manifest is the most popular community standard and is * natively supported by Storybook and other tools, Esri has several internal * tools that expect the Stencil-style docs.json. * Since they are similar in content, generating a Stencil-compatible docs.json * will smooth the migration path. * * REFACTOR: drop support for stencil compatible docs.json at some point * * @remarks * To make it easier for people to diff the docs.json before and after migration * to Lit, we make sure that the order of properties matches what Stencil * generates: * https://github.com/ionic-team/stencil/blob/9f5f9cdd023b8c8dfb5417a1a970605ba724ae28/src/compiler/docs/generate-doc-data.ts#L98 */ export declare const generateStencilDocsJson: (context: CompilerContext) => JsonDocs; export {};