@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
106 lines (99 loc) • 5.22 kB
TypeScript
import * as i0 from '@angular/core';
import { OnInit } from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { DocLinkWithLabel, NavigatorService, OptionsService, UserPreferencesService, AlertService, HeaderService, PopoverConfirmButtons, PopoverConfirmComponent } from '@c8y/ngx-components';
import * as i2 from '@angular/cdk/drag-drop';
import { CdkDragDrop } from '@angular/cdk/drag-drop';
import * as i3 from '@angular/forms';
import * as i4 from 'ngx-bootstrap/tooltip';
import { Router } from '@angular/router';
import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
import { Observable } from 'rxjs';
import { TranslateService } from '@ngx-translate/core';
import { IconSelectorService } from '@c8y/ngx-components/icon-selector';
interface Bookmark extends Pick<DocLinkWithLabel, 'url' | 'label' | 'icon'> {
/**
* ID for the bookmark, represented as a UUID.
*/
id: string;
/**
* Optional property indicating whether a bookmark should be marked for removal.
*/
markToRemove?: boolean;
}
declare class BookmarkService {
private navigatorService;
private options;
private router;
private translateService;
private userPreferencesService;
private static readonly DEFAULT_ICON;
readonly USER_PREFERENCES_BOOKMARKS_KEY = "bookmarks";
updatedBookmarks: Bookmark[];
constructor(navigatorService: NavigatorService, options: OptionsService, router: Router, translateService: TranslateService, userPreferencesService: UserPreferencesService);
updateBookmarksInStorage(newBookmarks: Bookmark[]): Promise<void>;
getActiveNodeIcon(): Promise<string>;
extractIconName(input: string): string | null;
getBookmarks(): Promise<Bookmark[]>;
generateRandomID(): string;
convertBookmarkLinkToObject(title: string, url: string, icon: string): Bookmark;
private findActiveNode;
private findActiveInTree;
private isNodeActive;
private setUserPreferencesBookmarks;
static ɵfac: i0.ɵɵFactoryDeclaration<BookmarkService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<BookmarkService>;
}
declare class BookmarksComponent {
private document;
private alertService;
private bookmarkService;
private bsModalService;
private router;
private headerService;
drawerOpen$: Observable<boolean>;
bookmarks: Bookmark[];
emptyMessageHeader: "No bookmarks yet";
emptyMessageBody: "Navigate to the desired page and click the \"Add current page\" button. Editing, deleting and reordering are possible by clicking on the cog wheel.";
addButtonText: "Add current page";
constructor(document: Document, alertService: AlertService, bookmarkService: BookmarkService, bsModalService: BsModalService, router: Router, headerService: HeaderService);
ngOnInit(): Promise<void>;
addBookmark(): Promise<void>;
editBookmarks(): Promise<void>;
openUrl(url: string): void;
private getRelativeUrl;
private isRelativeUrl;
private isSameApp;
private toRelativeUrl;
static ɵfac: i0.ɵɵFactoryDeclaration<BookmarksComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<BookmarksComponent, "c8y-bookmarks", never, {}, {}, never, never, true, never>;
}
declare class EditBookmarksComponent implements OnInit {
private bsModalRef;
private alertService;
private bookmarkService;
private iconSelector;
bookmarks: Bookmark[];
private bookmarksToUpdate;
confirmRemoveColumnButtons: PopoverConfirmButtons[];
result: Promise<Bookmark[]>;
private _close;
constructor(bsModalRef: BsModalRef, alertService: AlertService, bookmarkService: BookmarkService, iconSelector: IconSelectorService);
ngOnInit(): void;
handleKeyboardEvent(event: KeyboardEvent): void;
close(): void;
drop(event: CdkDragDrop<Bookmark[]>): Promise<void>;
updateBookmark(updatedBookmark: Bookmark, type: keyof Pick<Bookmark, 'icon' | 'label' | 'markToRemove'>): Promise<void>;
updateBookmarkProperty(updatedBookmark: Bookmark, type: keyof Pick<Bookmark, 'icon' | 'label' | 'markToRemove'>): Bookmark[];
changeBookmarkIcon(updatedBookmark: Bookmark): Promise<void>;
removeBookmark(poConfirm: PopoverConfirmComponent, bookmarkToDelete: Bookmark): Promise<void>;
static ɵfac: i0.ɵɵFactoryDeclaration<EditBookmarksComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<EditBookmarksComponent, "c8y-edit-bookmarks", never, { "bookmarks": { "alias": "bookmarks"; "required": false; }; }, {}, never, never, true, never>;
}
declare class BookmarksModule {
static ɵfac: i0.ɵɵFactoryDeclaration<BookmarksModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<BookmarksModule, never, [typeof i1.CoreModule, typeof i1.CommonModule, typeof i1.ListGroupModule, typeof i2.DragDropModule, typeof i3.FormsModule, typeof i1.FormsModule, typeof i1.ModalModule, typeof i4.TooltipModule, typeof i1.ChangeIconComponent, typeof BookmarksComponent, typeof EditBookmarksComponent], [typeof BookmarksComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<BookmarksModule>;
}
export { BookmarksComponent, BookmarksModule, EditBookmarksComponent };
//# sourceMappingURL=index.d.ts.map