mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
This PR updates Google Apps Script types. (2017-05-12 -> 2018-07-11) This is a generated type definition. CC: @erickoledadevrel --- - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). ``` npm run lint google-apps-script definitely-typed@0.0.2 lint /Users/timmerman/Documents/github/DefinitelyTyped dtslint types "google-apps-script" # No result. ``` If changing an existing definition: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://developers.google.com/apps-script/reference/ - [x] Increase the version number in the header if appropriate. - The version should be bumped by the publisher. - [x] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`.
28 lines
905 B
TypeScript
28 lines
905 B
TypeScript
// from https://developers.google.com/apps-script/overview
|
|
function createAndSendDocument() {
|
|
// Create a new Google Doc named 'Hello, world!'
|
|
var doc = DocumentApp.create('Hello, world!');
|
|
|
|
// Access the body of the document, then add a paragraph.
|
|
doc.getBody().appendParagraph('This document was created by Google Apps Script.');
|
|
|
|
// Get the URL of the document.
|
|
var url = doc.getUrl();
|
|
|
|
// Get the email address of the active user - that's you.
|
|
var email = Session.getActiveUser().getEmail();
|
|
|
|
// Get the name of the document to use as an email subject line.
|
|
var subject = doc.getName();
|
|
|
|
// Append a new string to the "url" variable to use as an email body.
|
|
var body = 'Link to your doc: ' + url;
|
|
|
|
// Send yourself an email with a link to the document.
|
|
GmailApp.sendEmail(email, subject, body);
|
|
}
|
|
|
|
// Regression
|
|
ScriptApp.getService().getUrl();
|
|
CalendarApp.GuestStatus.NO;
|