mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[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:
parent
38f4a5a8ee
commit
c0d93a8214
File diff suppressed because it is too large
Load Diff
1458
types/gapi.client.sheets/index.d.ts
vendored
1458
types/gapi.client.sheets/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -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 {
|
||||
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"await-promise": false
|
||||
}
|
||||
}
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user