0.0.20240430 • Published 4 days ago

@maxim_mazurok/gapi.client.slides-v1 v0.0.20240430

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

TypeScript typings for Google Slides API v1

Reads and writes Google Slides presentations. For detailed description please check documentation.

Installing

Install typings for Google Slides API:

npm install @types/gapi.client.slides-v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://slides.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.slides
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('slides', 'v1', () => {
  // now we can use:
  // gapi.client.slides
});

Don't forget to authenticate your client before sending any request to resources:

// 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',

    // See, edit, create, and delete only the specific Google Drive files you use 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, edit, create, and delete all your Google Slides presentations
    'https://www.googleapis.com/auth/presentations',

    // See all your Google Slides presentations
    'https://www.googleapis.com/auth/presentations.readonly',

    // See, edit, create, and delete all your Google Sheets spreadsheets
    'https://www.googleapis.com/auth/spreadsheets',

    // See all your Google Sheets spreadsheets
    'https://www.googleapis.com/auth/spreadsheets.readonly',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Google Slides API resources:

/*
Applies one or more updates to the presentation. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies: the reply to the third request, and another empty reply, in that order. Because other users may be editing the presentation, the presentation might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the presentation should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.
*/
await gapi.client.slides.presentations.batchUpdate({
  presentationId: 'presentationId',
});

/*
Creates a blank presentation using the title given in the request. If a `presentationId` is provided, it is used as the ID of the new presentation. Otherwise, a new ID is generated. Other fields in the request, including any provided content, are ignored. Returns the created presentation.
*/
await gapi.client.slides.presentations.create({});

/*
Gets the latest version of the specified presentation.
*/
await gapi.client.slides.presentations.get({presentationId: 'presentationId'});
0.0.20240430

4 days ago

0.0.20240423

11 days ago

0.0.20240416

18 days ago

0.0.20240415

24 days ago

0.0.20240402

1 month ago

0.0.20240326

1 month ago

0.0.20240319

2 months ago

0.0.20240318

2 months ago

0.0.20240312

2 months ago

0.0.20240305

2 months ago

0.0.20240229

2 months ago

0.0.20240220

2 months ago

0.0.20240213

3 months ago

0.0.20240209

3 months ago

0.0.20240202

3 months ago

0.0.20240130

3 months ago

0.0.20240129

3 months ago

0.0.20240116

4 months ago

0.0.20240108

4 months ago

0.0.20231216

5 months ago

0.0.20231212

5 months ago

0.0.20231205

5 months ago

0.0.20231128

5 months ago

0.0.20230816

9 months ago

0.0.20231109

6 months ago

0.0.20231031

6 months ago

0.0.20231115

6 months ago

0.0.20230808

9 months ago

0.0.20230926

7 months ago

0.0.20230920

8 months ago

0.0.20230722

10 months ago

0.0.20231017

7 months ago

0.0.20230801

9 months ago

0.0.20230725

10 months ago

0.0.20231024

7 months ago

0.0.20230711

10 months ago

0.0.20231011

7 months ago

0.0.20230829

8 months ago

0.0.20230905

8 months ago

0.0.20230627

10 months ago

0.0.20230705

10 months ago

0.0.20230824

9 months ago

0.0.20231003

7 months ago

0.0.20230620

11 months ago

0.0.20230613

11 months ago

0.0.20230511

12 months ago

0.0.20230517

12 months ago

0.0.20230502

1 year ago

0.0.20230425

1 year ago

0.0.20230606

11 months ago

0.0.20230526

12 months ago

0.0.20230530

11 months ago

0.0.20230412

1 year ago

0.0.20230314

1 year ago

0.0.20230418

1 year ago

0.0.20230321

1 year ago

0.0.20230227

1 year ago

0.0.20230404

1 year ago

0.0.20230228

1 year ago

0.0.20230328

1 year ago

0.0.20230307

1 year ago

0.0.20230124

1 year ago

0.0.20230221

1 year ago

0.0.20230209

1 year ago

0.0.20230131

1 year ago

0.0.20221115

1 year ago

0.0.20221213

1 year ago

0.0.20230119

1 year ago

0.0.20221208

1 year ago

0.0.20221108

1 year ago

0.0.20230104

1 year ago

0.0.20221103

2 years ago

0.0.20221201

1 year ago

0.0.20221219

1 year ago

0.0.20230111

1 year ago

0.0.20221031

2 years ago

0.0.20221004

2 years ago

0.0.20221014

2 years ago

0.0.20221012

2 years ago

0.0.20220928

2 years ago

0.0.20221018

2 years ago

0.0.20220917

2 years ago

0.0.20220818

2 years ago

0.0.20220830

2 years ago

0.0.20220920

2 years ago

0.0.20220823

2 years ago

0.0.20220913

2 years ago

0.0.20220915

2 years ago

0.0.20220808

2 years ago

0.0.20220802

2 years ago