@salesforcedevs/docs-components 1.3.171-alpha.0 → 1.3.171-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.171-alpha.0",
3
+ "version": "1.3.171-alpha.2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -2,7 +2,7 @@ import { LightningElement, api, track } from "lwc";
2
2
  import { noCase } from "no-case";
3
3
  import { sentenceCase } from "sentence-case";
4
4
  import qs from "query-string";
5
- import { AmfModelParser } from "docUtils/amf";
5
+ import { AmfModelParser } from "./utils";
6
6
  import { normalizeBoolean } from "dxUtils/normalizers";
7
7
  import { CoveoAnalyticsClient } from "coveo.analytics";
8
8
  import type {
@@ -30,26 +30,18 @@ import { restoreScroll } from "dx/scrollManager";
30
30
  import { DocPhaseInfo } from "typings/custom";
31
31
  import { oldVersionDocInfo } from "docUtils/utils";
32
32
 
33
- type NavigationItem = {
34
- label: string;
35
- name: string;
36
- isExpanded: boolean;
37
- children: ParsedMarkdownTopic[];
38
- isChildrenLoading: boolean;
39
- };
40
-
41
33
  export default class AmfReference extends LightningElement {
42
- @api breadcrumbs: string | null = null;
34
+ @api breadcrumbs?: string | null | undefined = null;
43
35
  @api sidebarHeader!: string;
44
36
  @api coveoOrganizationId!: string;
45
37
  @api coveoPublicAccessToken!: string;
46
38
  @api coveoAnalyticsToken!: string;
47
39
  @api coveoAdvancedQueryConfig!: string;
48
40
  @api coveoSearchHub!: string;
49
- @api useOldSidebar: boolean = false;
41
+ @api useOldSidebar?: boolean = false;
50
42
  @api tocTitle?: string;
51
43
  @api tocOptions?: string;
52
- @track navigation = [] as NavigationItem[];
44
+ @track navigation = [];
53
45
  @track versions: Array<ReferenceVersion> = [];
54
46
  @track showVersionBanner = false;
55
47
 
@@ -133,8 +125,8 @@ export default class AmfReference extends LightningElement {
133
125
  }
134
126
 
135
127
  @api
136
- get docPhaseInfo(): string | null {
137
- return this.selectedReferenceDocPhase || null;
128
+ get docPhaseInfo() {
129
+ return this.selectedReferenceDocPhase;
138
130
  }
139
131
 
140
132
  set docPhaseInfo(value: string) {
@@ -159,12 +151,12 @@ export default class AmfReference extends LightningElement {
159
151
  protected _referenceSetConfig!: ReferenceSetConfig;
160
152
  protected _currentReferenceId = "";
161
153
 
162
- protected parentReferenceUrls = [] as string[];
154
+ protected parentReferenceUrls = [];
163
155
  protected amfMap: Record<string, AmfModelRecord> = {};
164
- protected amfFetchPromiseMap = {} as any;
156
+ protected amfFetchPromiseMap = {};
165
157
  protected metadata: { [key: string]: AmfMetadataTopic } = {};
166
158
  protected selectedTopic?: AmfMetaTopicType = undefined;
167
- protected selectedSidebarValue: string | undefined = undefined;
159
+ protected selectedSidebarValue = undefined;
168
160
 
169
161
  protected selectedVersion: ReferenceVersion | null = null;
170
162
 
@@ -355,13 +347,13 @@ export default class AmfReference extends LightningElement {
355
347
  /**
356
348
  * Returns the selected version or the first available version.
357
349
  */
358
- private getSelectedVersion(): ReferenceVersion | null {
350
+ private getSelectedVersion(): ReferenceVersion {
359
351
  const versions = this._referenceSetConfig?.versions || [];
360
352
  const selectedVersion = versions.find(
361
353
  (v: ReferenceVersion) => v.selected
362
354
  );
363
355
  // return a selected version if there is one, else return the first one.
364
- return selectedVersion || (versions.length && versions[0]) || null;
356
+ return selectedVersion || (versions.length && versions[0]);
365
357
  }
366
358
 
367
359
  private updateAmfConfigInView(): void {
@@ -375,11 +367,9 @@ export default class AmfReference extends LightningElement {
375
367
  }
376
368
  }
377
369
 
378
- private async fetchAmf(
379
- amfConfig: AmfConfig
380
- ): Promise<AmfModel | AmfModel[]> {
370
+ private async fetchAmf(amfConfig): Promise<AmfModel | AmfModel[]> {
381
371
  const { amf } = amfConfig;
382
- const response = await fetch(amf!, {
372
+ const response = await fetch(amf, {
383
373
  headers: {
384
374
  "Cache-Control": `max-age=86400`
385
375
  }
@@ -398,7 +388,7 @@ export default class AmfReference extends LightningElement {
398
388
  /**
399
389
  * Returns whether given url is parent reference path like ../example-project/references/reference-id
400
390
  */
401
- private isParentReferencePath(urlPath?: string | null): boolean {
391
+ private isParentReferencePath(urlPath: string): boolean {
402
392
  if (!urlPath) {
403
393
  return false;
404
394
  }
@@ -429,9 +419,9 @@ export default class AmfReference extends LightningElement {
429
419
  * Populates reference Items from amfConfigList and assigns it to navigation for sidebar
430
420
  */
431
421
  private populateReferenceItems(): void {
432
- const navAmfOrder = [] as NavigationItem[];
422
+ const navAmfOrder = [];
433
423
  for (const [index, amfConfig] of this._amfConfigList.entries()) {
434
- let navItemChildren = [] as ParsedMarkdownTopic[];
424
+ let navItemChildren = [];
435
425
  let isChildrenLoading = false;
436
426
  if (amfConfig.referenceType !== REFERENCE_TYPES.markdown) {
437
427
  if (amfConfig.isSelected) {
@@ -451,10 +441,10 @@ export default class AmfReference extends LightningElement {
451
441
  // check whether we should expand all the child nodes, this is required for Coveo to crawl.
452
442
  if (isExpandChildrenEnabled) {
453
443
  this.expandChildrenForMarkdownReferences(
454
- amfConfig.topic!.children
444
+ amfConfig.topic.children
455
445
  );
456
446
  }
457
- navItemChildren = amfConfig.topic!.children;
447
+ navItemChildren = amfConfig.topic.children;
458
448
  }
459
449
  // store nav items for each spec in order
460
450
  navAmfOrder[index] = {
@@ -475,9 +465,7 @@ export default class AmfReference extends LightningElement {
475
465
  * Returns a boolean indicating whether the children should be expanded or not.
476
466
  */
477
467
  private isExpandChildrenEnabled(referenceId: string): boolean {
478
- return (
479
- !!this.expandChildren && this._currentReferenceId === referenceId
480
- );
468
+ return this.expandChildren && this._currentReferenceId === referenceId;
481
469
  }
482
470
 
483
471
  /**
@@ -521,12 +509,12 @@ export default class AmfReference extends LightningElement {
521
509
  referenceId: string,
522
510
  items: ParsedTopicModel[]
523
511
  ): NavItem[] {
524
- const methodList = [] as NavItem[];
512
+ const methodList = [];
525
513
 
526
514
  items.forEach((item) => {
527
515
  item.methods?.forEach((method) => {
528
516
  const title =
529
- this.getTitleForLabel(method.label!) || method.method;
517
+ this.getTitleForLabel(method.label) || method.method;
530
518
  const meta = this.addToMetadata(
531
519
  parentReferencePath,
532
520
  referenceId,
@@ -574,7 +562,7 @@ export default class AmfReference extends LightningElement {
574
562
  const parentReferencePath = amfConfig.href;
575
563
  const model = this.amfMap[referenceId].parser.parsedModel;
576
564
 
577
- const children: any[] = [];
565
+ const children = [];
578
566
  const expandChildren = this.isExpandChildrenEnabled(referenceId);
579
567
 
580
568
  NAVIGATION_ITEMS.forEach(
@@ -601,8 +589,8 @@ export default class AmfReference extends LightningElement {
601
589
  }
602
590
  case "endpoint":
603
591
  if (
604
- model[childrenPropertyName!] &&
605
- model[childrenPropertyName!].length
592
+ model[childrenPropertyName] &&
593
+ model[childrenPropertyName].length
606
594
  ) {
607
595
  const amfTopicId = this.getFormattedIdentifier(
608
596
  referenceId,
@@ -611,7 +599,7 @@ export default class AmfReference extends LightningElement {
611
599
  const childTopics = this.assignEndpointNavItems(
612
600
  parentReferencePath,
613
601
  referenceId,
614
- model[childrenPropertyName!]
602
+ model[childrenPropertyName]
615
603
  );
616
604
  children.push({
617
605
  label,
@@ -626,25 +614,23 @@ export default class AmfReference extends LightningElement {
626
614
  break;
627
615
  case "security":
628
616
  case "type":
629
- if (model[childrenPropertyName!]?.length) {
617
+ if (model[childrenPropertyName]?.length) {
630
618
  // Sorting the types alphabetically
631
- model[childrenPropertyName!].sort(
632
- (typeA: any, typeB: any) => {
633
- const typeALbl = typeA.label.toLowerCase();
634
- const typeBLbl = typeB.label.toLowerCase();
635
- return typeALbl < typeBLbl
636
- ? -1
637
- : typeALbl > typeBLbl
638
- ? 1
639
- : 0;
640
- }
641
- );
619
+ model[childrenPropertyName].sort((typeA, typeB) => {
620
+ const typeALbl = typeA.label.toLowerCase();
621
+ const typeBLbl = typeB.label.toLowerCase();
622
+ return typeALbl < typeBLbl
623
+ ? -1
624
+ : typeALbl > typeBLbl
625
+ ? 1
626
+ : 0;
627
+ });
642
628
  }
643
629
  // eslint-disable-next-line no-fallthrough
644
630
  default:
645
631
  if (
646
- model[childrenPropertyName!] &&
647
- model[childrenPropertyName!].length
632
+ model[childrenPropertyName] &&
633
+ model[childrenPropertyName].length
648
634
  ) {
649
635
  const amfTopicId = this.getFormattedIdentifier(
650
636
  referenceId,
@@ -657,8 +643,8 @@ export default class AmfReference extends LightningElement {
657
643
  this.metadata[amfTopicId]?.meta
658
644
  ),
659
645
  isExpanded: expandChildren,
660
- children: model[childrenPropertyName!].map(
661
- (topic: any) => {
646
+ children: model[childrenPropertyName].map(
647
+ (topic) => {
662
648
  const meta = this.addToMetadata(
663
649
  parentReferencePath,
664
650
  referenceId,
@@ -695,18 +681,12 @@ export default class AmfReference extends LightningElement {
695
681
  type: string,
696
682
  topic: { id: string; domId: string },
697
683
  navTitle: string
698
- ): string {
699
- const config = URL_CONFIG[type as keyof typeof URL_CONFIG];
700
- const urlIdentifer = config.urlIdentifer;
701
- let prefix = null;
702
- if ("prefix" in config) {
703
- prefix = config.prefix;
704
- }
684
+ ): string | undefined {
685
+ const { urlIdentifer, prefix } = URL_CONFIG[type];
705
686
 
706
687
  // encodeURI to avoid special characters in the URL meta.
707
688
  const identifier =
708
- urlIdentifer in topic &&
709
- this.encodeIdentifier(topic[urlIdentifer as keyof typeof topic]);
689
+ topic[urlIdentifer] && this.encodeIdentifier(topic[urlIdentifer]);
710
690
  let meta;
711
691
  // Assuming that there will be an identifier always
712
692
  if (identifier) {
@@ -722,7 +702,7 @@ export default class AmfReference extends LightningElement {
722
702
  navTitle
723
703
  };
724
704
  }
725
- return meta!;
705
+ return meta;
726
706
  }
727
707
 
728
708
  /**
@@ -733,7 +713,7 @@ export default class AmfReference extends LightningElement {
733
713
  (metadata: AmfMetadataTopic) => {
734
714
  return routeMeta.meta === metadata.meta;
735
715
  }
736
- )!;
716
+ );
737
717
  }
738
718
 
739
719
  /**
@@ -747,7 +727,7 @@ export default class AmfReference extends LightningElement {
747
727
  return Object.values(this.metadata).find(
748
728
  (metadata: AmfMetadataTopic) =>
749
729
  referenceId === metadata.referenceId && amfId === metadata.amfId
750
- )!;
730
+ );
751
731
  }
752
732
 
753
733
  /**
@@ -762,7 +742,7 @@ export default class AmfReference extends LightningElement {
762
742
  (metadata: AmfMetadataTopic) =>
763
743
  referenceId === metadata.referenceId &&
764
744
  identifier === metadata.identifier
765
- )!;
745
+ );
766
746
  }
767
747
 
768
748
  /**
@@ -776,7 +756,7 @@ export default class AmfReference extends LightningElement {
776
756
  return Object.values(this.metadata).find(
777
757
  (metadata: AmfMetadataTopic) =>
778
758
  referenceId === metadata.referenceId && type === metadata.type
779
- )!;
759
+ );
780
760
  }
781
761
 
782
762
  /**
@@ -853,8 +833,9 @@ export default class AmfReference extends LightningElement {
853
833
  this._currentReferenceId
854
834
  );
855
835
  if (specBasedReference) {
856
- const currentMeta: RouteMeta | undefined =
857
- this.getReferenceMetaInfo(window.location.href);
836
+ const currentMeta: RouteMeta | null = this.getReferenceMetaInfo(
837
+ window.location.href
838
+ );
858
839
  const metadata =
859
840
  currentMeta && this.getMetadataByUrlQuery(currentMeta);
860
841
  if (metadata) {
@@ -890,7 +871,7 @@ export default class AmfReference extends LightningElement {
890
871
  this._currentReferenceId
891
872
  );
892
873
  if (specBasedReference) {
893
- const { meta } = this.selectedTopic!;
874
+ const { meta } = this.selectedTopic;
894
875
  const metadata = this.metadata[meta];
895
876
  if (metadata) {
896
877
  const {
@@ -1007,7 +988,7 @@ export default class AmfReference extends LightningElement {
1007
988
  * 1. If the url is encoded already
1008
989
  * 2. If the url is decoded
1009
990
  */
1010
- getUrlEncoded(url: string): string {
991
+ getUrlEncoded(url: string) {
1011
992
  // if url matches, then return the encoded url.
1012
993
  if (decodeURIComponent(url) === url) {
1013
994
  return encodeURIComponent(url);
@@ -1023,7 +1004,7 @@ export default class AmfReference extends LightningElement {
1023
1004
  * For spec based references gets meta parm from url and then topicId & type from meta
1024
1005
  * For markdown based references gets topicId as last html path in the name, meta & type will be empty
1025
1006
  */
1026
- getReferenceMetaInfo(referenceUrl: string | null): RouteMeta | undefined {
1007
+ getReferenceMetaInfo(referenceUrl: string): RouteMeta | undefined {
1027
1008
  let metaReferenceInfo;
1028
1009
  if (referenceUrl) {
1029
1010
  const referenceId = this.getReferenceIdFromUrl(referenceUrl);
@@ -1065,10 +1046,10 @@ export default class AmfReference extends LightningElement {
1065
1046
  let topicTitle = "";
1066
1047
  for (let i = 0; i < topics.length; i++) {
1067
1048
  const topic = topics[i];
1068
- const meta = this.getMarkdownReferenceMeta(topic.link!.href);
1049
+ const meta = this.getMarkdownReferenceMeta(topic.link.href);
1069
1050
  const childTopics = topic.children;
1070
1051
  if (meta === topicMeta) {
1071
- referenceUrl = topic.link!.href;
1052
+ referenceUrl = topic.link.href;
1072
1053
  topicTitle = topic.label;
1073
1054
  } else if (childTopics && childTopics.length) {
1074
1055
  const referenceDetails = this.getReferenceDetailsInGivenTopics(
@@ -1179,7 +1160,7 @@ export default class AmfReference extends LightningElement {
1179
1160
  }
1180
1161
  });
1181
1162
  } else {
1182
- let invalidTopicReferenceUrl: string | null = "";
1163
+ let invalidTopicReferenceUrl = "";
1183
1164
  if (topicId) {
1184
1165
  const referenceDetails = this.getRefDetailsForGivenTopicMeta(
1185
1166
  referenceId,
@@ -1215,7 +1196,7 @@ export default class AmfReference extends LightningElement {
1215
1196
  * set selected sidebar value as a pathname
1216
1197
  */
1217
1198
 
1218
- private loadMarkdownBasedReference(referenceUrl?: string | null): void {
1199
+ private loadMarkdownBasedReference(referenceUrl?: string): void {
1219
1200
  let referenceId = "";
1220
1201
  const currentUrl = window.location.href;
1221
1202
  if (this.isProjectRootPath()) {
@@ -1229,7 +1210,7 @@ export default class AmfReference extends LightningElement {
1229
1210
  * CASE2: This case is to navigate to respective reference when the user clicked on root item
1230
1211
  * Ex: .../references/markdown-ref should navigate to first topic.
1231
1212
  */
1232
- referenceId = this.getReferenceIdFromUrl(referenceUrl!);
1213
+ referenceId = this.getReferenceIdFromUrl(referenceUrl);
1233
1214
  } else if (this.isParentReferencePath(currentUrl)) {
1234
1215
  /**
1235
1216
  * CASE3: This case is to navigate to respective reference when the user entered url with reference id
@@ -1258,9 +1239,9 @@ export default class AmfReference extends LightningElement {
1258
1239
  const amfConfig = this.getAmfConfigWithId(referenceId);
1259
1240
  let redirectReferenceUrl = "";
1260
1241
  if (amfConfig) {
1261
- const childrenItems = amfConfig.topic!.children;
1242
+ const childrenItems = amfConfig.topic.children;
1262
1243
  if (childrenItems.length > 0) {
1263
- redirectReferenceUrl = childrenItems[0].link!.href;
1244
+ redirectReferenceUrl = childrenItems[0].link.href;
1264
1245
  }
1265
1246
  }
1266
1247
  if (redirectReferenceUrl) {
@@ -1394,7 +1375,7 @@ export default class AmfReference extends LightningElement {
1394
1375
 
1395
1376
  handleSelectedItem(): void {
1396
1377
  // update topic view
1397
- const { referenceId, amfId, type } = this.selectedTopic!;
1378
+ const { referenceId, amfId, type } = this.selectedTopic;
1398
1379
 
1399
1380
  // This updates the component in the content section.
1400
1381
  this.topicModel = {
@@ -1,9 +1,4 @@
1
- // @ts-nocheck not going to check this file because it deals almost entirely with the AmfHelperMixin, which is terrible and not worth messing with. We should just upgrade our LWC version instead.
2
- import {
3
- AmfHelperMixin,
4
- EndPoint,
5
- Operation
6
- } from "@api-components/amf-helper-mixin";
1
+ import { AmfHelperMixin } from "@api-components/amf-helper-mixin";
7
2
  import { normalizeDomId } from "dxUtils/normalizers";
8
3
 
9
4
  const ID_PROPERTY = "@id";
@@ -12,7 +7,7 @@ const TYPE_PROPERTY = "@type";
12
7
  export class AmfModelParser extends AmfHelperMixin(Object) {
13
8
  _parsedModel = null;
14
9
 
15
- constructor(api: any) {
10
+ constructor(api) {
16
11
  super();
17
12
  if (api) {
18
13
  this.amf = Array.isArray(api) ? api[0] : api;
@@ -522,7 +517,7 @@ export class AmfModelParser extends AmfHelperMixin(Object) {
522
517
  * @param {string} selected Currently selected `@id`.
523
518
  * @return {any|undefined} Model definition for an endpoint fragment.
524
519
  */
525
- computeEndpointApiModel(model, selectedId): EndPoint {
520
+ computeEndpointApiModel(model, selectedId) {
526
521
  const webApi = this._computeApi(model);
527
522
  return this._computeEndpointModel(webApi, selectedId);
528
523
  }
@@ -534,7 +529,7 @@ export class AmfModelParser extends AmfHelperMixin(Object) {
534
529
  * @param {string} selected Currently selected `@id`.
535
530
  * @return {any|undefined} Model definition for an endpoint fragment.
536
531
  */
537
- computeMethodApiModel(model, selected): Operation | undefined {
532
+ computeMethodApiModel(model, selected) {
538
533
  const webApi = this._computeApi(model);
539
534
  return this._computeMethodModel(webApi, selected);
540
535
  }
@@ -546,7 +541,7 @@ export class AmfModelParser extends AmfHelperMixin(Object) {
546
541
  * @param {string} selected Currently selected `@id`.
547
542
  * @return {any|undefined} Model definition for an endpoint fragment.
548
543
  */
549
- computeEndpointApiMethodModel(model, selected): EndPoint | undefined {
544
+ computeEndpointApiMethodModel(model, selected) {
550
545
  const webApi = this._computeApi(model);
551
546
  return this._computeMethodEndpoint(webApi, selected);
552
547
  }
@@ -8,15 +8,14 @@ import {
8
8
  createTypeElement
9
9
  } from "./utils";
10
10
  import type { TopicModel } from "./types";
11
- import { Json } from "typings/custom";
12
11
 
13
12
  export default class AmfTopic extends LightningElement {
14
- private _model: TopicModel | undefined;
15
- private amf: Json;
16
- private type: string | undefined;
13
+ private _model;
14
+ private amf;
15
+ private type;
17
16
 
18
17
  @api
19
- get model(): TopicModel | undefined {
18
+ get model(): TopicModel {
20
19
  return this._model;
21
20
  }
22
21
 
@@ -42,11 +41,7 @@ export default class AmfTopic extends LightningElement {
42
41
  }
43
42
 
44
43
  update(): void {
45
- if (!this.model) {
46
- throw new Error("Amf TopicModel undefined when trying to update");
47
- }
48
-
49
- const container = this.template.querySelector("div.topic-container")!;
44
+ const container = this.template.querySelector("div.topic-container");
50
45
  const { id } = this.model;
51
46
  const type = this.type;
52
47
  const amf = this.amf;
@@ -84,7 +79,7 @@ export default class AmfTopic extends LightningElement {
84
79
  if (container.firstChild) {
85
80
  container.firstChild.remove();
86
81
  }
87
- container.appendChild(element as Node);
82
+ container.appendChild(element);
88
83
  }
89
84
  }
90
85
 
@@ -94,6 +89,6 @@ export default class AmfTopic extends LightningElement {
94
89
  * @param value JSON Serializable object to clone.
95
90
  * @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.)
96
91
  */
97
- function clone(value: any): any {
92
+ function clone(value): object {
98
93
  return JSON.parse(JSON.stringify(value));
99
94
  }
@@ -1,11 +1,4 @@
1
1
  import { Json } from "typings/custom";
2
- import { AmfModelParser } from "docUtils/amf";
3
- import {
4
- DomainElement,
5
- EndPoint,
6
- Operation,
7
- Shape
8
- } from "@api-components/amf-helper-mixin";
9
2
 
10
3
  export type ApiSummaryElement = HTMLElement & {
11
4
  amf: Json;
@@ -18,39 +11,44 @@ export type ApiEndpointElement = HTMLElement & {
18
11
  inlineMethods: boolean;
19
12
  noNavigation: boolean;
20
13
  selected: string;
21
- endpoint: EndPoint;
14
+ endpoint: Json;
22
15
  noTryIt: boolean;
23
16
  };
24
17
 
25
18
  export type ApiMethodElement = HTMLElement & {
26
19
  amf: Json;
27
20
  noNavigation: boolean;
28
- endpoint: EndPoint | undefined;
29
- method: Operation | undefined;
21
+ endpoint: Json;
22
+ method: Json;
30
23
  noTryIt: boolean;
31
24
  };
32
25
 
33
26
  export type ApiSecurityElement = HTMLElement & {
34
27
  amf: Json;
35
- security: DomainElement | undefined;
28
+ security: Json;
36
29
  };
37
30
 
38
31
  export type ApiTypeElement = HTMLElement & {
39
32
  amf: Json;
40
- type?: Shape;
33
+ type: Json;
41
34
  mediaTypes: Json;
42
35
  };
43
36
 
44
37
  export type ApiDocElement = HTMLElement & {
45
38
  amf: Json;
46
- shape: DomainElement | undefined;
39
+ shape: Json;
47
40
  };
48
41
 
49
42
  export type AmfModel = Json;
50
43
 
44
+ export interface AmfParser {
45
+ parse(): void;
46
+ parsedModel: any;
47
+ }
48
+
51
49
  export interface TopicModel {
52
50
  id: string;
53
51
  type: string;
54
52
  amf: AmfModel;
55
- parser: AmfModelParser;
53
+ parser: AmfParser;
56
54
  }
@@ -1,9 +1,3 @@
1
- import {
2
- DomainElement,
3
- EndPoint,
4
- Operation,
5
- Shape
6
- } from "@api-components/amf-helper-mixin";
7
1
  import type {
8
2
  ApiDocElement,
9
3
  ApiEndpointElement,
@@ -43,7 +37,7 @@ export function createSummaryElement(amf: Json): HTMLElement {
43
37
  */
44
38
  export function createEndpointElement(
45
39
  amf: Json,
46
- endpointModel: EndPoint,
40
+ endpointModel: Json,
47
41
  selected: string
48
42
  ): HTMLElement {
49
43
  const el: ApiEndpointElement = document.createElement(
@@ -63,8 +57,8 @@ export function createEndpointElement(
63
57
  */
64
58
  export function createMethodElement(
65
59
  amf: Json,
66
- endpointMethodModel: EndPoint | undefined,
67
- methodModel: Operation | undefined
60
+ endpointMethodModel: Json,
61
+ methodModel: Json
68
62
  ): HTMLElement {
69
63
  const el: ApiMethodElement = document.createElement(
70
64
  "api-method-documentation"
@@ -85,7 +79,7 @@ export function createMethodElement(
85
79
  */
86
80
  export function createSecurityElement(
87
81
  amf: Json,
88
- securityModel: DomainElement | undefined
82
+ securityModel: Json
89
83
  ): HTMLElement {
90
84
  const el: ApiSecurityElement = document.createElement(
91
85
  "api-security-documentation"
@@ -104,7 +98,7 @@ export function createSecurityElement(
104
98
  */
105
99
  export function createTypeElement(
106
100
  amf: Json,
107
- typeModel: Shape | undefined,
101
+ typeModel: Json,
108
102
  mediaTypes: Json
109
103
  ): HTMLElement {
110
104
  const el: ApiTypeElement = document.createElement(
@@ -125,7 +119,7 @@ export function createTypeElement(
125
119
  */
126
120
  export function createDocumentationElement(
127
121
  amf: Json,
128
- docsModel: DomainElement | undefined
122
+ docsModel: Json
129
123
  ): HTMLElement {
130
124
  const el: ApiDocElement = document.createElement(
131
125
  "api-documentation-document"
@@ -106,7 +106,7 @@ h6 {
106
106
  }
107
107
 
108
108
  img {
109
- image-rendering: -webkit-optimize-contrast;
109
+ image-rendering: optimize-contrast;
110
110
  }
111
111
 
112
112
  p,