UNPKG

3.27 kBTypeScriptView Raw
1export interface JsonDocs {
2 components: JsonDocsComponent[];
3 timestamp: string;
4 compiler: {
5 name: string;
6 version: string;
7 typescriptVersion: string;
8 };
9}
10export interface JsonDocsComponent {
11 dirPath?: string;
12 fileName?: string;
13 filePath?: string;
14 readmePath?: string;
15 usagesDir?: string;
16 encapsulation: 'shadow' | 'scoped' | 'none';
17 tag: string;
18 readme: string;
19 docs: string;
20 docsTags: JsonDocsTag[];
21 /**
22 * The text from the class-level JSDoc for a Stencil component, if present.
23 */
24 overview?: string;
25 usage: JsonDocsUsage;
26 props: JsonDocsProp[];
27 methods: JsonDocsMethod[];
28 events: JsonDocsEvent[];
29 listeners: JsonDocsListener[];
30 styles: JsonDocsStyle[];
31 slots: JsonDocsSlot[];
32 parts: JsonDocsPart[];
33 dependents: string[];
34 dependencies: string[];
35 dependencyGraph: JsonDocsDependencyGraph;
36 deprecation?: string;
37}
38export interface JsonDocsDependencyGraph {
39 [tagName: string]: string[];
40}
41export interface JsonDocsTag {
42 name: string;
43 text?: string;
44}
45export interface JsonDocsValue {
46 value?: string;
47 type: string;
48}
49/**
50 * A mapping of file names to their contents.
51 *
52 * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
53 * given directory structure:
54 * ```
55 * src/components/my-component
56 * ├── my-component.tsx
57 * └── usage
58 * ├── bar.md
59 * └── foo.md
60 * ```
61 * an instance of this type would include the name of the markdown file, mapped to its contents:
62 * ```ts
63 * {
64 * 'bar': STRING_CONTENTS_OF_BAR.MD
65 * 'foo': STRING_CONTENTS_OF_FOO.MD
66 * }
67 * ```
68 */
69export interface JsonDocsUsage {
70 [key: string]: string;
71}
72export interface JsonDocsProp {
73 name: string;
74 type: string;
75 mutable: boolean;
76 /**
77 * The name of the attribute that is exposed to configure a compiled web component
78 */
79 attr?: string;
80 reflectToAttr: boolean;
81 docs: string;
82 docsTags: JsonDocsTag[];
83 default: string;
84 deprecation?: string;
85 values: JsonDocsValue[];
86 optional: boolean;
87 required: boolean;
88}
89export interface JsonDocsMethod {
90 name: string;
91 docs: string;
92 docsTags: JsonDocsTag[];
93 deprecation?: string;
94 signature: string;
95 returns: JsonDocsMethodReturn;
96 parameters: JsonDocMethodParameter[];
97}
98export interface JsonDocsMethodReturn {
99 type: string;
100 docs: string;
101}
102export interface JsonDocMethodParameter {
103 name: string;
104 type: string;
105 docs: string;
106}
107export interface JsonDocsEvent {
108 event: string;
109 bubbles: boolean;
110 cancelable: boolean;
111 composed: boolean;
112 docs: string;
113 docsTags: JsonDocsTag[];
114 deprecation?: string;
115 detail: string;
116}
117export interface JsonDocsStyle {
118 name: string;
119 docs: string;
120 annotation: string;
121}
122export interface JsonDocsListener {
123 event: string;
124 target?: string;
125 capture: boolean;
126 passive: boolean;
127}
128export interface JsonDocsSlot {
129 name: string;
130 docs: string;
131}
132export interface JsonDocsPart {
133 name: string;
134 docs: string;
135}
136export interface StyleDoc {
137 name: string;
138 docs: string;
139 annotation: 'prop';
140}