UNPKG

@types/qlik-visualizationextensions

Version:
1,398 lines (1,219 loc) 88.4 kB
/// <reference types="angular" /> declare namespace BackendAPI { type StateType = "L" | "S" | "O" | "D" | "A" | "X" | "XS" | "XL"; type SortIndicatorType = "N" | "A" | "D"; type DimensionType = "D" | "N" | "T"; type GroupingType = "N" | "H" | "C"; type FieldAttributesType = "U" | "A" | "I" | "R" | "F" | "M" | "D" | "T" | "TS" | "IV"; type PatchType = "Add" | "Remove" | "Replace"; interface ICharRange { /** * Position of the first search occurrence * Integer */ qCharPos: number; /** * Number of occurrences found * Integer */ qCharCount: number; } interface INxHighlightRanges { /** * Ranges of highlighted values * Array of CharRange */ qRanges: ICharRange[]; } interface INxSimpleValue { /** * Text related to the attribute expression value. * This property is optional. No text is returned if the attribute expression value is a numeric. * String */ qText: string; /** * Numeric value of the attribute expression. * This property is set to NaN (Not a Number) if the attribute expression value is not a numeric. * Numerical values are not returned as text. * Double precision floating point */ qNum: number; } interface INxAttributeExpressionValues { /** * List of attribute expressions values. * Array of NxSimpleValue */ qValues: INxSimpleValue[]; } interface INxSimpleDimValue { /** * Text related to the attribute expression value. * This property is optional. No text is returned if the attribute expression value is a numeric. * String */ qText: string; /** * Element number. * Integer */ qElemNo: number; } interface INxAttributeDimValues { /** * List of values. * Array of NxSimpleDimValue */ qValues: INxSimpleDimValue[]; } interface INxCell { /** * Some text. * This parameter is optional. */ qText?: string | undefined; /** * A value. * This parameter is optional. */ qNum?: number | undefined; /** * Rank number of the value, starting from 0. * If the element number is a negative number, it means that the returned value is not an element number. * You can get the following negative values: * # -1: the cell is a Total cell. It shows a total. * # -2: the cell is collapsed. Applies to pivot tables. * # -3: the cell belongs to the group Others. * # -4: the cell is empty. Applies to pivot tables. */ qElemNumber: number; /** * State of the value. * The default state for a measure is L. * L for Locked * S for Selected * O for Optional * D for Deselected * A for Alternative * X for eXcluded * XS for eXcluded Selected * XL for eXcluded Locked */ qState: StateType; /** * Is set to true, if qText and qNum are empty. * This parameter is optional. The default value is false. */ qIsEmpty: boolean; /** * Is set to true if a total is displayed in the cell. * This parameter is optional. The default value is false. * Not applicable to list objects. */ qIsTotalCell: boolean; /** * Is set to true if the cell belongs to the group Others. * Dimension values can be set as Others depending on what has been defined in OtherTotalSpecProp. * This parameter is optional. The default value is false. * Not applicable to list objects. */ qIsOtherCell: boolean; /** * Frequency of the value. * This parameter is optional. */ qFrequency: string; /** * Search hits. * The search hits are highlighted. * This parameter is optional. */ qHighlightRanges: INxHighlightRanges; /** * Attribute expression values. */ qAttrExps: INxAttributeExpressionValues; /** * Is set to true if the value is Null. */ qIsNull: boolean; /** * Attribute dimensions values. */ qAttrDims: INxAttributeDimValues; } interface INxPage { /** * Position from the left. * Corresponds to the first column. */ qLeft: number; /** * Position from the top. * Corresponds to the first row. */ qTop: number; /** * Number of columns in the page. The indexing of the columns may vary depending on whether * the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). */ qWidth: number; /** * Number of rows or elements in the page. The indexing of the rows may vary depending on * whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). */ qHeight: number; } interface INxAttrDimInfo { /** * Cardinality of the attribute expression. * Integer */ qCardinal: number; /** * Number of rows. * Size */ qSize: number; /** * The title for the attribute dimension. * String */ qFallbackTitle: string; /** * The Locked value of the dimension. * Boolean */ qLocked: boolean; /** * Validation error. * REF(NxValidationError) */ // ?Type = REF(NxValidationError)? qError: INxValidationError; } interface INxDimensionInfo { /** * Corresponds to the label of the dimension that is selected. * If the label is not defined then the field name is used. * String */ qFallbackTitle: string; /** * Length of the longest value in the field. * Integer */ qApprMaxGlyphCount: number; /** * Number of distinct field values. * Integer */ qCardinal: number; /** * Is set to true if the field is locked. * Boolean */ qLocked: boolean; /** * Sort indicator. * This parameter is optional. * The default value is no sorting. * One of: * # N for no sorting * # A for sorting ascending * # D for sorting descending */ qSortIndicator: SortIndicatorType; /** * Array of dimension labels. * Contains the labels of all dimensions in a hierarchy group * (for example the labels of all dimensions in a drill down group). * Array of String */ qGroupFallbackTitles: string[]; /** * Index of the dimension that is currently in use. * qGroupPos is set to 0 if there are no hierarchical groups (drill-down groups) or cycle groups. * Integer */ qGroupPos: number; /** * Number of values in a particular state. * NxStateCounts */ qStateCounts: INxStateCounts; /** * Gives information on a field. For example, it can return the type of the field. * Examples: key, text, ASCII * Array of String */ qTags: string[]; /** * This parameter is optional. * Gives information on the error. * Null or NxValidationError */ qError: INxValidationError; /** * Binary format of the field. * One of: * # D for discrete (String) * # N for numeric (Double) * # T for Time (Timestamp) */ qDimensionType: DimensionType; /** * If set to true, it inverts the sort criteria in the field. * Boolean */ qReverseSort: boolean; /** * Defines the grouping. * One of: * # N for no grouping * # H for drill-down * # C for cyclic */ qGrouping: GroupingType; /** * If set to true, it means that the field is a semantic. * Boolean */ qIsSemantic: boolean; /** * Format of the field. * This parameter is optional. * FieldAttributes */ qNumFormat: FieldAttributesType; /** * This parameter is set to true if qNumFormat is set to U (unknown). * The engine guesses the type of the field based on the field's definition. * Boolean */ qIsAutoFormat: boolean; /** * Array of field names. * Array of String */ qGroupFieldDefs: string[]; /** * Array of attribute expressions. * Array of NxAttrExprInfo */ qAttrExprInfo: INxAttrExprInfo; /** * Minimum value. * Double */ qMin: number; /** * Maximum value. * Double */ qMax: number; /** * Is continuous axis used. * Boolean */ qContinuousAxes: boolean; /** * Is a cyclic dimension used. * Boolean */ qIsCyclic: boolean; /** * Is derived field is used as a dimension. * Boolean */ qDerivedField: boolean; /** * Array of attribute dimensions. * Array of NxAttrDimInfo */ qAttrDimInfo: INxAttrDimInfo; } interface INxAttrExprInfo { /** * Minimum value. */ qMin: number; /** * Maximum value. */ qMax: number; /** * Is continuous axis used. */ qContinuousAxes: boolean; /** * Is a cyclic dimension used. */ qIsCyclic: boolean; /** * Corresponds to the label of the dimension that is selected. */ qFallbackTitle: string; } interface INxStateCounts { /** * Number of values in locked state. * Integer */ qLocked: number; /** * Number of values in selected state. * Integer */ qSelected: number; /** * Number of values in optional state. * Integer */ qOption: number; /** * Number of values in deselected state. * Integer */ qDeselected: number; /** * Number of values in alternative state. * Integer */ qAlternative: number; /** * Number of values in excluded state * Integer */ qExcluded: number; /** * Number of values in selected excluded state. * Integer */ qSelectedExcluded: number; /** * Number of values in locked excluded state. * Integer */ qLockedExcluded: number; } interface INxValidationError { /** * Error code. * This parameter is always displayed in case of error. * Integer */ qErrorCode: number; /** * Context related to the error, from the user app domain. * It can be the identifier of an object, a field name, a table name. * This parameter is optional. * String */ qContext: string; /** * Internal information from the server. * This parameter is optional. * String */ qExtendedMessage: string; } interface IFieldAttributes { /** * Type of the field. * Default is U. * One of: * # U for UNKNOWN type. * # A for ASCII; Numeric fields values contain only standard ASCII characters. * # I for INTEGER; Numeric fields values are shown as integer numbers. * # R for REAL; Numeric fields values are shown as real numbers. * # F for FIX; Numeric fields values are shown as numbers with a fix number of decimals. * # M for MONEY; Numeric fields values are shown as in the money format. * # D for DATE; Numeric fields values are shown as dates. * # T for TIME; Numeric fields values are shown as times. * # TS TIMESTAMP; Numeric fields values are shown as time stamps. * # IV for INTERVAL; Numeric fields values are shown as intervals. */ qType: FieldAttributesType; /** * Number of decimals. * Default is 10. * Integer between 0 and 15. */ qnDec: number; /** * Defines whether or not a thousands separator must be used. * Default is 0. * One of: 0 for false | 1 for true */ qUseThou: boolean; /** * Defines the format pattern that applies to qText. * Is used in connection to the type of the field (parameter qType). * For more information, see Struct FieldAttributes. * Example: YYYY-MM-DD for a date */ qFmt: string; /** * Defines the decimal separator. * Example: . */ qDec: string; /** * Defines the thousand separator (if any). * Is used if qUseThou is set to 1. * Example: , */ qThou: string; /** * Array */ qSAFEARRAY: any[]; } interface INxMeasureInfo { /** * Corresponds to the label of the measure. If the label is not defined then the measure name is used. * String */ qFallbackTitle: string; /** * Length of the longest value in the field. * Integer */ qApprMaxGlyphCount: number; /** * Number of distinct field values. * Integer */ qCardinal: number; /** * Sort indicator. This parameter is optional. The default value is no sorting. */ qSortIndicator: SortIndicatorType; /** * Format of the field. This parameter is optional. * One of: N for no sorting, A for sorting ascending, D for sorting descending */ qNumFormat: IFieldAttributes; /** * This parameter is set to true if qNumFormat is set to U (unknown). * The engine guesses the type of the field based on the field's expression. */ qIsAutoFormat: boolean; /** * Lowest value in the range. */ qMin: number; /** * Highest value in the range. */ qMax: number; /** * This parameter is optional. Gives information on the error. */ qError: INxValidationError; /** * If set to true, it inverts the sort criteria in the field. */ qReverseSort: boolean; /** * List of attribute expressions. */ qAttrExprInfo: INxAttrExprInfo[]; /** * List of attribute dimensions. */ qAttrDimInfo: INxMeasureInfo[]; } interface IRange { /** * Lowest value in the range * Double */ qMin: number; /** * Highest value in the range * Double */ qMax: number; /** * If set to true, the range includes the lowest value in the range of * selections (Equals to ). [bn(50500)] * Example: The range is [1,10]. If qMinInclEq is set to true it means * that 1 is included in the range of selections. */ qMinInclEq: boolean; /** * If set to true, the range includes the highest value in the range of * selections (Equals to ). [bn(50500)] * Example: The range is [1,10]. If qMinInclEq is set to true it means * that 10 is included in the range of selections. */ qMaxInclEq: boolean; } interface INxPatch { /** * Operation to perform. * One of: * # Add * # Remove * # Replace */ qOp: PatchType; /** * Path to the property to add, remove or replace. * String */ qPath: string; /** * This parameter is not used in a remove operation. Corresponds to the value of the * property to add or to the new value of the property to update. * Examples: "false", "2", "\"New title\"" * String */ qValue: string; } interface IBackend { /** * Aborts the result of a search in a list object. Clears the existing search and returns the * object to the state it was in prior to the search started. */ abortSearch(): void; /** * Accepts the result of a search in a list object and the search result is selected in the field. * @param toggleMode - If true, toggle state for selected values */ acceptSearch(toggleMode: boolean): void; /** * Updates the properties for this object. * @param qPatches - Array of patches. Each path contains: * #qOp: Add/Remove/Replace * #qPath: Path to property * #qValue: The new value in string format. Strings need to be surrounded by \". * @param qSoftPatch - Set to True if properties should be soft, that is not persisted. * @return - A promise of a Qlik engine reply. */ applyPatches(qPatches: any[], qSoftPatch: boolean): ng.IPromise<any>; /** * Clears unconfirmed selections for this object. */ clearSelections(): void; /** * Clears all soft patches that has previously been applied for this object using the * applyPatches method. * @return - A promise of a Qlik engine reply. */ clearSoftPatches(): ng.IPromise<any>; /** * Collapse the left dimensions of a pivot table. Only works for hypercubes with * qMode = P which are not always fully expanded. * @param qRow - Row index. * @param qCol - Column index. * @param [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. * @return - A promise of a Qlik engine reply. */ collapseLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise<any>; /** * Collapse the top dimensions of a pivot table. Only works for hypercubes with * qMode = P which are not always fully expanded. * @param qRow - Row index. * @param qCol - Column index. * @param [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. * @return - A promise of a Qlik engine reply. */ collapseTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise<any>; /** * Loops through data rows for this object. Only rows that are available client side will be used. * @param callback - Function to call for each row. * Parameters are row number and row data as an array of NxCell objects. * The loop is terminated if the function returns false. * @return - An array of NxCell. */ eachDataRow(callback: any): INxCell[]; /** * Expands the left dimensions of a pivot table. Only works for hypercubes with * qMode = P which are not always fully expanded. * @param qRow - Row index. * @param qCol - Column index. * @param [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. * @return - A promise of a Qlik engine reply. */ expandLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise<any>; /** * Expands the top dimensions of a pivot table. Only works for hypercubes with * qMode = P which are not always fully expanded. * @param qRow - Row index. * @param qCol - Column index. * @param [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. * @return - A promise of a Qlik engine reply. */ expandTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise<any>; /** * Geta data from Qlik engine for this object. * @param qPages - An array of NxPage objects. * @return - A promise of qDataPages. */ getData(qPages: INxPage[]): ng.IPromise<any>; /** * Gets a data row for this object. * @param rownum - The row number. * @return - A row of NxCell or null if the row is not available client side * and need to be fetched with getData method. */ getDataRow(rownum: number): INxCell; /** * Gets qDimensionInfo for this object. * @return - An array of qDimensionInfo objects. */ getDimensionInfos(): INxDimensionInfo[]; /** * Gets qMeasureInfo for this object. * @return - An array of qMeasureInfo objects. */ getMeasureInfos(): INxMeasureInfo; /** * Gets pivot data from the Qlik engine for this object. Only works for hypercubes with qMode = P. * @param qPages - An array of request page objects. * @return - A promise of pivot data pages. */ getPivotData(qPages: INxPage[]): ng.IPromise<INxPage[]>; /** * Get properties for this object. * @return - A promise of object properties. */ getProperties(): ng.IPromise<any>; /** * Get reduced data from the Qlik engine for this object. This method is intended for preserving the * shape of the data, not for viewing the actual data points. * @param qPages - An array of request page objects. * @param qZoomFactor - Zoom factor. * If set to -1, the Qlik engine decides of the zoom factor. * If qReductionMode is D1 or S, the zoom factor is 2n. * If the zoom factor is 5, the data are reduced by a factor 32. * If qReductionMode is C, the zoom factor defines the number of centroids. * @param qReductionMode - Reduction mode.Can be: * # N for no data reduction. * # D1 to reduce a bar chart or line chart. * The profile of the chart is reduced whatever the number of dimensions in the chart. * # S to reduce the resolution of a scatter plot. * # C to reduce the data of a scatter plot chart. * # ST to reduce the data of a stacked pivot table. * @return - A promise of reduced data pages. */ getReducedData(qPages: INxPage[], qZoomFactor: number, qReductionMode: string): ng.IPromise<any>; /** * Get total number of data rows for this object. * @return - A number. */ getRowCount(): number; /** * Get stacked data from the Qlik engine for this object. Only works for hypercubes with qMode = S. * @param qPages - An array of request page objects. * @param qMaxNbrCells - Maximum number of cells at outer level. * @return - A promise of stack data pages. */ getStackedData(qPages: INxPage[], qMaxNbrCells: number): ng.IPromise<any>; /** * Find out if there are unconfirmed selections for this object. * @return - True if there are unconfirmed selections. */ hasSelections(): boolean; /** * Save this object. * @return - A promise. In case of success, it returns "undefined". In case of failure it returns the error. */ save(): ng.IPromise<any>; /** * Search for a term in a list object. Results in an updated layout, containing only matching records. * @param term - Term to search for. */ search(term: string): void; /** * Select values in this object using ranges. * @param qRanges - Array of ranges to select. * @param qOrMode - If true only one of the measures needs to be in range. */ selectRange(qRanges: IRange[], qOrMode: boolean): void; /** * Select values in this object with a Qlik engine call which triggers a repaint of the object. * @param qDimNo - Dimension number. 0 = first dimension. * @param qValues - Array of values (qElemNumber in the matrix from the Qlik engine) to select or deselect. * @param qToggleMode - If true, values in the field are selected in addition to any previously selected items. * If false, values in the field are selected while previously selected items are deselected. */ selectValues(qDimNo: number, qValues: any[], qToggleMode: boolean): void; /** * Set properties for this object. * @param props - The properties to set. * @return - A promise of a Qlik engine reply. */ setProperties(props: any): ng.IPromise<any>; } } declare namespace RootAPI { interface IAppConfig { /** * Optional Qlik host. */ host?: string | undefined; /** * Port number. */ port: string | number; /** * Optional. Qlik virtual proxy. "/" if no proxy. */ prefix?: string | undefined; /** * Optional. Use SSL. */ isSecure?: boolean | undefined; /** * Optional. Open app without loading data. Introduced in version 1.1. */ openWithoutData?: boolean | undefined; /** * Optional. Unique identity for the session. If omitted, the session will be shared. */ identity?: string | undefined; } interface IGlobalConfig { /** * Qlik Sense host */ host: string; /** * Port number */ port: string; /** * Qlik Sense virtual proxy. / if no virtual proxy */ prefix: string; /** * Use SSL */ isSecure: boolean; /** * Unique identity for the session. If omitted, the session will be shared. */ identity: string; } interface ISessionAppConfig { /** * Optional Qlik host. */ host?: string | undefined; /** * Port number. */ port: string | number; /** * Optional. Qlik virtual proxy. "/" if no proxy. */ prefix: string; /** * Optional. Use SSL. */ isSecure: boolean; /** * Optional. Open app without loading data. */ openWithoutData: boolean; /** * Optional. Unique identity for the session. If omitted, the session will be shared. */ identity: string; } interface IRoot { /** * Calls the Qlik Sense repository. * @param path - Path to the Qlik Sense repository. * Refer to Qlik Sense repository documentation for the available paths. * @param [method] - Optional. HTTP method. Default is GET. * @param [body] - Optional. Body of the post. * @return - A promise of a Qlik engine reply. */ callRepository(path: string, method?: string, body?: string): ng.IPromise<any>; /** * Gets a reference to the current app. Use the currApp method in an extension to get a reference to the app currently displayed. * @param [reference] - Optional. Reference to extension object. Introduced in version 1.1. * @return - An App JavaScript object with app methods. */ currApp(object?: any): AppAPI.IApp; /** * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. * The getAppList method opens a WebSocket, gets the app list, and then closes the WebSocket. * @param callback - Callback method. * @param [config] - Optional. Additional configuration parameters: * Name | Type | Descr | Name * host | String | Optional. Qlik host. | host * port | String or integer | Port number. | port * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. | prefix * isSecure | Boolean | Optional. Use SSL. | isSecure * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. | openWithoutData * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. | identity */ getAppList(callback: any, config?: any): void; /** * Gets a list of extensions installed for Qlik Sense. The reply contains all extensions, * that is widget libraries, visualization extensions and mashups. * @param [callback] - Optional. Callback method. * @return - A promise of a Qlik engine reply. */ getExtensionList(callback?: any): ng.IPromise<any>; /** * Opens a WebSocekt connection to the Qlik engine for global methods. * @param [config] - Optional. Parameters: * Name | Type | Description * host | String | Qlik Sense host * port | String | Port number * prefix | String | Qlik Sense virtual proxy. / if no virtual proxy * isSecure | Boolean | Use SSL * identity | String | Unique identity for the session. If omitted, the session will be shared. * @return - A global JavaScript object with global methods. */ getGlobal(config: any): any; /** * Opens a Qlik Sense app. You can open multiple apps. * Most other methods are defined on the app. * @param appId The app id. * @param [config] Optional. Additional configuration parameters: * Name | Type | Descr * host | String | Optional. Qlik host. * port | String or Integer | Port number. * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. * isSecure | Boolean | Optional. Use SSL. * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. * Parameter updated in version 2.2. * @return - App JavaScript object with app methods. */ openApp(appId: string, config?: any): any; /** * promise object * Promise utility that can be used for asynchronous operations. * Very useful for the paint method to indicate when the rendering is completed. * executor * Type: Function * The executing function with two parameters: * resolve * reject */ Promise: PromiseConstructor; /** * Registers an extension for use in this mashup. The extension is not installed on the * Qlik Sense server and only available in the session where it is created. * As long as a JavaScript module is created in the correct format, it can be sent to * the registerExtension function. * @param id - Set the ID of the visualization extension. * @param impl - Set the extension implementation. * @param [metadata] - Optional. Extension meta-data, same format as the QEXT file. Default: {"type":"visualization"} */ registerExtension(id: string, impl: any, metadata?: any): void; /** * Sends a resize event to all Qlik Sense objects. * @param [ID] - Object id. Optional: if no ID resize event will be sent to all objects. */ resize(ID?: string): void; /** * Creates a session app JavaScript object with app methods. * @param [config] - Additional configuration parameters * @return - App JavaScript object with app methods. */ sessionApp(config?: ISessionAppConfig): AppAPI.IApp; /** * Creates a session app JavaScript object with app methods from an existing app. You can create one session app per app. * @param [appId] - App id of the app to base the session app upon. * @param [config] - Additional configuration parameters. * @return - App JavaScript object with app methods. */ sessionAppFromApp(appId: string, config?: ISessionAppConfig): AppAPI.IApp; /** * Sets a specific language for the Qlik Sense session. * Language should be defined before the app is opened meaning the setLanguage * method should be called before the openApp method is called. * @param lang - Language code. Can be: * # German: short: de long: de-DE * # English: short: en long: en-US * # Spanish: short: es long: es-ES * # French: short: fr long: fr-FR * # Italian: short: it long: it-IT * # Japanese: short: ja long: ja-JP * # Korean: (introduced in version 3.0) short: ko long: ko-KR * # Dutch: short: nl long: nl-NL * # Polish: (introduced in version 3.0) short: pl long: pl-PL * # Brazilian Portuguese: short: pt long: pt-BR * # Russian: short: ru long: ru-RU * # Swedish: short: sv long: sv-SE * # Turkish: (introduced in version 3.0) short: tr long: tr-TR * # Simplified Chinese: short: Do not use! long: zh-CN * # Traditional Chinese: (introduced in version 3.0) short: Do not use! long: zh-TW */ setLanguage(lang: string): void; /** * Registers a callback for error handling. Standard Qlik Sense error * handling is used if this method is not called. * @param onError - Error handling function * @param [onWarning] - Optional. Warning handling function. Introduced in version 2.1. */ setOnError(onError: any, onWarning?: any): void; /** * Create a QTable object that wraps data in your extension and provides an object oriented interface. * @param ext - Extension or angular scope for the extension. * @param [path] - Optional. Path to the hypercube. Default: qHyperCube * @return - A QTable object that holds data and options for the table. */ table(ext: any, path?: string): TableAPI.IQTable; navigation: NavigationAPI.INavigation; } } declare namespace AppAPI { interface IApp { /** * Adds an alternate state in the app. Multiple states within a Qlik Sense * app can be created and applied to specific objects within the app. * Objects in a given state are not affected by user selection in the other states. * @param qStateName - Mandatory. Alternate state name. * @return - A promise of a Qlik engine reply. */ addAlternateState(qStateName: string): ng.IPromise<any>; /** * Steps back in the list of selections. * @return - A promise of a Qlik engine reply. */ back(): ng.IPromise<any>; /** * Clears all selections in all fields of the current Qlik Sense app. * @param [lockedAlso] - Optional. Alternate state name. Default: false Introduced in version 2.1. * @param [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. * @return - A promise of a Qlik engine reply. */ clearAll(lockedAlso?: boolean, state?: string): ng.IPromise<any>; /** * Closes a Qlik Sense app. Also closes the WebSocket and clears out client side data. */ close(): void; /** * Defines a hypercube and registers a callback to receive the data. * @param qHyperCubeDef - Cube definition. * @param [callback] - Optional. Callback method. Parameter will contain a qHyperCube. * @return - A promise of an object model. */ createCube(qHyperCubeDef: any, callback?: any): ng.IPromise<any>; /** * Creates a generic object and registers a callback to receive the data. The generic object can contain the following: * # qHyperCubeDef * # qListObjectDef * # qStringExpression * # qValueExpression * The callback method will be called whenever the selection state changes * in a way that affects the generic object. * The parameter will be the evaluated version of the definition. * @param [def] - Optional. Generic object definition * @param [callback] - Optional. Callback method. * @return - A promise of an object model. */ createGenericObject(def?: any, callback?: any): ng.IPromise<any>; /** * Defines a list of field values and registers a callback to receive the data. * @param qListObjectDef - List definition. * @param [callback] - Optional. Callback method. Parameter will contain a qListObject. * @return - A promise of an object model. */ createList(qListObjectDef: any, callback?: any): ng.IPromise<any>; /** * Defines a hypercube for a table and is the entry point to the Table API. * It creates a table object that wraps the hypercube. * @param dimensions - Dimensions to use. * Should, for each entry, be a field name or a NxDimension structure. * @param measures - Measures to use. * Should, for each entry, be an expression or a NxMeasure structure. * @param [options] - Optional. Options to set. * @return - A table object of type QTable, which is initially * empty but that eventually will contain data. * The table object will be updated when selection state changes. */ createTable(dimensions: string[] | any[], measures: string[] | any[], options?: any): TableAPI.IQTable; /** * Destroys a Qlik Sense session object created with the createGenericObject * method or any of createCube, createList or getList methods. * Calling this method removes the object from the Qlik engine, * no more updates are sent to the client and all methods on the object are invalid. * @param id - Session object id. * @return - A promise of a Qlik engine reply. */ destroySessionObject(id: string): ng.IPromise<any>; /** * Reloads the data in a Qlik Sense app. * @param [qMode] - Optional. Error handling mode: * # 0 = default mode. * # 1 = attempt recovery on all errors. * # 2 = fail on all errors. * @param [qPartial] - Optional. Set to true for partial reload. * @param [qDebug] - Optional. Set to true if debug breakpoints are honored. Execution of the script will be in debug mode. * @return - A promise of a Qlik engine reply. */ doReload(qMode?: string, qPartial?: boolean, qDebug?: boolean): ng.IPromise<any>; /** * Saves a Qlik Sense app, including all objects and data in the data model. * @param [qFileName] - Optional. File name of the file to save. * @return - A promise of a Qlik engine reply. */ doSave(qFileName?: string): ng.IPromise<any>; /** * Gets a field reference with methods that can be used to manipulate the field. * @param [field] - Optional. Name of the field. * @param [state] - Optional. Alternate state name. Default is $. * @return - A QField object with methods and properties that can be used to manipulate the field. */ field(field?: string, state?: string): FieldAPI.IQField; /** * Step forward in list of selections. * @return - A promise of a Qlik engine reply. */ forward(): ng.IPromise<any>; /** * Gets a layout for this Qlik Sense app and registers a callback to receive the data. * Returns the dynamic properties (if any) in addition to the fixed properties. * @param [callback] - Optional. Callback method. * @return - A promise of a Qlik engine reply. */ getAppLayout(callback?: any): ng.IPromise<any>; /** * Gets a list of sheets and visualizations and registers a callback to receive the data. * @param [field] - Optional. Type of object. One of: * # sheet * # masterobject * Default is sheet. * @param [callback] - Optional. Callback method. */ getAppObjectList(type?: string, callback?: any): void; /** * Gets properties for a generic object, the children of the generic object * and the bookmarks and/or embedded snapshots of the generic object. * @param id - Object id. * @return - A promise of an object model. */ getFullPropertyTree(id: string): ng.IPromise<any>; /** * Gets a list of internal Qlik Sense objects and registers a callback to receive the data. * @param type - Type of object: * # FieldList * # MeasureList * # DimensionList * # BookmarkList * # SelectionObject * # SnapshotList (Introduced in version 1.1) * # MediaList (Introduced in version 1.1) * # Sheet (Introduced in version 1.1) * # MasterObject (Introduced in version 1.1) * # VariableList (Introduced in version 2.0) * # story (Introduced in version 2.1) * @param [callback] - Optional. Registers a callback that is executed every time data is returned. * @return - A promise of an object model. */ getList(type: string, callback?: any): ng.IPromise<any>; /** * Retrieves a Qlik Sense object from the Qlik Sense application and inserts * it into a HTML element. The object fills the HTML object, so you can size * and position the element to determine how large the Qlik Sense object will be. * If you supply only one parameter, you get the model without displaying the object. * @param id - Object id or 'CurrentSelections' if used for Selections bar. * @param [elem] - Optional. HTML element. * Since version 1.1 it is also possible to define a string of the HTML element id. * @param [options] - Optional. * Name | Type | Description * noInteraction | Boolean | Set to true if you want to disable interaction, * including selections, in the visualization. * Introduced in version 1.1 and updated in version 3.0. * noSelections | Boolean | Set to true if you want to disable selections in the visualization. * Introduced in version 3.0. * @return - A promise of an object model. */ getObject(id: string, elem?: any | string, options?: any): ng.IPromise<any>; /** * Gets properties for a Qlik Sense object. * @param id - Object id. * @return - A promise of an object model. */ getObjectProperties(id: string): ng.IPromise<any>; /** * Gets the data load script of this app. * @return - A promise of an qScript object. */ getScript(): ng.IPromise<string>; /** * Inserts a Qlik Sense snapshot into a HTML element. The snapshot fills * the HTML object so you can size and position the element to determine * how large the Qlik Sense object will be. If you only supply one parameter, * you will just get the model without displaying the object. * @param id - Snapshot ID. * @param [elem] - Optional. HTML element or string with HTML element id. * @return - A promise of an object model. */ getSnapshot(id: string, elem?: any | string): ng.IPromise<any>; /** * Locks all selections. * @param [state=$] - Optional. Alternate state name. * Default: $ * Introduced in version 2.1. * @return - A promise of a Qlik engine reply. */ lockAll(state?: string): ng.IPromise<any>; /** * Removes an alternate state in the app. * @param qStateName - Alternate state name. * @return - A promise of a Qlik engine reply. */ removeAlternateState(qStateName: string): ng.IPromise<any>; /** * Searches for one or more terms in the values of a Qlik Sense app. * @param qTerms - Terms to search for. * @param qPage - Properties: * Name | Type | Description * qOffset | Number | Position from the top, starting from 0. * qCount | Number | Number of search results to return. * qMaxNbrFieldMatches | Number | Maximum number of matching values to return per search result. * @param qOptions - Properties * Name | Type | Description * qSearchFields | Array | List of search fields. * qContext | | Search context. Can be one of: * # Cleared: In this mode, the first step is to clear any current selections in the app. * The second step is to search for one or more terms in the values of the app. * # LockedFieldsOnly: In this mode, the search applies only to the values associated * with the selections made in locked fields, ignoring selections * in any unlocked field. If no locked fields, the behavior is * identical to the Cleared context. You cannot make any new selections * in a locked field. You can get search hits for the associated values * of a locked field but you cannot get the search hits for the non associative values. * # CurrentSelections:In this mode, the current selections are kept (if any). Search * for one or more terms in the values of the app. New selections * are made on top of the current selections. If no selections were * made before the search, this mode is identical to the Cleared context. * | | Default value is LockedFieldsOnly. * @param [callback] - Optional. Callback method. * @return - A promise of a Qlik engine reply. */ searchAssociations(qTerms: any[], qPage: any, qOptions: any, callback?: any): ng.IPromise<any>; /** * Searches for one or more terms in the values of a Qlik Sense app. * @param qTerms - Terms to search for. * @param qPage - Properties: * Name | Type | Description * qOffset | Number | Position from the top, starting from 0. * qCount | Number | Number of search results to return. * qGroupOptions | Array | This parameter is optional. Options of the search groups. If this property is not set, all values are returned. * qGroupItemOptions | Array | This parameter is optional. Options of the search group items. If this property is not set, all values are returned. * qOptions | Object | Optional. Search options. Properties: * Name | Type | Description * qSearchFields | Array | List of search fields. * qContext | | Search context. Can be one of: * # Cleared: In this mode, the first step is to clear any current selections in the app. * The second step is to search for one or more terms in the values of the app. * # LockedFieldsOnly: In this mode, the search applies only to the values associated * with the selections made in locked fields, ignoring selections * in any unlocked field. If no locked fields, the behavior is * identical to the Cleared context. You cannot make any new selections * in a locked field. You can