Skip to content

Commit 0777df3

Browse files
authored
Convert @throws to normal description text (#391)
1 parent c768c33 commit 0777df3

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

docs/docs-ref-autogen/officescript.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ functions:
102102
necessarily indicate that the API failed. The workbook copy may still be
103103
created, but after the timeout limit this API does not return a success or
104104
failure message.
105+
106+
107+
**Throws**: `ExternalAPITimeout` The error thrown if the API reaches
108+
the timeout limit of 30 seconds. Note that the copy may still be created.
109+
110+
111+
**Throws**: `InvalidExtensionError` The error thrown if the file name
112+
doesn't end with ".xlsx".
113+
114+
115+
**Throws**: `SaveCopyAsFileMayAlreadyExistError` The error thrown if
116+
the file name of the copy already exists.
117+
118+
119+
**Throws**: `SaveCopyAsFileNotOnOneDriveError` The error thrown if the
120+
document is not saved to OneDrive.
105121
remarks: ''
106122

107123
isPreview: true

generate-docs/api-extractor-inputs-officescript/officescript.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ export declare namespace OfficeScript {
33
* Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name.
44
* The API has a timeout limit of 30 seconds. This limit is rarely exceeded.
55
* Note: Timeout doesn't necessarily indicate that the API failed. The workbook copy may still be created, but after the timeout limit this API does not return a success or failure message.
6-
* @throws ExternalApiTimeout The error thrown if the API reaches the timeout limit of 30 seconds. Note that the copy may still be created.
7-
* @throws InvalidExtensionError The error thrown if the file name doesn't end with ".xlsx".
8-
* @throws SaveCopyAsFileMayAlreadyExistError The error thrown if the file name of the copy already exists.
9-
* @throws SaveCopyAsFileNotOnOneDriveError The error thrown if the document is not saved to OneDrive.
6+
7+
* **Throws**: `ExternalApiTimeout` The error thrown if the API reaches the timeout limit of 30 seconds. Note that the copy may still be created.
8+
9+
* **Throws**: `InvalidExtensionError` The error thrown if the file name doesn't end with ".xlsx".
10+
11+
* **Throws**: `SaveCopyAsFileMayAlreadyExistError` The error thrown if the file name of the copy already exists.
12+
13+
* **Throws**: `SaveCopyAsFileNotOnOneDriveError` The error thrown if the document is not saved to OneDrive.
1014
* @param filename - The file name of the copied and saved file. The file name must end with ".xlsx".
1115
* @beta
1216
*/

generate-docs/scripts/preprocessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ function applyRegularExpressions (definitionsIn) {
118118
.replace(/^(\s*)(interface)(\s+)/gm, `$1export $2$3`)
119119
.replace(/^(\s*)(module)(\s+)/gm, `$1export $2$3`)
120120
.replace(/^(\s*)(function)(\s+)/gm, `$1export $2$3`)
121-
.replace(/(\s*)(@param)(\s+)(\w+)(\s)(\s)/g, `$1$2$3$4$5`)
122-
.replace(/(\s*)(@param)(\s+)(\w+)(\s+)([^\-])/g, `$1$2$3$4$5- $6`);
121+
.replace(/(\s*)(@param)(\s+)(\w+)(\s+)([^\-])/g, `$1$2$3$4$5- $6`)
122+
.replace(/(\s*)\*(\s*)(@throws)(\s+)(\w+)(.*)/g, `$1$1*$2**Throws**: $4\`$5\`$6`);
123123
}
124124

125125
function readySnippets(snippetsSourceFile: string, snippetDestinationFile: string) {

0 commit comments

Comments
 (0)