Skip to content

Commit 80c00f9

Browse files
authored
[scripts] Update to latest versioned-d.ts-tools (#399)
* Update to lastest versioned-d.ts-tools * Fix postprocessor newline replacement
1 parent 4b82fbd commit 80c00f9

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

docs/includes/officescript-preview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
| Class | Fields | Description |
22
|:---|:---|:---|
3-
|*global*|[convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1))|Return the text encoding of the document as a PDF.|
4-
||[downloadFile({ name, content, }: { name: string content: string })](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1))|Downloads a specified file to the default download location specified by the local machine.|
3+
|*global*|[convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1))|Converts the document to a PDF and returns the text encoding of it.|
4+
||[downloadFile(fileProperties: FileProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1))|Downloads a specified file to the default download location specified by the local machine.|
55
||[getScriptName()](/javascript/api/office-scripts/officescript#officescript-officescript-getscriptname-function(1))|Get the name of the currently running script.|
66
||[saveCopyAs(filename: string)](/javascript/api/office-scripts/officescript#officescript-officescript-savecopyas-function(1))|Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name.|
77
||[sendMail(mailProperties: MailProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-sendmail-function(1))|Send an email with an Office Script.|
88
|[EmailAttachment](/javascript/api/office-scripts/officescript/officescript.emailattachment)|[content](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-content-member)|The contents of the file.|
99
||[name](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-name-member)|The text that is displayed below the icon representing the attachment.|
10+
|[FileProperties](/javascript/api/office-scripts/officescript/officescript.fileproperties)|[content](/javascript/api/office-scripts/officescript/officescript.fileproperties#officescript-officescript-fileproperties-content-member)|The content of the file.|
11+
||[name](/javascript/api/office-scripts/officescript/officescript.fileproperties#officescript-officescript-fileproperties-name-member)|The name of the file once downloaded.|
1012
|[MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties)|[attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member)|A file (such as a text file or Excel workbook) attached to a message.|
1113
||[bcc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-bcc-member)|The blind carbon copy (BCC) recipient or recipients of the email.|
1214
||[cc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-cc-member)|The carbon copy (CC) recipient or recipients of the email.|

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ export declare namespace OfficeScript {
33

44

55

6-
6+
7+
8+
9+
10+
711

812

913

generate-docs/office-scripts-link-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"includeEnums": false,
23
"linkConfigs": [
34
{
45
"name": "Office Scripts",

generate-docs/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"@microsoft/api-documenter": "^7.26.32",
66
"@microsoft/api-extractor": "^7.52.11",
77
"reference-coverage-tester": "^0.1.0",
8-
"versioned-d.ts-tools": "^0.6.0"
8+
"versioned-d.ts-tools": "^0.7.0"
99
}
1010
}

generate-docs/scripts/postprocessor.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import { generateEnumList } from './util';
44
import * as fsx from 'fs-extra';
55
import * as jsyaml from "js-yaml";
66
import * as path from "path";
7-
import * as os from "os";
8-
9-
const EOL = os.EOL;
107

118
interface Toc {
129
items: [
@@ -226,7 +223,7 @@ function cleanUpYmlFile(ymlFile: string): string {
226223

227224
// Add links for type aliases.
228225
if (apiYaml.uid.endsWith(":type")) {
229-
let remarks = `${EOL}${EOL}Learn more about the types in this type alias through the following links. ${EOL}${EOL}`
226+
let remarks = `\n\nLearn more about the types in this type alias through the following links. \n\n`
230227
apiYaml.syntax.substring(apiYaml.syntax.indexOf('=')).match(/[\w]+/g).forEach((match, matchIndex, matches) => {
231228
remarks += `[ExcelScript.${match}](/javascript/api/office-scripts/excelscript/excelscript.${match.toLowerCase()})`;
232229
if (matchIndex < matches.length - 1) {
@@ -236,7 +233,7 @@ function cleanUpYmlFile(ymlFile: string): string {
236233

237234
let exampleIndex = apiYaml.remarks.indexOf("#### Examples");
238235
if (exampleIndex > 0) {
239-
apiYaml.remarks = `${apiYaml.remarks.substring(0, exampleIndex)}${remarks}${EOL}${EOL}${apiYaml.remarks.substring(exampleIndex)}`;
236+
apiYaml.remarks = `${apiYaml.remarks.substring(0, exampleIndex)}${remarks}\n\n${apiYaml.remarks.substring(exampleIndex)}`;
240237
} else {
241238
apiYaml.remarks += remarks;
242239
}

0 commit comments

Comments
 (0)