Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions types/office-js-preview/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186771,6 +186771,16 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.0]
*/
readonly title: string;
/**
* Returns the current active {@link PowerPoint.Slide} that is visible in the editing area.
If there's no active slide, an object with an `isNullObject` property set to `true` is returned.
For further information, see {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
getActiveSlideOrNullObject(): PowerPoint.Slide;
/**
* Returns the selected shapes in the current slide of the presentation.
If no shapes are selected, an empty collection is returned.
Expand Down Expand Up @@ -194782,6 +194792,29 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.4]
*/
readonly textFrame: PowerPoint.TextFrame;
/**
* The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription: string;
/**
* The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle: string;
/**
* Gets the creation ID of the shape. Returns `null` if the shape has no creation ID.
*
Expand All @@ -194804,6 +194837,17 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.3]
*/
readonly id: string;
/**
* Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative: boolean;
/**
* The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down Expand Up @@ -196551,13 +196595,47 @@ declare namespace PowerPoint {
}
/** An interface for updating data on the `Shape` object, for use in `shape.set({ ... })`. */
interface ShapeUpdateData {
/**
* The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription?: string;
/**
* The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle?: string;
/**
* Specifies the height, in points, of the shape. Throws an `InvalidArgument` exception when set with a negative value.
*
* @remarks
* [Api set: PowerPointApi 1.4]
*/
height?: number;
/**
* Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative?: boolean;
/**
* The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down Expand Up @@ -197653,6 +197731,29 @@ declare namespace PowerPoint {
}
/** An interface describing the data returned by calling `shape.toJSON()`. */
interface ShapeData {
/**
* The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription?: string;
/**
* The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle?: string;
/**
* Gets the creation ID of the shape. Returns `null` if the shape has no creation ID.
*
Expand All @@ -197675,6 +197776,17 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.3]
*/
id?: string;
/**
* Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative?: boolean;
/**
* The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down Expand Up @@ -199185,6 +199297,29 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.4]
*/
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* For EACH ITEM in the collection: The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription?: boolean;
/**
* For EACH ITEM in the collection: The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle?: boolean;
/**
* For EACH ITEM in the collection: Gets the creation ID of the shape. Returns `null` if the shape has no creation ID.
*
Expand All @@ -199207,6 +199342,17 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.3]
*/
id?: boolean;
/**
* For EACH ITEM in the collection: Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative?: boolean;
/**
* For EACH ITEM in the collection: The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down Expand Up @@ -199785,6 +199931,29 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.5]
*/
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* For EACH ITEM in the collection: The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription?: boolean;
/**
* For EACH ITEM in the collection: The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle?: boolean;
/**
* For EACH ITEM in the collection: Gets the creation ID of the shape. Returns `null` if the shape has no creation ID.
*
Expand All @@ -199807,6 +199976,17 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.3]
*/
id?: boolean;
/**
* For EACH ITEM in the collection: Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative?: boolean;
/**
* For EACH ITEM in the collection: The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down Expand Up @@ -200033,6 +200213,29 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.4]
*/
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* The alt text description of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextDescription?: boolean;
/**
* The alt text title of the Shape.

Alt text provides alternative, text-based representations of the information contained in the Shape.
This information is useful for people with vision or cognitive impairments who may not be able to see or understand the shape.
A title can be read to a person with a disability and is used to determine whether they wish to hear the description of the content.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
altTextTitle?: boolean;
/**
* Gets the creation ID of the shape. Returns `null` if the shape has no creation ID.
*
Expand All @@ -200055,6 +200258,17 @@ declare namespace PowerPoint {
* [Api set: PowerPointApi 1.3]
*/
id?: boolean;
/**
* Represents whether the shape is decorative or not.

Decorative objects add visual interest but aren't informative (e.g. stylistic borders).
People using screen readers will hear these are decorative so they know they aren't missing any important information.
*
* @remarks
* [Api set: PowerPointApi BETA (PREVIEW ONLY)]
* @beta
*/
isDecorative?: boolean;
/**
* The distance, in points, from the left side of the shape to the left side of the slide.
*
Expand Down
1 change: 1 addition & 0 deletions types/wordpress__block-editor/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export * from "./font-sizes";
export { default as InnerBlocks, useInnerBlocksProps } from "./inner-blocks";
export { default as InspectorAdvancedControls } from "./inspector-advanced-controls";
export { default as InspectorControls } from "./inspector-controls";
export { default as LinkControl } from "./link-control";
export { default as MediaPlaceholder } from "./media-placeholder";
export { default as MediaUpload } from "./media-upload";
export { default as MediaUploadCheck } from "./media-upload/check";
Expand Down
52 changes: 52 additions & 0 deletions types/wordpress__block-editor/components/link-control.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { ComponentType, ReactNode } from "react";

interface WPLinkControlDefaultValue {
url?: string;
title?: string;
opensInNewTab?: boolean;
}

interface WPLinkControlSettingsValue {
[setting: string]: any;
}

declare namespace LinkControl {
interface Props {
settings?: Setting[];
forceIsEditingLink?: boolean;
value?: Value;
onChange?: (nextValue?: Value) => void;
onRemove?: () => void;
onCancel?: () => void;

noDirectEntry?: boolean;
showSuggestions?: boolean;
showInitialSuggestions?: boolean;
withCreateSuggestion?: boolean;
suggestionsQuery?: any;
noURLSuggestion?: boolean;
hasTextControl?: boolean;
createSuggestion?: ((title: string) => Suggestion) | undefined;
createSuggestionButtonText?: string | ((searchTerm: string | undefined) => ReactNode);
renderControlBottom?: () => ReactNode;
handleEntities?: boolean;
hasRichPreviews?: boolean;
}

interface Setting {
id: string;
title: string;
}

interface Suggestion {
id: string;
type: string;
title: string;
url: string;
}

interface Value extends WPLinkControlDefaultValue, WPLinkControlSettingsValue {}
}
declare const LinkControl: ComponentType<LinkControl.Props> & { DEFAULT_LINK_SETTINGS: LinkControl.Setting[] };

export default LinkControl;
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ be.withFontSizes("fontSize")(() => <h1>Hello World</h1>);
<be.InspectorControls group={"styles"}>Hello World</be.InspectorControls>;
<be.InspectorControls.Slot />;

//
// link-control
//
<be.LinkControl
onChange={item => console.log(item)}
onRemove={() => console.log("removed")}
settings={be.LinkControl.DEFAULT_LINK_SETTINGS}
/>;

//
// media-placeholder
//
Expand Down