Skip to content

Commit d92b76d

Browse files
author
Martynas Žilinskas
authored
Hotfix: Types (#25)
1 parent 7e11fd4 commit d92b76d

30 files changed

+1106
-1581
lines changed

common/config/rush/npm-shrinkwrap.json

Lines changed: 212 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { Contracts, ExtractDto } from "ts-extractor";
2+
3+
export interface ApiItemReference {
4+
Id: string;
5+
Alias: string;
6+
}
7+
8+
export enum ApiItemKindsAdditional {
9+
Any = "any"
10+
}
11+
12+
export type SupportedApiItemKindType = Contracts.ApiItemKinds | ApiItemKindsAdditional;
13+
14+
export interface PluginHeading {
15+
Heading: string;
16+
ApiItemId: string;
17+
}
18+
19+
export interface PluginMember {
20+
Reference: ApiItemReference;
21+
PluginResult: PluginResult;
22+
}
23+
24+
export type GetItemPluginResultHandler = (reference: ApiItemReference) => PluginResult;
25+
export type IsPluginResultExistsHandler = (reference: ApiItemReference) => boolean;
26+
27+
export interface PluginOptions<TKind = Contracts.ApiItemDto> {
28+
Reference: ApiItemReference;
29+
ApiItem: TKind;
30+
ExtractedData: ExtractDto;
31+
GetItemPluginResult: GetItemPluginResultHandler;
32+
IsPluginResultExists: IsPluginResultExistsHandler;
33+
}
34+
35+
export interface PluginResultData {
36+
/**
37+
* All headings used in `Result` with ApiItemIds.
38+
*/
39+
Headings: PluginHeading[];
40+
/**
41+
* References that were used in rendering `Result`.
42+
*/
43+
UsedReferences: string[];
44+
/**
45+
* Plugin rendered result.
46+
*/
47+
Result: string[];
48+
Members: PluginMember[];
49+
}
50+
51+
export interface PluginResult<TKind = Contracts.ApiItemDto> extends PluginResultData {
52+
Reference: ApiItemReference;
53+
ApiItem: TKind;
54+
}
55+
56+
export interface Plugin<TKind = Contracts.ApiItemDto> {
57+
SupportedApiItemKinds(): SupportedApiItemKindType[];
58+
CheckApiItem(item: TKind): boolean;
59+
Render(options: PluginOptions<TKind>): PluginResult;
60+
}
61+
62+
export type MappedType = {[K in "a-b-c"]: number};
Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
# Table of contents
2+
3+
* [contracts][SourceFile-0]
4+
* Interfaces
5+
* [ApiItemReference][InterfaceDeclaration-0]
6+
* [PluginHeading][InterfaceDeclaration-1]
7+
* [PluginMember][InterfaceDeclaration-2]
8+
* [PluginOptions][InterfaceDeclaration-5]
9+
* [PluginResultData][InterfaceDeclaration-4]
10+
* [PluginResult][InterfaceDeclaration-3]
11+
* [Plugin][InterfaceDeclaration-6]
12+
* Types
13+
* [SupportedApiItemKindType][TypeAliasDeclaration-0]
14+
* [GetItemPluginResultHandler][TypeAliasDeclaration-1]
15+
* [IsPluginResultExistsHandler][TypeAliasDeclaration-2]
16+
* [MappedType][TypeAliasDeclaration-3]
17+
* Enums
18+
* [ApiItemKindsAdditional][EnumDeclaration-0]
19+
20+
# contracts
21+
22+
## Interfaces
23+
24+
### ApiItemReference
25+
26+
```typescript
27+
interface ApiItemReference {
28+
Id: string;
29+
Alias: string;
30+
}
31+
```
32+
33+
**Properties**
34+
35+
| Name | Type |
36+
| ----- | ------ |
37+
| Id | string |
38+
| Alias | string |
39+
40+
----------
41+
42+
### PluginHeading
43+
44+
```typescript
45+
interface PluginHeading {
46+
Heading: string;
47+
ApiItemId: string;
48+
}
49+
```
50+
51+
**Properties**
52+
53+
| Name | Type |
54+
| --------- | ------ |
55+
| Heading | string |
56+
| ApiItemId | string |
57+
58+
----------
59+
60+
### PluginMember
61+
62+
```typescript
63+
interface PluginMember {
64+
Reference: ApiItemReference;
65+
PluginResult: PluginResult<ApiItemDto>;
66+
}
67+
```
68+
69+
**Properties**
70+
71+
| Name | Type |
72+
| ------------ | ------------------------ |
73+
| Reference | ApiItemReference |
74+
| PluginResult | PluginResult<ApiItemDto> |
75+
76+
----------
77+
78+
### PluginOptions
79+
80+
```typescript
81+
interface PluginOptions<TKind = ApiItemDto> {
82+
Reference: ApiItemReference;
83+
ApiItem: TKind;
84+
ExtractedData: ExtractDto;
85+
GetItemPluginResult: GetItemPluginResultHandler;
86+
IsPluginResultExists: IsPluginResultExistsHandler;
87+
}
88+
```
89+
90+
**Type parameters**
91+
92+
| Name | Default type |
93+
| ----- | ------------ |
94+
| TKind | ApiItemDto |
95+
96+
**Properties**
97+
98+
| Name | Type |
99+
| -------------------- | --------------------------- |
100+
| Reference | ApiItemReference |
101+
| ApiItem | TKind |
102+
| ExtractedData | ExtractDto |
103+
| GetItemPluginResult | GetItemPluginResultHandler |
104+
| IsPluginResultExists | IsPluginResultExistsHandler |
105+
106+
----------
107+
108+
### PluginResultData
109+
110+
```typescript
111+
interface PluginResultData {
112+
Headings: PluginHeading[];
113+
UsedReferences: string[];
114+
Result: string[];
115+
Members: PluginMember[];
116+
}
117+
```
118+
119+
**Properties**
120+
121+
| Name | Type |
122+
| -------------- | --------------- |
123+
| Headings | PluginHeading[] |
124+
| UsedReferences | string[] |
125+
| Result | string[] |
126+
| Members | PluginMember[] |
127+
128+
----------
129+
130+
### PluginResult
131+
132+
```typescript
133+
interface PluginResult<TKind = ApiItemDto> extends PluginResultData {
134+
Reference: ApiItemReference;
135+
ApiItem: TKind;
136+
}
137+
```
138+
139+
**Type parameters**
140+
141+
| Name | Default type |
142+
| ----- | ------------ |
143+
| TKind | ApiItemDto |
144+
145+
**Extends**
146+
147+
PluginResultData
148+
149+
**Properties**
150+
151+
| Name | Type |
152+
| --------- | ---------------- |
153+
| Reference | ApiItemReference |
154+
| ApiItem | TKind |
155+
156+
----------
157+
158+
### Plugin
159+
160+
```typescript
161+
interface Plugin<TKind = ApiItemDto> {
162+
SupportedApiItemKinds(): SupportedApiItemKindType[];
163+
CheckApiItem(item: TKind): boolean;
164+
Render(options: PluginOptions<TKind>): PluginResult<ApiItemDto>;
165+
}
166+
```
167+
168+
**Type parameters**
169+
170+
| Name | Default type |
171+
| ----- | ------------ |
172+
| TKind | ApiItemDto |
173+
174+
#### Methods
175+
176+
```typescript
177+
SupportedApiItemKinds(): SupportedApiItemKindType[]
178+
```
179+
180+
**Return type**
181+
182+
SupportedApiItemKindType[]
183+
184+
```typescript
185+
CheckApiItem(item: TKind): boolean
186+
```
187+
188+
**Parameters**
189+
190+
| Name | Type |
191+
| ---- | ----- |
192+
| item | TKind |
193+
194+
**Return type**
195+
196+
boolean
197+
198+
```typescript
199+
Render(options: PluginOptions<TKind>): PluginResult<ApiItemDto>
200+
```
201+
202+
**Parameters**
203+
204+
| Name | Type |
205+
| ------- | -------------------- |
206+
| options | PluginOptions<TKind> |
207+
208+
**Return type**
209+
210+
PluginResult<ApiItemDto>
211+
212+
## Types
213+
214+
### SupportedApiItemKindType
215+
216+
```typescript
217+
type SupportedApiItemKindType = ApiItemKinds | Any;
218+
```
219+
220+
ApiItemKinds | Any
221+
222+
----------
223+
224+
### GetItemPluginResultHandler
225+
226+
```typescript
227+
type GetItemPluginResultHandler = (reference: ApiItemReference) => PluginResult<ApiItemDto>;
228+
```
229+
230+
(reference: ApiItemReference) => PluginResult<ApiItemDto>
231+
232+
----------
233+
234+
### IsPluginResultExistsHandler
235+
236+
```typescript
237+
type IsPluginResultExistsHandler = (reference: ApiItemReference) => boolean;
238+
```
239+
240+
(reference: ApiItemReference) => boolean
241+
242+
----------
243+
244+
### MappedType
245+
246+
```typescript
247+
type MappedType = {[K in "a-b-c"]: number};
248+
```
249+
250+
{[K in "a-b-c"]: number}
251+
252+
## Enums
253+
254+
### ApiItemKindsAdditional
255+
256+
257+
```typescript
258+
enum ApiItemKindsAdditional {
259+
Any = "any"
260+
}
261+
```
262+
263+
**Members**
264+
265+
| Name | Value |
266+
| ---- | ----- |
267+
| Any | "any" |
268+
269+
[SourceFile-0]: contracts.md#contracts
270+
[InterfaceDeclaration-0]: contracts.md#apiitemreference
271+
[InterfaceDeclaration-1]: contracts.md#pluginheading
272+
[InterfaceDeclaration-2]: contracts.md#pluginmember
273+
[InterfaceDeclaration-5]: contracts.md#pluginoptions
274+
[InterfaceDeclaration-4]: contracts.md#pluginresultdata
275+
[InterfaceDeclaration-3]: contracts.md#pluginresult
276+
[InterfaceDeclaration-6]: contracts.md#plugin
277+
[TypeAliasDeclaration-0]: contracts.md#supportedapiitemkindtype
278+
[TypeAliasDeclaration-1]: contracts.md#getitempluginresulthandler
279+
[TypeAliasDeclaration-2]: contracts.md#ispluginresultexistshandler
280+
[TypeAliasDeclaration-3]: contracts.md#mappedtype
281+
[EnumDeclaration-0]: contracts.md#apiitemkindsadditional

packages/ts-docs-gen/examples/simple/docs/api/exported-functions.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)