Skip to content

Commit 152e697

Browse files
authored
Merge pull request #260 from mathiasbl/gh_master
Side pane typings.
2 parents 8f7cd1e + cce7573 commit 152e697

1 file changed

Lines changed: 65 additions & 50 deletions

File tree

src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -73,46 +73,8 @@ declare namespace Xrm {
7373
Warning = 3,
7474
Information = 4,
7575
}
76-
//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
77-
// should the methods take an input like paneID?
78-
interface AppSidePane {
79-
/**
80-
* Closes the side pane and removes it from the side bar.
81-
*/
82-
close(): any;
83-
84-
/**
85-
* Specify whether the pane should be selected or expanded.
86-
*/
87-
select(): any;
88-
89-
/**
90-
* Opens a page within the selected pane. This is similar to the navigateTo method.
91-
*/
92-
navigate(): any;
93-
}
94-
interface SidePanes {
95-
/**
96-
* Provides all the information to create side panes.
97-
*/
98-
createPane(paneOptions?: SidePaneOptions): any;
99-
100-
/**
101-
* returns the appSidePane object
102-
*/
103-
getAllPanes(): Object;
104-
105-
/**
106-
* returns the appSidePane object
107-
*/
108-
getPane(paneId: string): Object;
109-
/**
110-
* returns the appSidePane object
111-
*/
112-
getSelectedPane(): Object;
113-
}
114-
interface SidePaneOptions {
11576

77+
interface SidePaneProperties {
11678
/**
11779
* The title of the pane. Used in pane header and for tooltip.
11880
*/
@@ -133,17 +95,6 @@ declare namespace Xrm {
13395
*/
13496
imageSrc?: string;
13597

136-
/**
137-
* Hides the header pane, including the title and close button. Default value is false.
138-
*/
139-
hideHeader?: boolean;
140-
141-
/**
142-
* When set to false, the created pane is not selected and leaves the existing pane selected.
143-
* It also does not expand the pane if collapsed.
144-
*/
145-
isSelected?: boolean;
146-
14798
/**
14899
* The width of the pane in pixels.
149100
*/
@@ -165,6 +116,67 @@ declare namespace Xrm {
165116
keepBadgeOnSelect?: boolean;
166117
}
167118

119+
interface AppSidePane extends SidePaneProperties {
120+
/**
121+
* Closes the side pane and removes it from the side bar.
122+
*/
123+
close(): Promise<undefined>;
124+
125+
/**
126+
* Specify whether the pane should be selected or expanded.
127+
*/
128+
select(): void;
129+
130+
/**
131+
* Opens a page within the selected pane. This is similar to the navigateTo method.
132+
*/
133+
navigate(pageInput: EntityRecord | EntityList | WebResource | Dashboard): Promise<undefined>;
134+
}
135+
136+
const enum SidePaneState {
137+
Collapsed = 0,
138+
Expanded = 1,
139+
}
140+
141+
interface SidePanes {
142+
/**
143+
* Provides all the information to create side panes.
144+
*/
145+
createPane(paneOptions?: SidePaneOptions): Promise<AppSidePane>;
146+
147+
/**
148+
* returns the appSidePane object
149+
*/
150+
getAllPanes(): Collection<AppSidePane>;
151+
152+
/**
153+
* returns the appSidePane object
154+
*/
155+
getPane(paneId: string): AppSidePane;
156+
/**
157+
* returns the appSidePane object
158+
*/
159+
getSelectedPane(): AppSidePane;
160+
161+
/**
162+
* Returns whether the selected pane is collapsed or expanded.
163+
*/
164+
state: SidePaneState
165+
}
166+
167+
interface SidePaneOptions extends SidePaneProperties {
168+
/**
169+
* Hides the header pane, including the title and close button. Default value is false.
170+
*/
171+
hideHeader?: boolean;
172+
173+
/**
174+
* When set to false, the created pane is not selected and leaves the existing pane selected.
175+
* It also does not expand the pane if collapsed.
176+
*/
177+
isSelected?: boolean;
178+
}
179+
168180
/**
169181
* Provides a method to display a web page in the side pane of model-driven apps form.
170182
*/
@@ -720,4 +732,7 @@ declare namespace Xrm {
720732
*/
721733
setContentType(contentType: TabsContentType): void;
722734
}
735+
736+
interface OnRecordSelectEventContext extends ExecutionContext<UiModule<TabCollectionBase, ControlCollectionBase>, undefined> {
737+
}
723738
}

0 commit comments

Comments
 (0)