weboffice-js-sdk 2.0.3-beta.12 → 2.0.3-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -422,19 +422,27 @@ export type PresentationInsertShapeOptions = (PresentationShapeBaseOptions & {
422
422
  type: PresentationLineShapeType;
423
423
  content?: never;
424
424
  }) | (PresentationShapeBaseOptions & {
425
- type: Exclude<PresentationShapeType, PresentationLineShapeType>;
425
+ type: PresentationTextShapeType;
426
426
  content?: PresentationShapeContent;
427
427
  });
428
- export interface PresentationShape {
428
+ export interface PresentationShapeBase {
429
429
  id: string;
430
430
  name: string;
431
431
  type: PresentationShapeType;
432
- textContent?: string;
433
432
  setFill: (fill: PresentationShapeFill) => void;
434
433
  setLine: (line: PresentationShapeLine) => void;
435
434
  setLayout: (layout: PresentationShapeLayout) => void;
436
435
  remove: () => void;
437
436
  }
437
+ export type PresentationTextShapeType = Exclude<PresentationShapeType, PresentationLineShapeType>;
438
+ export interface PresentationTextShape extends PresentationShapeBase {
439
+ type: PresentationTextShapeType;
440
+ textContent?: string;
441
+ setContent: (content: PresentationShapeContent) => void;
442
+ appendText: (text: string) => void;
443
+ appendParagraphs: (paragraphs: PresentationParagraph[]) => void;
444
+ }
445
+ export type PresentationShape = PresentationShapeBase | PresentationTextShape;
438
446
  export type PresentationParagraphLineSpacing = 0.9 | 1.0 | 1.15 | 1.5 | 2.0 | 2.5 | 3.0;
439
447
  export interface PresentationTableCell {
440
448
  setStyle: (style: PresentationTableCellStyle) => void;
@@ -726,8 +734,15 @@ export interface PresentationSlideFacade {
726
734
  getIndex: () => Promise<number>;
727
735
  getShapes: () => Promise<PresentationShape[]>;
728
736
  getTables: () => Promise<PresentationTableItem[]>;
729
- insertShape: (options: PresentationInsertShapeOptions) => Promise<PresentationShape>;
730
- insertTextBox: (options: PresentationTextBoxOptions) => Promise<PresentationShape>;
737
+ insertShape: {
738
+ (options: Extract<PresentationInsertShapeOptions, {
739
+ type: PresentationLineShapeType;
740
+ }>): Promise<PresentationShapeBase>;
741
+ (options: Extract<PresentationInsertShapeOptions, {
742
+ type: PresentationTextShapeType;
743
+ }>): Promise<PresentationTextShape>;
744
+ };
745
+ insertTextBox: (options: PresentationTextBoxOptions) => Promise<PresentationTextShape>;
731
746
  insertTable: (options: PresentationTableOptions) => Promise<PresentationTableItem>;
732
747
  insertImage: (image: File, size?: PresentationSize, offset?: PresentationOffset) => Promise<void>;
733
748
  insertAudio: (data: File, size?: PresentationSize, offset?: PresentationOffset, name?: string) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { AddChartFromSelectionResult, DocsRangeFacade, DocsRangeValue, DocsTableFacade, EditorTextFormat, OfficeSDK, PresentationSlideFacade, PresentationShape, PresentationTextRangeFacade, PresentationTextRangeValue, SheetRangeValue, SheetRangeFacade, SheetSelection } from './OfficeSDK';
1
+ import type { AddChartFromSelectionResult, DocsRangeFacade, DocsRangeValue, DocsTableFacade, EditorTextFormat, OfficeSDK, PresentationSlideFacade, PresentationShape, PresentationShapeBase, PresentationTextShape, PresentationTextRangeFacade, PresentationTextRangeValue, SheetRangeValue, SheetRangeFacade, SheetSelection } from './OfficeSDK';
2
2
  type IsAssignable<T, U> = T extends U ? true : false;
3
3
  type Assert<T extends true> = T;
4
4
  type RootSelection = NonNullable<OfficeSDK['selection']>;
@@ -28,6 +28,13 @@ export type EditorFacadeContractAssertions = [
28
28
  Assert<IsAssignable<NonNullable<OfficeSDK['workbook']>['getWorksheets'], () => Promise<import('./OfficeSDK').SheetWorksheetFacade[]>>>,
29
29
  Assert<IsAssignable<NonNullable<OfficeSDK['activeSheet']>['getCell'], (row: number, column: number) => Promise<import('./OfficeSDK').SheetCellFacade | null>>>,
30
30
  Assert<IsAssignable<NonNullable<OfficeSDK['slides']>['getCurrentSlide'], () => Promise<PresentationSlideFacade>>>,
31
+ Assert<IsAssignable<PresentationSlideFacade['insertTextBox'], (options: import('./OfficeSDK').PresentationTextBoxOptions) => Promise<PresentationTextShape>>>,
32
+ Assert<IsAssignable<PresentationSlideFacade['insertShape'], (options: Extract<import('./OfficeSDK').PresentationInsertShapeOptions, {
33
+ type: import('./OfficeSDK').PresentationLineShapeType;
34
+ }>) => Promise<PresentationShapeBase>>>,
35
+ Assert<IsAssignable<PresentationSlideFacade['insertShape'], (options: Extract<import('./OfficeSDK').PresentationInsertShapeOptions, {
36
+ type: import('./OfficeSDK').PresentationTextShapeType;
37
+ }>) => Promise<PresentationTextShape>>>,
31
38
  Assert<IsAssignable<NonNullable<OfficeSDK['text']>['apply'], (format: Partial<EditorTextFormat>, range?: PresentationTextRangeValue) => Promise<Partial<EditorTextFormat>>>>,
32
39
  Assert<IsAssignable<NonNullable<OfficeSDK['activeSheet']>['getSelections'], () => Promise<SheetSelection[] | null>>>,
33
40
  Assert<IsAssignable<NonNullable<OfficeSDK['activeSheet']>['getRange'], (value: SheetRangeValue) => Promise<SheetRangeFacade | null>>>,