@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
70 lines (64 loc) • 3.04 kB
TypeScript
import * as i0 from '@angular/core';
import { OnInit } from '@angular/core';
import { FilesService, AlertService, OnBeforeSave, AppStateService } from '@c8y/ngx-components';
import { FormGroup, FormBuilder, NgForm } from '@angular/forms';
import { InventoryService, InventoryBinaryService, FetchClient } from '@c8y/client';
import { TranslateService } from '@ngx-translate/core';
interface MarkdownWidgetConfig {
markdownBinaryId: string | null;
contentUrl: string | null;
}
declare class MarkdownWidgetService {
private fileService;
private inventory;
private binary;
private alert;
private translate;
constructor(fileService: FilesService, inventory: InventoryService, binary: InventoryBinaryService, alert: AlertService, translate: TranslateService);
getFile(markdownBinaryId: string | null): Promise<File>;
uploadFile(file: File): Promise<string>;
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownWidgetService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<MarkdownWidgetService>;
}
declare class MarkdownWidgetConfigComponent implements OnInit, OnBeforeSave {
private formBuilder;
private form;
private alert;
private markdownService;
config: MarkdownWidgetConfig;
formGroup: FormGroup;
fileFromConfig: File;
uploadChoice: 'uploadBinary' | 'uploadUrl';
loading: boolean;
constructor(formBuilder: FormBuilder, form: NgForm, alert: AlertService, markdownService: MarkdownWidgetService);
onBeforeSave(config?: MarkdownWidgetConfig): Promise<boolean>;
ngOnInit(): Promise<void>;
onChange(value: 'uploadBinary' | 'uploadUrl'): void;
private getFileFromFormValue;
private initForm;
private requireEitherBinaryOrUrl;
private removeErrors;
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownWidgetConfigComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MarkdownWidgetConfigComponent, "c8y-markdown-widget-config", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}
declare class MarkdownWidgetViewComponent implements OnInit {
private appState;
private client;
private markdownWidgetService;
config: MarkdownWidgetConfig;
loading: boolean;
markdown: string;
contextPath: string;
private readonly headers;
constructor(appState: AppStateService, client: FetchClient, markdownWidgetService: MarkdownWidgetService);
ngOnInit(): Promise<void>;
setContentFromUrl(url: string): void;
private render;
private getReadmeFileContent;
private getReadmeFile;
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownWidgetViewComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MarkdownWidgetViewComponent, "c8y-markdown-widget-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}
export { MarkdownWidgetConfigComponent, MarkdownWidgetService, MarkdownWidgetViewComponent };
export type { MarkdownWidgetConfig };
//# sourceMappingURL=index.d.ts.map