[@types/xrm] add Xrm.Navigation.navigateTo method (#43026)

* add Xrm.Navigation.navigateTo method

* fix linting errors and slight better comments

* Comment errors
This commit is contained in:
Markus Erlandsson
2020-03-18 21:24:10 +01:00
committed by GitHub
parent 640c0fc048
commit efc6453acf

71
types/xrm/index.d.ts vendored
View File

@@ -4423,12 +4423,83 @@ declare namespace Xrm {
*/
roleType?: XrmEnum.RoleType;
}
interface PageInputEntityList {
pageType: "entitylist";
/**
* The logical name of the entity to load in the list control.
* */
entityName: string;
/**
* The ID of the view to load. If you don't specify it, navigates to the default main view for the entity.
* */
viewId?: string;
/**
* Type of view to load. Specify "savedquery" or "userquery".
* */
viewType?: "savedquery" |"userquery";
}
interface PageInputHtmlWebResource {
pageType: "webresource";
/**
* The name of the web resource to load.
* */
webresourceName: string;
/**
* The data to pass to the web resource.
* */
data?: string;
}
/**
* Options for navigating to a page: whether to open inline or in a dialog. If you don't specify this parameter, page is opened inline by default.
* */
interface NavigationOptions {
/**
* Specify 1 to open the page inline; 2 to open the page in a dialog.
* Entity lists can only be opened inline; web resources can be opened either inline or in a dialog.
* */
target: 1 | 2;
/**
* The width of dialog. To specify the width in pixels, just type a numeric value. To specify the width in percentage, specify an object of type
* */
width?: number | NavigationOptions.SizeValue;
/**
* The width of dialog. To specify the width in pixels, just type a numeric value. To specify the width in percentage, specify an object of type
* */
height?: number | NavigationOptions.SizeValue;
/**
* Specify 1 to open the dialog in center; 2 to open the dialog on the side. Default is 1 (center).
* */
position?: 1 | 2;
}
namespace NavigationOptions {
interface SizeValue {
/**
* The numerical value
* */
value: number;
/**
* The unit of measurement. Specify "%" or "px". Default value is "px"
* */
unit: "%" | "px";
}
}
}
/**
* Interface for the Xrm.Navigation API
*/
interface Navigation {
/**
* Navigates to the specified page.
* @param pageInput Input about the page to navigate to. The object definition changes depending on the type of page to navigate to: entity list or HTML web resource.
* @param navigationOptions Options for navigating to a page: whether to open inline or in a dialog. If you don't specify this parameter, page is opened inline by default.
*/
navigateTo(pageInput: Navigation.PageInputEntityList | Navigation.PageInputHtmlWebResource, navigationOptions?: Navigation.NavigationOptions): Async.PromiseLike<any>;
/**
* Displays an alert dialog containing a message and a button.
* @param alertStrings The strings to be used in the alert dialog.