Skip to content

Commit c88104b

Browse files
authored
refactor: upgrading to the latest ARC standards (#13)
* refactor: upgrading to the ARC standard fixes #12 * chore: updating dependencies
1 parent 84b891a commit c88104b

23 files changed

+6002
-7488
lines changed

.eslintignore

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

.eslintrc.js

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

.npmignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
coverage/
22
test/
33
demo/
4-
gen-tsd.json
54
CONTRIBUTING.md
65
.travis.yml
7-
index.html
86
polymer.json
97
karma.*
10-
husky.*
11-
commitlint.*
128
.*
13-
*.config.*
14-
prettier.config.js
15-
dist/

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: node_js
22
node_js: stable
3-
sudo: required
43
addons:
54
chrome: stable
65
script:

api-body-document.d.ts

Lines changed: 2 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -1,250 +1,7 @@
1-
/**
2-
* DO NOT EDIT
3-
*
4-
* This file was automatically generated by
5-
* https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
6-
*
7-
* To modify these typings, edit the source file(s):
8-
* api-body-document.js
9-
*/
10-
11-
12-
// tslint:disable:variable-name Describing an API that's defined elsewhere.
13-
// tslint:disable:no-any describes the API as best we are able today
14-
15-
import {LitElement, html, css} from 'lit-element';
16-
17-
import {AmfHelperMixin} from '@api-components/amf-helper-mixin/amf-helper-mixin.js';
18-
19-
declare namespace ApiElements {
20-
21-
/**
22-
* `api-body-document`
23-
*
24-
* A component to render HTTP method body documentation based on AMF model.
25-
*/
26-
class ApiBodyDocument extends
27-
AmfHelperMixin(
28-
Object) {
29-
30-
/**
31-
* List of discovered media types in the `body`.
32-
*/
33-
_mediaTypes: Array<object|null>|null;
34-
35-
/**
36-
* A body model for selected media type.
37-
* Computed automatically when selection change.
38-
*/
39-
_selectedBody: object|null|undefined;
40-
41-
/**
42-
* Computed AMF schema object for the body.
43-
*/
44-
_selectedSchema: object|null|undefined;
45-
46-
/**
47-
* Currently selected media type.
48-
* It is an index of a media type in `mediaTypes` array.
49-
* It is set to `0` each time the body changes.
50-
*/
51-
selected: number|null|undefined;
52-
53-
/**
54-
* AMF model for body as a `http://raml.org/vocabularies/http#payload`
55-
* type.
56-
*/
57-
body: Array<object|null>|null;
58-
59-
/**
60-
* `raml-aware` scope property to use.
61-
*/
62-
aware: string|null|undefined;
63-
64-
/**
65-
* Set to true to open the body view.
66-
* Autormatically updated when the view is toggled from the UI.
67-
*/
68-
opened: boolean|null|undefined;
69-
70-
/**
71-
* Computed value. True when mediaTypes has more than one item.
72-
*/
73-
_renderMediaSelector: boolean|null|undefined;
74-
75-
/**
76-
* Selected body ID.
77-
* It is computed here and passed to the type document to render
78-
* examples.
79-
*/
80-
_selectedBodyId: string|null|undefined;
81-
82-
/**
83-
* Name of the selected media type.
84-
*/
85-
_selectedMediaType: string|null|undefined;
86-
87-
/**
88-
* True if selected body is a structured object
89-
*/
90-
_isObject: boolean|null|undefined;
91-
92-
/**
93-
* True if selected body is a schema (JSON, XML, ...) data
94-
*/
95-
_isSchema: boolean|null|undefined;
96-
97-
/**
98-
* Computed value, true if the body is of "any" type.
99-
*/
100-
_isAnyType: boolean|null|undefined;
101-
102-
/**
103-
* Name of the resource type if any.
104-
*/
105-
_typeName: string|null|undefined;
106-
107-
/**
108-
* Computed value, true if `typeName` is set.
109-
*/
110-
_hasTypeName: boolean|null|undefined;
111-
112-
/**
113-
* Body name, if defined
114-
*/
115-
_bodyName: string|null|undefined;
116-
117-
/**
118-
* Name of the resource type if any.
119-
*/
120-
_description: string|null|undefined;
121-
122-
/**
123-
* Set to render a mobile friendly view.
124-
*/
125-
narrow: boolean|null|undefined;
126-
127-
/**
128-
* Enables compatibility with Anypoint components.
129-
*/
130-
compatibility: boolean|null|undefined;
131-
132-
/**
133-
* Type of the header in the documentation section.
134-
* Should be in range of 1 to 6.
135-
*/
136-
headerLevel: number|null|undefined;
137-
138-
/**
139-
* When enabled it renders external types as links and dispatches
140-
* `api-navigation-selection-changed` when clicked.
141-
*/
142-
graph: boolean|null|undefined;
143-
_hasObjectExamples: boolean|null|undefined;
144-
145-
/**
146-
* Sets observable property that causes render action.
147-
*
148-
* @param prop Property name
149-
* @param value Value to set
150-
* @returns True when the property has been updated.
151-
*/
152-
_sop(prop: String|null, value: any|null): Boolean|null;
153-
_bodyChanged(): void;
154-
_selectedBodyChanged(value: any): void;
155-
156-
/**
157-
* Computes list of media types in the `body`
158-
*
159-
* @param body Current value of the body.
160-
*/
161-
_computeMediaTypes(body: any[]|null): Array<object|null>|null;
162-
163-
/**
164-
* Computes value for `renderMediaSelector` properety.
165-
*
166-
* @param types `mediaTypes` change record.
167-
*/
168-
_computeRenderMediaSelector(types: object|null): Boolean|null;
169-
170-
/**
171-
* Computes if `selected` equals current item index.
172-
*/
173-
_mediaTypeActive(selected: Number|null, index: Number|null): Boolean|null;
174-
175-
/**
176-
* Handler for media type type button click.
177-
* Sets `selected` property.
178-
*/
179-
_selectMediaType(e: ClickEvent|null): void;
180-
181-
/**
182-
* Computes value of `http://raml.org/vocabularies/http#schema` for body.
183-
*
184-
* @param selected Index of currently selected media type in
185-
* `mediaTypes` array
186-
* @param body List of body in request.
187-
*/
188-
_computeSelectedBody(selected: Number|null, body: Array<object|null>|null): object|null|undefined;
189-
_computeSelectedSchema(selectedBody: any): any;
190-
191-
/**
192-
* Computes value for `selectedMediaType` property.
193-
*
194-
* @param selected Currently selected media type index in the selector.
195-
* @param body List of bodies.
196-
* @returns Content type value.
197-
*/
198-
_computeSelectedMediaName(selected: Number|null, body: Array<object|null>|null): String|null;
199-
200-
/**
201-
* Handler for body value change. Computes basic view control properties.
202-
*
203-
* @param body Currently computed body.
204-
*/
205-
_selectedSchemaChanged(body: object|null): void;
206-
207-
/**
208-
* Computes a label for the section toggle buttons.
209-
*/
210-
_computeToggleActionLabel(opened: any): any;
211-
212-
/**
213-
* Computes class for the toggle's button icon.
214-
*/
215-
_computeToggleIconClass(opened: any): any;
216-
217-
/**
218-
* Toggles URI parameters view.
219-
* Use `pathOpened` property instead.
220-
*/
221-
toggle(): void;
222-
223-
/**
224-
* Computes `typeName` as a name of body in the AMF model.
225-
*
226-
* @param body Currently selected body.
227-
*/
228-
_computeTypeName(body: object|null): String|null|undefined;
229-
_apiChangedHandler(e: any): void;
230-
231-
/**
232-
* A template to render for "Any" AMF model.
233-
*/
234-
_anyTypeTemplate(): TemplateResult|null;
235-
236-
/**
237-
* A template to render for any AMF model\ that is different than "any".
238-
*/
239-
_typedTemplate(): TemplateResult|null;
240-
_mediaTypesTemplate(): any;
241-
render(): any;
242-
}
243-
}
1+
import { ApiBodyDocumentElement } from './src/ApiBodyDocumentElement';
2442

2453
declare global {
246-
2474
interface HTMLElementTagNameMap {
248-
"api-body-document": ApiElements.ApiBodyDocument;
5+
"api-body-document": ApiBodyDocumentElement;
2496
}
2507
}

0 commit comments

Comments
 (0)