import { EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
/**
* convert object to encoded url string
*/
export declare let convertObjectToURL: (obj: any) => string;
/**
* Calculates hash code from URL string or POST form data
*/
export declare let calculateHash: (formData: any) => any;
/**
* Main 4D backend interface code
*/
export declare class FourDInterface {
private httpClient;
static interfaceInstance: FourDInterface;
/**
* The Authentication object received from 4D after user sign's in.
*
* It holds the Session Key, user privileges and attributes.
*/
static authentication: any;
/** name of current user logged into 4D */
static currentUser: string;
/** ID of current user logged into 4D */
static currentUserID: number;
/** password of current user logged into 4D */
static currentUserPassword: string;
/**
* 4D Web Server URL
*/
private static _fourDUrl;
static get fourDUrl(): string;
static set fourDUrl(url: string);
/**
* current FourDREST API version
*/
static fourdAPIVersion: string;
/**
* current session key used in all http requests
*/
static sessionKey: string;
/**
* indicates if web app is running standalone or inside a workspace
*/
static runningInsideWorkspace: boolean;
/**
* Event emitted when user has successfully signed into 4D
*/
static userHasSignedIn: EventEmitter;
/** 4D lists entries are cached to optimize traffic to/from 4D
*/
private static _listCache;
/** Registry entries are cached to optimize traffic to/from 4D */
private static _registryCache;
/**
* Inject HTTPClient service we'll use
*/
constructor(httpClient: HttpClient);
/**
* Generic function to call 4D backend using Angular5 HTTPClient. A Session Key and payload hash code with be added to each request as required by FourDRESTApi.
*
* @param fourdMethod 4D method name to call, one of the FourDRESTApi entry points
* @param body the request body to send to 4D, an object that will be converted to URLSearchParams
* @param options additional, optional, HTTPClient post options
*
* @returns returns an Observable for the database operation; caller can subscribe to it and act upon the request completion
*/
call4DRESTMethod(fourdMethod: string, body: any, options?: any, acceptHeader?: string): Observable;
/**
* Call 4D backend REST_ProxyHTTPGet entry point to proxy a URL request thru 4D in order to avoid CORS issues
*
* @param url: the URL request to proxy thru 4D
*
* @returns returns an Observable for the database operation
*/
proxyURLThru4D(url: string): Observable;
/**
* Sign in to 4D backend
*
* @param user: user name
* @param pwd: MD5 password digest
*
* @returns returns a Promise that can be subscribed to to handle the request completion; the Promise result is the Authentication object returned by 4D
*
*/
signIn(user: any, pwd: any): Promise;
/**
* Get Record count based on a supplied query+filter
*
* @param tableName the table to get the resulting record count
* @param query the FourDQuery object that defines the query to be used for determining
* @param filter optional, FourDQuery to further filter records
*
* @returns returns a Promise for the database operation, whose result is the # of records selected
*/
getRecordCount(tableName: string, query: FourDQuery, filter?: string): Promise;
/**
* Gets the values of a 4D Choice List. 4D lists entries are cached to optimize traffic to/from 4D
*
* @param listName the 4D Choice List name
*
* @returns returns a Promise for the database operation, whose result is a string Array with all the choice list values
*
**/
get4DList(listName: string): Promise>;
/**
* Update values of a 4D Choice List
*
* @param listName 4D choice list name
* @param listValues array of list values to update on 4D side
*/
update4DList(listName: string, listItems: Array): Promise;
/**
* Retrieve a filtered 4D List from 4C-TV. Used to access a single level of a hierarchical 4D List.
*
*
* @param listName 4D list name
* @param selector the hierarchical selector, only items under that selector in the hierarchy will be returned
* @returns returns a Promise for the database operation
*
*/
getFiltered4DList(listName: string, selector: string): Promise>;
/**
* Get current Registry entry value. Registry entries are cached to optimize traffic to/from 4D
*
* @param theClass the Registry Class to retrieve
* @param theParameter the Registry Parameter to retrieve (optional, if blank gets all values for the Registry Class)
* @param theDefaultValue a default value to return, in case the Registry entry is not defined in 4D
* @param theSelector the Registry Selector to retrieve (optional, if blank gets all values for the Registry Class/Parameter)
*
* @returns returns a Promise for the database operation
*
* Retrieved Registry entries are cached in to optimize traffic to/from 4D
*
*/
getRegistryValue(theClass: string, theParameter: string, theDefaultValue?: string, theSelector?: string): Promise;
/**
* Sets a Registry entry value
*
* @param theClass the Registry Class to set
* @param theParameter the Registry Parameter to set
* @param theValue a Registry value to set
* @param theSelector the Registry Selector to set (optional)
*
*/
setRegistryValue(theClass: string, theParameter: string, theValue: string, theSelector?: string): Promise;
/**
* Converts a DOM date to 4D format (YYYYMMDD).
*
* @param theDate a DOM date value
* @returns a 4D formatted date string (YYYYMMDD)
*
*/
dateTo4DFormat(theDate: Date): string;
/**
* Converts a 4D YMD date to DOM format .
*
* @param theDate a 4D date value, formatted as string (YYYYMMDD)
* @returns a DOM date
*
*/
dateToDOMFormat(theDate: string): Date;
/**
* Converts a DOM Time to 4D format (hh:mm:ss).
*
* @param theDate a DOM date-time value
* @returns a 4D formatted date string (hh:mm:ss)
*
*/
timeTo4DFormat(theDate: Date): string;
/**
* Converts a 4D HH:MM:SS time to DOM format .
*
* @param theTime a 4D time value, formatted as string (HH:MM:SS)
* @returns a DOM date
*
*/
timeToDOMFormat(theTime: string): Date;
/**
* assemble an URL request string with session & hash tokens
* @param req the URL request root
* @param args query parameters as a URLVariables object
* @return the assembled URL string
*
*/
assembleURLWithHash(req: string, args: any): string;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵprov: i0.ɵɵInjectableDeclaration;
}
/**
* MD5 has calculation
*/
export declare class MD5 {
static hex_chr: string[];
static md5cycle(x: any, k: any): void;
static cmn(q: any, a: any, b: any, x: any, s: any, t: any): number;
static ff(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number;
static gg(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number;
static hh(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number;
static ii(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number;
static md51(s: any): number[];
static md5blk(s: any): any[];
static rhex(n: any): string;
static hex(x: any): any;
static md5(s: any): any;
static add32(a: any, b: any): number;
static str2rstr_utf8(input: string): string;
}
/**
* Describes the properties of a 4D Query String - [see RESTApi documentation](https://github.com/fourctv/FourDRESTApi/wiki/The-JS44D-Query-String)
*/
export declare class FourDQuery {
/** Value is a string Array that corresponds to a simple 4D query. The items in the query terms array are similar to 4D Query lines and have the following format: table.field; comparator ; argument; [and, or]. */
query?: Array;
/** Value is a SQL Where clause string, that is used on a QUERY BY SQL on 4D side */
sql?: string;
/** An union of multiple queries, value is a FourDQuery instances Array. Results from each query are combined in a set union */
union?: Array;
/** An intersection of multiple queries, value is a FourDQuery instances Array. Results from each query are combined in a set intersection */
intersection?: Array;
/** Value is a string that corresponds to a 4D method name. Method is called to perform the query. Other properties in the FourDQuery instance are sent to the method to determine the query to perform */
custom?: string;
/** Sets a join between a related tabled; query terms are applied to the join table and joinPK and joinFK establishes the links between the two tables */
join?: string;
/** A join query property. This is the join table, a table name */
joinTable?: string;
/** A join query property. The join table primary key used to establish the join */
joinPK?: string;
/** A join query property. The main table foreign key used to establish the join */
joinFK?: string;
}