mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
chore: ts updates
This commit is contained in:
parent
2c836f8107
commit
8e8d9d8995
|
@ -27,6 +27,10 @@ import {
|
||||||
} from '../../services/';
|
} from '../../services/';
|
||||||
import { LazyTasksService } from '../../shared/components/LazyFor/lazy-for';
|
import { LazyTasksService } from '../../shared/components/LazyFor/lazy-for';
|
||||||
|
|
||||||
|
function getPreOptions() {
|
||||||
|
return Redoc._preOptions || {};
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redoc',
|
selector: 'redoc',
|
||||||
templateUrl: './redoc.html',
|
templateUrl: './redoc.html',
|
||||||
|
@ -49,14 +53,14 @@ export class Redoc extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
loadingProgress: number;
|
loadingProgress: number;
|
||||||
|
|
||||||
private element: HTMLElement;
|
|
||||||
private $parent: Element;
|
|
||||||
private $refElem: Element;
|
|
||||||
|
|
||||||
@Input() specUrl: string;
|
@Input() specUrl: string;
|
||||||
@HostBinding('class.loading') specLoading: boolean = false;
|
@HostBinding('class.loading') specLoading: boolean = false;
|
||||||
@HostBinding('class.loading-remove') specLoadingRemove: boolean = false;
|
@HostBinding('class.loading-remove') specLoadingRemove: boolean = false;
|
||||||
|
|
||||||
|
private element: HTMLElement;
|
||||||
|
private $parent: Element;
|
||||||
|
private $refElem: Element;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
specMgr: SpecManager,
|
specMgr: SpecManager,
|
||||||
optionsMgr: OptionsService,
|
optionsMgr: OptionsService,
|
||||||
|
@ -69,7 +73,7 @@ export class Redoc extends BaseComponent implements OnInit {
|
||||||
super(specMgr);
|
super(specMgr);
|
||||||
SchemaHelper.setSpecManager(specMgr);
|
SchemaHelper.setSpecManager(specMgr);
|
||||||
// merge options passed before init
|
// merge options passed before init
|
||||||
optionsMgr.options = Redoc._preOptions || {};
|
optionsMgr.options = getPreOptions();
|
||||||
|
|
||||||
this.element = elementRef.nativeElement;
|
this.element = elementRef.nativeElement;
|
||||||
this.$parent = this.element.parentElement;
|
this.$parent = this.element.parentElement;
|
||||||
|
|
|
@ -8,13 +8,12 @@ import {
|
||||||
FormDataParameter,
|
FormDataParameter,
|
||||||
Spec,
|
Spec,
|
||||||
Response
|
Response
|
||||||
} from '@types/swagger-schema-official';
|
} from 'swagger-schema-official';
|
||||||
|
|
||||||
export interface RedocInjectedPointer {
|
export interface RedocInjectedPointer {
|
||||||
_pointer?: string;
|
_pointer?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface SwaggerOperation extends Operation, RedocInjectedPointer {}
|
export interface SwaggerOperation extends Operation, RedocInjectedPointer {}
|
||||||
export interface SwaggerBodyParameter extends BodyParameter, RedocInjectedPointer {}
|
export interface SwaggerBodyParameter extends BodyParameter, RedocInjectedPointer {}
|
||||||
export interface SwaggerHeaderParameter extends HeaderParameter, RedocInjectedPointer {}
|
export interface SwaggerHeaderParameter extends HeaderParameter, RedocInjectedPointer {}
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
"@types/jasmine": "^2.5.47",
|
"@types/jasmine": "^2.5.47",
|
||||||
"@types/requirejs": "^2.1.29",
|
"@types/requirejs": "^2.1.29",
|
||||||
"@types/should": "^8.3.0",
|
"@types/should": "^8.3.0",
|
||||||
"@types/swagger-schema-official": "^2.0.4",
|
"@types/swagger-schema-official": "^2.0.5",
|
||||||
"@types/webpack": "^2.2.15",
|
"@types/webpack": "^2.2.15",
|
||||||
"angular2-template-loader": "^0.6.2",
|
"angular2-template-loader": "^0.6.2",
|
||||||
"awesome-typescript-loader": "^3.1.3",
|
"awesome-typescript-loader": "^3.1.3",
|
||||||
|
@ -113,6 +113,7 @@
|
||||||
"stream-http": "^2.7.0",
|
"stream-http": "^2.7.0",
|
||||||
"string-replace-webpack-plugin": "^0.1.3",
|
"string-replace-webpack-plugin": "^0.1.3",
|
||||||
"style-loader": "^0.17.0",
|
"style-loader": "^0.17.0",
|
||||||
|
"swagger-schema-official": "^2.0.0-bab6bed",
|
||||||
"ts-helpers": "^1.1.1",
|
"ts-helpers": "^1.1.1",
|
||||||
"tslint": "^5.2.0",
|
"tslint": "^5.2.0",
|
||||||
"typescript": "^2.3.2",
|
"typescript": "^2.3.2",
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
"types": [
|
"types": [
|
||||||
"jasmine",
|
"jasmine",
|
||||||
"should",
|
"should",
|
||||||
"webpack"
|
"webpack",
|
||||||
|
"swagger-schema-official"
|
||||||
],
|
],
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"lib": [
|
"lib": [
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
"dom"
|
"dom"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"webpack"
|
"webpack",
|
||||||
|
"swagger-schema-official"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user