Skip to content

Commit

Permalink
Merge pull request #260 from mathiasbl/gh_master
Browse files Browse the repository at this point in the history
Side pane typings.
  • Loading branch information
misoeli authored Mar 14, 2022
2 parents 8f7cd1e + cce7573 commit 152e697
Showing 1 changed file with 65 additions and 50 deletions.
115 changes: 65 additions & 50 deletions src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,46 +73,8 @@ declare namespace Xrm {
Warning = 3,
Information = 4,
}
//TODO figure out how to implement the app side pane https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-app-appsidepane
// should the methods take an input like paneID?
interface AppSidePane {
/**
* Closes the side pane and removes it from the side bar.
*/
close(): any;

/**
* Specify whether the pane should be selected or expanded.
*/
select(): any;

/**
* Opens a page within the selected pane. This is similar to the navigateTo method.
*/
navigate(): any;
}
interface SidePanes {
/**
* Provides all the information to create side panes.
*/
createPane(paneOptions?: SidePaneOptions): any;

/**
* returns the appSidePane object
*/
getAllPanes(): Object;

/**
* returns the appSidePane object
*/
getPane(paneId: string): Object;
/**
* returns the appSidePane object
*/
getSelectedPane(): Object;
}
interface SidePaneOptions {

interface SidePaneProperties {
/**
* The title of the pane. Used in pane header and for tooltip.
*/
Expand All @@ -133,17 +95,6 @@ declare namespace Xrm {
*/
imageSrc?: string;

/**
* Hides the header pane, including the title and close button. Default value is false.
*/
hideHeader?: boolean;

/**
* When set to false, the created pane is not selected and leaves the existing pane selected.
* It also does not expand the pane if collapsed.
*/
isSelected?: boolean;

/**
* The width of the pane in pixels.
*/
Expand All @@ -165,6 +116,67 @@ declare namespace Xrm {
keepBadgeOnSelect?: boolean;
}

interface AppSidePane extends SidePaneProperties {
/**
* Closes the side pane and removes it from the side bar.
*/
close(): Promise<undefined>;

/**
* Specify whether the pane should be selected or expanded.
*/
select(): void;

/**
* Opens a page within the selected pane. This is similar to the navigateTo method.
*/
navigate(pageInput: EntityRecord | EntityList | WebResource | Dashboard): Promise<undefined>;
}

const enum SidePaneState {
Collapsed = 0,
Expanded = 1,
}

interface SidePanes {
/**
* Provides all the information to create side panes.
*/
createPane(paneOptions?: SidePaneOptions): Promise<AppSidePane>;

/**
* returns the appSidePane object
*/
getAllPanes(): Collection<AppSidePane>;

/**
* returns the appSidePane object
*/
getPane(paneId: string): AppSidePane;
/**
* returns the appSidePane object
*/
getSelectedPane(): AppSidePane;

/**
* Returns whether the selected pane is collapsed or expanded.
*/
state: SidePaneState
}

interface SidePaneOptions extends SidePaneProperties {
/**
* Hides the header pane, including the title and close button. Default value is false.
*/
hideHeader?: boolean;

/**
* When set to false, the created pane is not selected and leaves the existing pane selected.
* It also does not expand the pane if collapsed.
*/
isSelected?: boolean;
}

/**
* Provides a method to display a web page in the side pane of model-driven apps form.
*/
Expand Down Expand Up @@ -720,4 +732,7 @@ declare namespace Xrm {
*/
setContentType(contentType: TabsContentType): void;
}

interface OnRecordSelectEventContext extends ExecutionContext<UiModule<TabCollectionBase, ControlCollectionBase>, undefined> {
}
}

0 comments on commit 152e697

Please sign in to comment.