Skip to content

Commit 3e5fd1e

Browse files
ElizabethSamuel-MSFTgithub-actions
andauthored
Automatically generated docs (#2067)
Co-authored-by: github-actions <[email protected]>
1 parent 6a1aae9 commit 3e5fd1e

File tree

97 files changed

+1439
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1439
-490
lines changed

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.connectortype.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ remarks: >-
2424
// start and end points. Then it names the shape.
2525
2626
await PowerPoint.run(async (context) => {
27-
const shapes = context.presentation.slides.getItemAt(0).shapes;
27+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
2828
2929
// For a line, left and top are the coordinates of the start point,
3030
// while height and width are the coordinates of the end point.
31-
const line = shapes.addLine(PowerPoint.ConnectorType.straight,
31+
const line: PowerPoint.Shape = shapes.addLine(PowerPoint.ConnectorType.straight,
3232
{
3333
left: 400,
3434
top: 200,

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.geometricshapetype.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ remarks: >-
2424
// location and size. Then it names the shape.
2525
2626
await PowerPoint.run(async (context) => {
27-
const shapes = context.presentation.slides.getItemAt(0).shapes;
28-
const hexagon = shapes.addGeometricShape(PowerPoint.GeometricShapeType.hexagon,
29-
{
30-
left: 100,
31-
top: 100,
32-
height: 150,
33-
width: 150
34-
});
27+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
28+
const shapeOptions: PowerPoint.ShapeAddOptions = {
29+
left: 100,
30+
top: 100,
31+
height: 150,
32+
width: 150
33+
};
34+
const hexagon: PowerPoint.Shape = shapes.addGeometricShape(PowerPoint.GeometricShapeType.hexagon, shapeOptions);
3535
hexagon.name = "Hexagon";
3636
3737
await context.sync();

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.insertslideformatting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ remarks: >-
1919
2020
await PowerPoint.run(async function(context) {
2121
// Get the ID of the first selected slide.
22-
const presentation = context.presentation;
23-
const selected = presentation.getSelectedSlides().getItemAt(0);
22+
const presentation: PowerPoint.Presentation = context.presentation;
23+
const selected: PowerPoint.Slide = presentation.getSelectedSlides().getItemAt(0);
2424
selected.load("id");
2525
await context.sync();
2626

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.insertslideoptions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ remarks: >-
1919
2020
await PowerPoint.run(async function(context) {
2121
// Get the ID of the first selected slide.
22-
const presentation = context.presentation;
23-
const selected = presentation.getSelectedSlides().getItemAt(0);
22+
const presentation: PowerPoint.Presentation = context.presentation;
23+
const selected: PowerPoint.Slide = presentation.getSelectedSlides().getItemAt(0);
2424
selected.load("id");
2525
await context.sync();
2626

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.presentation.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ remarks: >-
1919
2020
await PowerPoint.run(async function(context) {
2121
// Get the ID of the first selected slide.
22-
const presentation = context.presentation;
23-
const selected = presentation.getSelectedSlides().getItemAt(0);
22+
const presentation: PowerPoint.Presentation = context.presentation;
23+
const selected: PowerPoint.Slide = presentation.getSelectedSlides().getItemAt(0);
2424
selected.load("id");
2525
await context.sync();
2626
@@ -150,7 +150,7 @@ methods:
150150
// Arranges the selected shapes in a line from left to right.
151151
152152
await PowerPoint.run(async (context) => {
153-
const shapes = context.presentation.getSelectedShapes();
153+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
154154
const shapeCount = shapes.getCount();
155155
shapes.load("items");
156156
await context.sync();
@@ -178,7 +178,7 @@ methods:
178178
179179
await PowerPoint.run(async (context) => {
180180
let finalTable = "";
181-
const shapes = context.presentation.getSelectedShapes();
181+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
182182
const shapeCount = shapes.getCount();
183183
await context.sync();
184184
finalTable += "<br>getSelectedShapes.getCount returned:<b>" + shapeCount.value + "</b><br>";
@@ -203,15 +203,15 @@ methods:
203203
await PowerPoint.run(async (context) => {
204204
context.presentation.load("slides");
205205
await context.sync();
206-
const slides = context.presentation.getSelectedSlides();
206+
const slides: PowerPoint.SlideScopedCollection = context.presentation.getSelectedSlides();
207207
const slideCount = slides.getCount();
208208
slides.load("items");
209209
await context.sync();
210210
savedSlideSelection = [];
211211
slides.items.map((slide) => {
212212
savedSlideSelection.push(slide.id);
213213
});
214-
const shapes = context.presentation.getSelectedShapes();
214+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
215215
const shapeCount = shapes.getCount();
216216
shapes.load("items");
217217
await context.sync();
@@ -258,15 +258,15 @@ methods:
258258
const allSlidesCount = context.presentation.slides.getCount();
259259
context.presentation.slides.load("items");
260260
await context.sync();
261-
let allSlideItems = context.presentation.slides.items;
261+
let allSlideItems: PowerPoint.Slide[] = context.presentation.slides.items;
262262
allSlideItems.map((slide, index) => {
263263
allSlidesList[slide.id] = `Slide ${index + 1}`;
264264
});
265265
266266
if ($("#id-check-usenative").is(":checked")) {
267267
context.presentation.load("tags");
268268
}
269-
const slides = context.presentation.getSelectedSlides();
269+
const slides: PowerPoint.SlideScopedCollection = context.presentation.getSelectedSlides();
270270
const slideCount = slides.getCount();
271271
slides.load("items");
272272
await context.sync();
@@ -291,7 +291,7 @@ methods:
291291
let finalTable = "";
292292
context.presentation.load("slides");
293293
await context.sync();
294-
const slides = context.presentation.getSelectedSlides();
294+
const slides: PowerPoint.SlideScopedCollection = context.presentation.getSelectedSlides();
295295
const slideCount = slides.getCount();
296296
await context.sync();
297297
finalTable += "<br>getSelectedSlides.getCount returned:<b>" + slideCount.value + "</b><br>";
@@ -340,7 +340,7 @@ methods:
340340
// Gets the selected text range and prints data about the range on the task pane.
341341
342342
await PowerPoint.run(async (context) => {
343-
const textRange = context.presentation.getSelectedTextRange();
343+
const textRange: PowerPoint.TextRange = context.presentation.getSelectedTextRange();
344344
try {
345345
await context.sync();
346346
} catch (error) {
@@ -379,9 +379,9 @@ methods:
379379
// Sets the range selection to the range that was saved previously.
380380
381381
await PowerPoint.run(async (context) => {
382-
const slide1 = context.presentation.slides.getItem(savedTextSlideSelection[0]);
383-
const shape1 = slide1.shapes.getItem(savedTextShapeSelection[0]);
384-
const textRange = shape1.textFrame.textRange.getSubstring(savedTextTextRangeStart, savedTextTextRangeLength);
382+
const slide1: PowerPoint.Slide = context.presentation.slides.getItem(savedTextSlideSelection[0]);
383+
const shape1: PowerPoint.Shape = slide1.shapes.getItem(savedTextShapeSelection[0]);
384+
const textRange: PowerPoint.TextRange = shape1.textFrame.textRange.getSubstring(savedTextTextRangeStart, savedTextTextRangeLength);
385385
textRange.setSelected();
386386
await context.sync();
387387
});
@@ -429,8 +429,8 @@ methods:
429429
430430
await PowerPoint.run(async function(context) {
431431
// Get the ID of the first selected slide.
432-
const presentation = context.presentation;
433-
const selected = presentation.getSelectedSlides().getItemAt(0);
432+
const presentation: PowerPoint.Presentation = context.presentation;
433+
const selected: PowerPoint.Slide = presentation.getSelectedSlides().getItemAt(0);
434434
selected.load("id");
435435
await context.sync();
436436
@@ -563,9 +563,9 @@ methods:
563563
await PowerPoint.run(async (context) => {
564564
context.presentation.load("slides");
565565
await context.sync();
566-
const slide2 = context.presentation.slides.getItemAt(1);
567-
const slide4 = context.presentation.slides.getItemAt(3);
568-
const slide5 = context.presentation.slides.getItemAt(4);
566+
const slide2: PowerPoint.Slide = context.presentation.slides.getItemAt(1);
567+
const slide4: PowerPoint.Slide = context.presentation.slides.getItemAt(3);
568+
const slide5: PowerPoint.Slide = context.presentation.slides.getItemAt(4);
569569
slide2.load("id");
570570
slide4.load("id");
571571
slide5.load("id");

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.shape.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ remarks: >-
2121
2222
await PowerPoint.run(async (context) => {
2323
// Get the type of shape for every shape in the collection.
24-
const shapes = context.presentation.slides.getItemAt(0).shapes;
24+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
2525
shapes.load("type");
2626
await context.sync();
2727
@@ -88,7 +88,7 @@ properties:
8888
// Changes the selected shapes fill color to red.
8989
9090
await PowerPoint.run(async (context) => {
91-
const shapes = context.presentation.getSelectedShapes();
91+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
9292
const shapeCount = shapes.getCount();
9393
shapes.load("items");
9494
await context.sync();
@@ -128,7 +128,7 @@ properties:
128128
// Arranges the selected shapes in a line from left to right.
129129
130130
await PowerPoint.run(async (context) => {
131-
const shapes = context.presentation.getSelectedShapes();
131+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
132132
const shapeCount = shapes.getCount();
133133
shapes.load("items");
134134
await context.sync();
@@ -188,7 +188,7 @@ properties:
188188
// Arranges the selected shapes in a line from left to right.
189189
190190
await PowerPoint.run(async (context) => {
191-
const shapes = context.presentation.getSelectedShapes();
191+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
192192
const shapeCount = shapes.getCount();
193193
shapes.load("items");
194194
await context.sync();
@@ -284,7 +284,7 @@ properties:
284284
// Arranges the selected shapes in a line from left to right.
285285
286286
await PowerPoint.run(async (context) => {
287-
const shapes = context.presentation.getSelectedShapes();
287+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
288288
const shapeCount = shapes.getCount();
289289
shapes.load("items");
290290
await context.sync();
@@ -333,7 +333,7 @@ properties:
333333
334334
await PowerPoint.run(async (context) => {
335335
// Get the type of shape for every shape in the collection.
336-
const shapes = context.presentation.slides.getItemAt(0).shapes;
336+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
337337
shapes.load("type");
338338
await context.sync();
339339
@@ -378,7 +378,7 @@ properties:
378378
// Arranges the selected shapes in a line from left to right.
379379
380380
await PowerPoint.run(async (context) => {
381-
const shapes = context.presentation.getSelectedShapes();
381+
const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
382382
const shapeCount = shapes.getCount();
383383
shapes.load("items");
384384
await context.sync();
@@ -411,7 +411,38 @@ methods:
411411
package: powerpoint!
412412
fullName: delete()
413413
summary: Deletes the shape from the shape collection. Does nothing if the shape does not exist.
414-
remarks: '\[ [API set: PowerPointApi 1.3](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets) \]'
414+
remarks: >-
415+
\[ [API set: PowerPointApi 1.3](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets) \]
416+
417+
418+
#### Examples
419+
420+
421+
```TypeScript
422+
423+
// Link to full sample:
424+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/shapes.yaml
425+
426+
427+
// This function gets the collection of shapes on the first slide,
428+
429+
// and then iterates through them, deleting each one.
430+
431+
await PowerPoint.run(async (context) => {
432+
const slide: PowerPoint.Slide = context.presentation.slides.getItemAt(0);
433+
const shapes: PowerPoint.ShapeCollection = slide.shapes;
434+
435+
// Load all the shapes in the collection without loading their properties.
436+
shapes.load("items/$none");
437+
438+
await context.sync();
439+
440+
shapes.items.forEach((shape) => shape.delete());
441+
442+
await context.sync();
443+
});
444+
445+
```
415446
isPreview: false
416447
isDeprecated: false
417448
syntax:

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.shapeaddoptions.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,40 @@ uid: 'powerpoint!PowerPoint.ShapeAddOptions:interface'
44
package: powerpoint!
55
fullName: PowerPoint.ShapeAddOptions
66
summary: Represents the available options when adding shapes.
7-
remarks: '\[ [API set: PowerPointApi 1.4](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets) \]'
7+
remarks: >-
8+
\[ [API set: PowerPointApi 1.4](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets) \]
9+
10+
11+
#### Examples
12+
13+
14+
```TypeScript
15+
16+
// Link to full sample:
17+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/shapes.yaml
18+
19+
20+
// This function gets the collection of shapes on the first slide,
21+
22+
// and adds a hexagon shape to the collection, while specifying its
23+
24+
// location and size. Then it names the shape.
25+
26+
await PowerPoint.run(async (context) => {
27+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
28+
const shapeOptions: PowerPoint.ShapeAddOptions = {
29+
left: 100,
30+
top: 100,
31+
height: 150,
32+
width: 150
33+
};
34+
const hexagon: PowerPoint.Shape = shapes.addGeometricShape(PowerPoint.GeometricShapeType.hexagon, shapeOptions);
35+
hexagon.name = "Hexagon";
36+
37+
await context.sync();
38+
});
39+
40+
```
841
isPreview: false
942
isDeprecated: false
1043
type: interface

0 commit comments

Comments
 (0)