Skip to content

Commit 4c15954

Browse files
[office-js][office-js-preview] (UI/UX) Document TaskPaneApi 1.1 requirement set (DefinitelyTyped#73732)
1 parent 0a01699 commit 4c15954

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

types/office-js-preview/index.d.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6885,6 +6885,23 @@ declare namespace Office {
68856885
*/
68866886
name: string;
68876887
}
6888+
/**
6889+
* Provides options to manage the user interface of an Office Add-in while the add-in is running.
6890+
*
6891+
* @remarks
6892+
*
6893+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
6894+
*/
6895+
interface ExtensionLifeCycle {
6896+
/**
6897+
* Gets an object that represents the task pane of an add-in.
6898+
*
6899+
* @remarks
6900+
*
6901+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
6902+
*/
6903+
taskpane: TaskPane;
6904+
}
68886905
/**
68896906
* Represents the document file associated with an Office Add-in.
68906907
*
@@ -8574,6 +8591,37 @@ declare namespace Office {
85748591
*/
85758592
rows: any[][];
85768593
}
8594+
/**
8595+
* Provides methods to manage the task pane of an add-in.
8596+
*
8597+
* @remarks
8598+
*
8599+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
8600+
*/
8601+
interface TaskPane {
8602+
/**
8603+
* Sets the width of the task pane of an add-in in pixels.
8604+
*
8605+
* @remarks
8606+
*
8607+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
8608+
*
8609+
* **Important**: The default width of the task pane of an add-in varies depending on the platform.
8610+
*
8611+
* - **Web (Excel)**: 350 px
8612+
*
8613+
* - **Web (Word)**: 330 px
8614+
*
8615+
* - **Windows**: 51 px
8616+
*
8617+
* If you pass a width beyond the minimum and maximum constraints, the task pane isn't resized and no error is shown.
8618+
*
8619+
* @param width The width of a task pane in pixels. The minimum and maximum constraints vary by platform. In Excel on the web, the width must be between
8620+
* 350 and 500 px (inclusive). In Word on the web, the width must be between 330 and 500 px (inclusive). In Office on Windows, the width
8621+
* must be between 51 px and 50% of the client window.
8622+
*/
8623+
setWidth(width: number): void;
8624+
}
85778625
/**
85788626
* Represents a bound text selection in the document.
85798627
*

types/office-js/index.d.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6875,6 +6875,23 @@ declare namespace Office {
68756875
*/
68766876
name: string;
68776877
}
6878+
/**
6879+
* Provides options to manage the user interface of an Office Add-in while the add-in is running.
6880+
*
6881+
* @remarks
6882+
*
6883+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
6884+
*/
6885+
interface ExtensionLifeCycle {
6886+
/**
6887+
* Gets an object that represents the task pane of an add-in.
6888+
*
6889+
* @remarks
6890+
*
6891+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
6892+
*/
6893+
taskpane: TaskPane;
6894+
}
68786895
/**
68796896
* Represents the document file associated with an Office Add-in.
68806897
*
@@ -8564,6 +8581,37 @@ declare namespace Office {
85648581
*/
85658582
rows: any[][];
85668583
}
8584+
/**
8585+
* Provides methods to manage the task pane of an add-in.
8586+
*
8587+
* @remarks
8588+
*
8589+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
8590+
*/
8591+
interface TaskPane {
8592+
/**
8593+
* Sets the width of the task pane of an add-in in pixels.
8594+
*
8595+
* @remarks
8596+
*
8597+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/task-pane-api-requirement-sets | TaskPaneApi 1.1}
8598+
*
8599+
* **Important**: The default width of the task pane of an add-in varies depending on the platform.
8600+
*
8601+
* - **Web (Excel)**: 350 px
8602+
*
8603+
* - **Web (Word)**: 330 px
8604+
*
8605+
* - **Windows**: 51 px
8606+
*
8607+
* If you pass a width beyond the minimum and maximum constraints, the task pane isn't resized and no error is shown.
8608+
*
8609+
* @param width The width of a task pane in pixels. The minimum and maximum constraints vary by platform. In Excel on the web, the width must be between
8610+
* 350 and 500 px (inclusive). In Word on the web, the width must be between 330 and 500 px (inclusive). In Office on Windows, the width
8611+
* must be between 51 px and 50% of the client window.
8612+
*/
8613+
setWidth(width: number): void;
8614+
}
85678615
/**
85688616
* Represents a bound text selection in the document.
85698617
*

0 commit comments

Comments
 (0)