import { NavController } from '@ionic/angular'; import { C8o, C8oLogLevel } from "c8osdkangular"; import { DomSanitizer } from "@angular/platform-browser"; import { C8oPageBase } from "./convertigo.base"; import { ActivatedRoute } from '@angular/router'; import * as i0 from "@angular/core"; export declare class C8oRouter { private _c8o; private route; sanitizer: DomSanitizer; navController: NavController; /** * An array holding for a view index the data attached to this view. */ private c8oResponses; private _routerLogLevel; private static C8OCAF_SESSION_STORAGE_DATA; private static C8OCAF_SESSION_STORAGE_MODE; private static C8OCAF_SESSION_STORAGE_CLEAR; private storage; pagesArray: any[]; pagesKeyValue: {}; sharedObject: any; loadingFamily: "crescent" | "bubbles" | "circles" | "circular" | "dots" | "lines" | "lines-small" | "lines-sharp" | "lines-sharp-small" | null | undefined; constructor(_c8o: C8o, route: ActivatedRoute, sanitizer: DomSanitizer, navController: NavController); get routerLogLevel(): C8oLogLevel; set routerLogLevel(value: C8oLogLevel); log(message: string): void; /** * * @returns {C8o} */ get c8o(): C8o; /** * Execute routing: * * Routing works by analysing a Convertigo response. Each route is explored. for a given requestable and if the * condition for the route matches, then the destination page is pushed or "rooted" in the navConsroller * * @param reponse the Convertigo server response * @param parameters the requestable in discrete "__sequence", "__project" property form * @param exception optional exception if it is a failed requestable call * */ execute_route(response: any, parameters: any, pageName: string, instanceID: string): Promise; /** * Calls a Convertigo requestable. When the response comes back we execute the routes to switch to the target page * * @param requestable as a "project.sequence" of as "fs://database.verb" * @param data for the call * */ c8oCall(requestable: string, parameters?: any, navParams?: any, page?: C8oPageBase): Promise; /** * When a page is navigated to, it will get the response data passed in the Push() or setRoot() and will call this * method to store this data indexed by this page instance. This way each page can retrieve data from its instance index * to use Angular binding to its HTML. * * @view the view index where the data will be stored * @requestable the requestable from where this data was responded * @data the data */ storeResponseForView(view: any, requestable: string, data: any, navParams: any, didEnter: any, didLeave: any, instanceID: any): void; /** * When a page(view) is displayed it will call this method to retreive the data that was stored for this view * * @param view: the view we must restore data from * @param {string[]} requestables: an array of requestables from where the data was responded * @returns {any}: data to fetch */ getResponseForView(view: any, requestables: string[], instanceID: string): any; /** * When a page(view) is displayed it will call this method to delete the data that was stored for this view * * @param view: the view we must restore data from * @param {string[]} requestables: an array of requestables from where the data was responded * @returns {boolean} true if a value has been deleted. */ deleteResponseForView(view: any, requestables: string[]): boolean; /** * When a page(view) is displayed it will call this method to retreive the data that was stored for this view * * @param the view we must restore data from * @requestables a requestable from where the data was responded * * @return the data */ getParamForView(view: any, requestable: string): any; /** * Check if the current view is the same as the one we should route to * * @param activeView, the view we must search * @param targetView, the view we should route to * @requestable The requestable for this view * * @return true if the view is found */ findView(view: any, targetView: any, requestable: string): boolean; /** * Utility routine to push / navigateForward on the nav stack a view with data to be passed to the view * It's an alias to router.push function * * @param view the page to be pushed * @param data the data to be pushed * @param options options to use * @returns Promise */ push(view: any, data: any, options: Object): Promise; /** * Utility routine to push / navigateForward on the nav stack a view with data to be passed to the view * It's an alias to router.push function * * @param view the page to be pushed * @param data the data to be pushed * @param options options to use * @returns Promise */ navigateForward(view: any, data: any, options: Object): Promise; /** * This methods goes back in the context of Ionic's stack navigation. * * It recursively finds the top active `ion-router-outlet` and calls `pop()`. * This is the recommended way to go back when you are using `ion-router-outlet`. * @returns Promise */ pop(): Promise; /** * Utility routine to root / navigateRoot a view / page on the nav stack with data to be passed to the view / page * * @param view the page to be rooted * @param data the data to be rooted * @param options options to use * @returns Promise */ setRoot(view: any, data: any, options: Object): Promise; /** * Utility routine to root / navigateRoot a view / page on the nav stack with data to be passed to the view / page * It's an alias to router.setRoot function * * @param view the page to be rooted * @param data the data to be passed to root * @param options the options to be used to root */ navigateRoot(view: any, data: any, options: Object): Promise; getPageSegment(pageName: string): any; /** * Client Side OAuth Login. Calling this method will display the OAuth provider's * login page. When the users authentifies, the login page will be closed and a * Server sequence will be called with the acess token provided. The server is responsible * for validating the token and to return some user information. The server also uses * Set_Authenticated_User step to flag the curent session authenticated. * * This is a generic client OAuth. each OAuth provider has a specific url to call to trigger * the OAuth implicit flow. Here are somme common providers URLs: * * - Microsoft Azure V2.0 endpoint * url : https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=&response_type=id_token+token&scope=openid%20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read&response_mode=fragment&state=12345&nonce=678910 * redirectUri : "https://login.live.com/oauth20_desktop.srf" * * Notes : * This function requires the cordova-plugin-inappbrowser. * This will only work for cordova installed apps. * * @param url The OAuth provider url * @param redirectUri The redirect URI to check * @param loginSequence The server Sequence to be launched to login (Project.Sequence) * @param checkTokenSequence The server Sequence to be used to check if user session is already autenticated (Project.Sequence) */ doOAuthLogin(url: String, redirectUri: String, loginSequence: string, checkTokenSequence: string): Promise; openOAuthLogin(url: String, redirectUri: String, isABoringBrowser?: any, win?: any): Promise; /** * Get attachment data url a requestable response to be displayed * * @param id the DocumentID to get the attachment from * @param attachmentName name of the attachment to display (eg: image.jpg) * @param placeholderUrl the url to display while we get the attachment (This is an Async process) * @param imgCache An array that contains cache. * @param databaseName the Qname of a FS database (eg project.fsdatabase) to get the attachment from. * */ getAttachmentUrl(id: string, attachmentName: string, placeholderURL: string, imgCache: Object, databaseName?: string): Object; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }