presenter 0.9.0 → 0.9.2

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.
@@ -0,0 +1,18 @@
1
+ import { Size } from '../../../../types/Size';
2
+ import { TextUnitMeasurement } from './getTextUnitMeasurements';
3
+ export interface TextLineLayout extends Size {
4
+ readonly baselineY: number;
5
+ readonly bottom: number;
6
+ readonly lineAdvance: number;
7
+ readonly top: number;
8
+ }
9
+ export interface TextLayout {
10
+ readonly lines: readonly TextLineLayout[];
11
+ readonly size: Size;
12
+ }
13
+ /**
14
+ * Computes text block bounds and per-line baseline positions.
15
+ *
16
+ * Accepts as input per-line measurements for each text unit, plus a desired line spacing.
17
+ */
18
+ export declare function getTextLayout(lineMeasurements: readonly (readonly TextUnitMeasurement[])[], lineSpacing?: number): TextLayout;
@@ -5,6 +5,7 @@ import { UnifiedCanvasContext } from '../../types/UnifiedCanvasContext';
5
5
  export interface TextUnitMeasurement extends Size {
6
6
  readonly baselineShift: number;
7
7
  readonly bottom: number;
8
+ readonly lineAdvance: number;
8
9
  readonly top: number;
9
10
  }
10
11
  export declare function getTextUnitMeasurements(textUnits: TextUnit[][], style: TextStyle, ctx: UnifiedCanvasContext): TextUnitMeasurement[][];
@@ -3,5 +3,6 @@ export interface BaseUnitSlideAnimation {
3
3
  readonly type: AnimationType;
4
4
  /** Indicates whether this animation is a key animation to be included in exports. */
5
5
  readonly isKey: boolean;
6
+ readonly notes: string | null;
6
7
  readonly shortcut: string | string[] | null;
7
8
  }
@@ -4,4 +4,5 @@ export interface Pause extends BaseUnitSlideAnimation {
4
4
  readonly type: typeof AnimationType.PAUSE;
5
5
  readonly duration: number;
6
6
  }
7
- export declare function Pause(duration?: number): Pause;
7
+ export type PauseParams = Partial<Omit<Pause, "duration" | "type">>;
8
+ export declare function Pause(duration?: number, pauseParams?: PauseParams): Pause;
@@ -8,6 +8,7 @@ export interface Slide {
8
8
  readonly isAllKey: boolean;
9
9
  readonly isEndKey: boolean;
10
10
  readonly isStartKey: boolean;
11
+ readonly notes: string | null;
11
12
  readonly shortcut: string | string[] | null;
12
13
  readonly title: string;
13
14
  }
@@ -0,0 +1,16 @@
1
+ import { Slide } from '../../types/Slide';
2
+ /**
3
+ * Returns the speaker notes for a slide at a given build index, carrying forward notes from earlier
4
+ * builds if necessary.
5
+ */
6
+ export declare function getSpeakerNotes(slide: Slide, buildIndex: number): string | null;
7
+ /**
8
+ * Returns only the notes attached directly to a build, without carrying notes forward from an
9
+ * earlier build.
10
+ */
11
+ export declare function getSpeakerNotesForBuild(slide: Slide, buildIndex: number): string | null;
12
+ /**
13
+ * Returns all notes attached to the inclusive range of builds without carrying notes forward from
14
+ * before the range.
15
+ */
16
+ export declare function getSpeakerNotesForBuildRange(slide: Slide, startBuildIndex: number, endBuildIndex: number): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presenter",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "A JavaScript presentation library",
5
5
  "main": "dist/presenter.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { Size } from '../../types/Size';
2
- /**
3
- * Computes the combined size of a 2D array of sizes.
4
- *
5
- * If a line spacing is provided, it's added
6
- */
7
- export declare function getCombinedSizes2D(sizes: Size[][], lineSpacing?: number): Size;