[gapi.client.sheets] automatic update (#43734)

* automatic gapi.client.sheets update @ Wed, 08 Apr 2020 14:04:17 GMT

* automatic gapi.client.sheets update @ Wed, 08 Apr 2020 17:14:04 GMT

* automatic gapi.client.sheets update @ Wed, 08 Apr 2020 18:14:20 GMT

* automatic gapi.client.sheets update @ Wed, 08 Apr 2020 19:15:40 GMT
This commit is contained in:
Maxim Mazurok 2020-04-09 05:58:53 +10:00 committed by GitHub
parent 38f4a5a8ee
commit c0d93a8214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9854 additions and 816 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,12 @@
# TypeScript typings for Google Sheets API v4
Reads and writes Google Sheets.
For detailed description please check [documentation](https://developers.google.com/sheets/).
## Installing
Install typings for Google Sheets API:
```
npm install @types/gapi.client.sheets@v4 --save-dev
```
@ -12,46 +14,50 @@ npm install @types/gapi.client.sheets@v4 --save-dev
## Usage
You need to initialize Google API client in your code:
```typescript
gapi.load("client", () => {
// now we can use gapi.client
// ...
gapi.load('client', () => {
// now we can use gapi.client
// ...
});
```
Then load api client wrapper:
```typescript
gapi.client.load('sheets', 'v4', () => {
// now we can use gapi.client.sheets
// ...
// now we can use gapi.client.sheets
// ...
});
```
Don't forget to authenticate your client before sending any request to resources:
```typescript
```typescript
// declare client_id registered in Google Developers Console
var client_id = '',
scope = [
// See, edit, create, and delete all of your Google Drive files
'https://www.googleapis.com/auth/drive',
scope = [
// See, edit, create, and delete all of your Google Drive files
'https://www.googleapis.com/auth/drive',
// View and manage Google Drive files and folders that you have opened or created with this app
'https://www.googleapis.com/auth/drive.file',
// View and manage Google Drive files and folders that you have opened or created with this app
'https://www.googleapis.com/auth/drive.file',
// See and download all your Google Drive files
'https://www.googleapis.com/auth/drive.readonly',
// See and download all your Google Drive files
'https://www.googleapis.com/auth/drive.readonly',
// See, edit, create, and delete your spreadsheets in Google Drive
'https://www.googleapis.com/auth/spreadsheets',
// See, edit, create, and delete your spreadsheets in Google Drive
'https://www.googleapis.com/auth/spreadsheets',
// View your Google Spreadsheets
'https://www.googleapis.com/auth/spreadsheets.readonly',
// View your Google Spreadsheets
'https://www.googleapis.com/auth/spreadsheets.readonly',
],
immediate = true;
// ...
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
gapi.auth.authorize(
{ client_id: client_id, scope: scope, immediate: immediate },
authResult => {
if (authResult && !authResult.error) {
/* handle successful authorization */
} else {

View File

@ -1,24 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"gapi.client.sheets-tests.ts"
]
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": ["index.d.ts", "gapi.client.sheets-tests.ts"]
}

View File

@ -1,6 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"await-promise": false
}
}
"extends": "dtslint/dt.json"
}