diff --git a/types/qlik-visualizationextensions/index.d.ts b/types/qlik-visualizationextensions/index.d.ts index 741e9db805..38cf9935b8 100644 --- a/types/qlik-visualizationextensions/index.d.ts +++ b/types/qlik-visualizationextensions/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for qlik-visualizationextensions 3.2 -// Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm +// Type definitions for qlik-visualizationextensions 4.0 +// Project: http://help.qlik.com/en-US/sense-developer/June2017/Subsystems/Extensions/Content/extensions-introduction.htm // Definitions by: Konrad Mattheis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -940,6 +940,38 @@ declare namespace RootAPI { identity: string; } + interface ISessionAppConfig { + /** + * Optional Qlik host. + */ + host?: string; + + /** + * 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. @@ -1027,6 +1059,21 @@ declare namespace RootAPI { */ resize(ID?: string): void; + /** + * Creates a session app JavaScript object with app methods. + * @param {any} [config] - Additional configuration parameters + * @return {any} - 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 {string} [appId] - App id of the app to base the session app upon. + * @param {any} [config] - Additional configuration parameters. + * @return {any} - 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 @@ -1259,6 +1306,12 @@ declare namespace AppAPI { */ getObjectProperties(id: string): ng.IPromise; + /** + * Gets the data load script of this app. + * @return {Promise} - A promise of an qScript object. + */ + getScript(): ng.IPromise; + /** * 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 @@ -1370,11 +1423,18 @@ declare namespace AppAPI { selectAssociations(qMatchIx: number, qTerms: any[], qOptions?: any, qSoftLock?: any): ng.IPromise; /** - * Creates a QSelectionState object that encapsulates the selection state. Entry point to the Selection API. + * Sets the data load script of this app. Also validates the script syntax and returns the syntax errors if errors exist. * @param {string} [state] - Optional. Sets the state. Default is $. */ selectionState(state?: string): SelectionStateAPI.IQSelectionState; + /** + * Creates a QSelectionState object that encapsulates the selection state. Entry point to the Selection API. + * @param {string} [script] - The script content. + * @return {Promise} - A promise of an empty object or a list of syntax errors depending on the validation result. + */ + setScript(script: string): ng.IPromise; + /** * Unlocks all selections that has previously been locked. * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. @@ -2469,6 +2529,8 @@ declare module "qlik" { } interface IQVAngular { + $injector: angular.auto.IInjectorService; + /** * Register a new directive with the compiler. *