presenter 0.5.4 → 0.6.0
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.
- package/README.md +0 -54
- package/dist/eslint.config.d.mts +2 -0
- package/dist/export.js +1 -0
- package/dist/jest.config.d.ts +0 -2
- package/dist/presenter.js +1 -1
- package/dist/src/constructors/Grid.d.ts +21 -0
- package/dist/src/export/image-renderer/ImageRenderer.d.ts +9 -0
- package/dist/src/export/image-renderer/types/ImageRendererProps.d.ts +26 -0
- package/dist/src/export/image-renderer/types/ImageRendererState.d.ts +8 -0
- package/dist/src/export/index.d.ts +2 -24
- package/dist/src/export/pdf-renderer/PDFRenderer.d.ts +10 -0
- package/dist/src/export/pdf-renderer/types/PDFRendererProps.d.ts +8 -0
- package/dist/src/export/pdf-renderer/types/PDFRendererState.d.ts +5 -0
- package/dist/src/export/utils/createCanvasElement.d.ts +3 -0
- package/dist/src/export/utils/createPath2D.d.ts +2 -0
- package/dist/src/export/utils/loadPresentationImages.d.ts +2 -0
- package/dist/src/index.d.ts +43 -25
- package/dist/src/navigator/openNavigator.d.ts +8 -0
- package/dist/src/objects/Arrow.d.ts +18 -0
- package/dist/src/objects/Circle.d.ts +16 -0
- package/dist/src/objects/Group.d.ts +17 -0
- package/dist/src/objects/Image.d.ts +15 -0
- package/dist/src/objects/Line.d.ts +15 -0
- package/dist/src/objects/Mask.d.ts +15 -0
- package/dist/src/objects/Path.d.ts +19 -0
- package/dist/src/objects/Polygon.d.ts +13 -0
- package/dist/src/objects/Rectangle.d.ts +18 -0
- package/dist/src/objects/Text.d.ts +25 -0
- package/dist/src/renderer/browser-canvas/BrowserCanvasRenderer.d.ts +12 -0
- package/dist/src/renderer/browser-canvas/objects/renderArrow.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderCircle.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderGroup.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderImage.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderLine.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderMask.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderPath.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderPolygon.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderRectangle.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/objects/renderText.d.ts +3 -0
- package/dist/src/renderer/browser-canvas/types/BrowserCanvasObjectRenderer.d.ts +13 -0
- package/dist/src/renderer/browser-canvas/types/BrowserCanvasRendererProps.d.ts +9 -0
- package/dist/src/renderer/browser-canvas/types/BrowserCanvasRendererState.d.ts +16 -0
- package/dist/src/renderer/browser-canvas/types/UnifiedCanvasContext.d.ts +18 -0
- package/dist/src/renderer/browser-canvas/types/UnifiedImage.d.ts +18 -0
- package/dist/src/renderer/browser-canvas/types/UnifiedPath2D.d.ts +18 -0
- package/dist/src/renderer/browser-canvas/utils/clearCanvas.d.ts +2 -0
- package/dist/src/renderer/browser-canvas/utils/createCanvasElement.d.ts +2 -0
- package/dist/src/renderer/browser-canvas/utils/createPath2D.d.ts +2 -0
- package/dist/src/renderer/browser-canvas/utils/defaultObjectRenderers.d.ts +10 -0
- package/dist/src/renderer/browser-canvas/utils/drawStroke.d.ts +15 -0
- package/dist/src/renderer/browser-canvas/utils/fillPath.d.ts +11 -0
- package/dist/src/renderer/browser-canvas/utils/getPathFromPoints.d.ts +4 -0
- package/dist/src/renderer/browser-canvas/utils/getSizeFromTextMetrics.d.ts +2 -0
- package/dist/src/renderer/browser-canvas/utils/loadPresentationImages.d.ts +2 -0
- package/dist/src/renderer/browser-canvas/utils/text/getTextUnitMeasurements.d.ts +5 -0
- package/dist/src/renderer/browser-canvas/utils/text/setContextWithTextStyle.d.ts +3 -0
- package/dist/src/types/Alignment.d.ts +7 -0
- package/dist/src/types/Anchor.d.ts +13 -0
- package/dist/src/types/Animate.d.ts +18 -0
- package/dist/src/types/AnimationType.d.ts +9 -0
- package/dist/src/types/BaseUnitSlideAnimation.d.ts +7 -0
- package/dist/src/types/BoundingBox.d.ts +10 -0
- package/dist/src/types/Color.d.ts +23 -0
- package/dist/src/types/Easing.d.ts +10 -0
- package/dist/src/types/EasingFunction.d.ts +2 -0
- package/dist/src/types/FontStyle.d.ts +8 -0
- package/dist/src/types/FontWeight.d.ts +13 -0
- package/dist/src/types/Interpolator.d.ts +7 -0
- package/dist/src/types/ObjectType.d.ts +14 -0
- package/dist/src/types/PathWithLength.d.ts +5 -0
- package/dist/src/types/Pause.d.ts +7 -0
- package/dist/src/types/Position.d.ts +6 -0
- package/dist/src/types/Presentation.d.ts +17 -0
- package/dist/src/types/Resources.d.ts +5 -0
- package/dist/src/types/ShortcutState.d.ts +13 -0
- package/dist/src/types/Size.d.ts +6 -0
- package/dist/src/types/Slide.d.ts +12 -0
- package/dist/src/types/SlideAnimation.d.ts +6 -0
- package/dist/src/types/SlideObject.d.ts +5 -0
- package/dist/src/types/TextContent.d.ts +2 -0
- package/dist/src/types/TextStyle.d.ts +12 -0
- package/dist/src/types/TextUnit.d.ts +6 -0
- package/dist/src/types/Update.d.ts +9 -0
- package/dist/src/utils/animate/getSlideAnimationDuration.d.ts +2 -0
- package/dist/src/utils/animate/updateObjectStateWithAnimation.d.ts +13 -0
- package/dist/src/utils/color/Opaque.d.ts +2 -0
- package/dist/src/utils/color/Transparent.d.ts +2 -0
- package/dist/src/utils/color/getAlphaForColor.d.ts +6 -0
- package/dist/src/utils/color/getHexStringForColor.d.ts +2 -0
- package/dist/src/utils/color/getRgbStringForColor.d.ts +2 -0
- package/dist/src/utils/core/assertNever.d.ts +1 -0
- package/dist/src/utils/interpolate/defaultInterpolators.d.ts +2 -0
- package/dist/src/utils/interpolate/getSmoothPathInterpolator.d.ts +2 -0
- package/dist/src/utils/interpolate/interpolate.d.ts +3 -0
- package/dist/src/utils/interpolate/interpolateColor.d.ts +3 -0
- package/dist/src/utils/interpolate/interpolateFallback.d.ts +3 -0
- package/dist/src/utils/interpolate/interpolateNumber.d.ts +2 -0
- package/dist/src/utils/layout/getBoundingBox.d.ts +5 -0
- package/dist/src/utils/layout/getSizingFunctions.d.ts +10 -0
- package/dist/src/utils/objects/arrow/getArrowPoints.d.ts +9 -0
- package/dist/src/utils/objects/circle/getCirclePath.d.ts +4 -0
- package/dist/src/utils/objects/line/getLinePath.d.ts +4 -0
- package/dist/src/utils/objects/polygon/getPolygonPath.d.ts +4 -0
- package/dist/src/utils/objects/rectangle/getRectanglePath.d.ts +4 -0
- package/dist/src/utils/objects/rectangle/getRoundedRectanglePath.d.ts +5 -0
- package/dist/src/utils/objects/text/getTextContentLength.d.ts +2 -0
- package/dist/src/utils/objects/text/getTextStyleFromText.d.ts +3 -0
- package/dist/src/utils/objects/text/getTextUnitsFromTextContent.d.ts +3 -0
- package/dist/src/utils/presentation/createPresentationContainer.d.ts +2 -0
- package/dist/src/utils/presentation/getObjectChildren.d.ts +5 -0
- package/dist/src/utils/presentation/getObjectState.d.ts +12 -0
- package/dist/src/utils/presentation/getPresentationShortcuts.d.ts +3 -0
- package/dist/src/utils/presentation/isFullBodyPresentation.d.ts +1 -0
- package/dist/src/utils/presentation/setupKeyEventListeners.d.ts +10 -0
- package/dist/src/utils/size/getCombinedSizes2D.d.ts +7 -0
- package/dist/src/utils/slide/getKeySlideBuildIndices.d.ts +5 -0
- package/dist/src/utils/storage/StorageState.d.ts +5 -0
- package/dist/src/utils/storage/loadPresentationState.d.ts +3 -0
- package/dist/src/utils/storage/storageConsts.d.ts +1 -0
- package/dist/src/utils/storage/storePresentationState.d.ts +2 -0
- package/package.json +21 -26
- package/dist/354.js +0 -2
- package/dist/354.js.LICENSE.txt +0 -20
- package/dist/418.js +0 -2
- package/dist/418.js.LICENSE.txt +0 -1
- package/dist/661.js +0 -1
- package/dist/presenter-code.js +0 -1
- package/dist/presenter-export.js +0 -2
- package/dist/presenter-export.js.LICENSE.txt +0 -313
- package/dist/presenter-morph.js +0 -1
- package/dist/src/code/codeBlock.d.ts +0 -108
- package/dist/src/code/index.d.ts +0 -1
- package/dist/src/export/util.d.ts +0 -4
- package/dist/src/library/bullets.d.ts +0 -15
- package/dist/src/library/mainTitle.d.ts +0 -4
- package/dist/src/library/slideTitle.d.ts +0 -4
- package/dist/src/morph/index.d.ts +0 -34
- package/dist/src/objects/arrow.d.ts +0 -62
- package/dist/src/objects/circle.d.ts +0 -24
- package/dist/src/objects/grid.d.ts +0 -17
- package/dist/src/objects/group.d.ts +0 -29
- package/dist/src/objects/iframe.d.ts +0 -16
- package/dist/src/objects/image.d.ts +0 -20
- package/dist/src/objects/line.d.ts +0 -21
- package/dist/src/objects/mask.d.ts +0 -13
- package/dist/src/objects/paragraph.d.ts +0 -21
- package/dist/src/objects/path.d.ts +0 -29
- package/dist/src/objects/polygon.d.ts +0 -13
- package/dist/src/objects/rectangle.d.ts +0 -26
- package/dist/src/objects/screenCapture.d.ts +0 -17
- package/dist/src/objects/text.d.ts +0 -67
- package/dist/src/objects/vectorGraphic.d.ts +0 -48
- package/dist/src/presentation/object.d.ts +0 -132
- package/dist/src/presentation/presentation.d.ts +0 -153
- package/dist/src/presentation/presentation.test.d.ts +0 -1
- package/dist/src/presentation/slide.d.ts +0 -43
- package/dist/src/presentation/storage.d.ts +0 -9
- package/dist/src/util/animation.d.ts +0 -60
- package/dist/src/util/easing.d.ts +0 -12
- package/dist/src/util/easing.test.d.ts +0 -1
- package/dist/src/util/position.d.ts +0 -11
- package/dist/src/util/richText.d.ts +0 -19
- package/dist/webpack.config.d.ts +0 -70
- /package/dist/src/{objects/text.test.d.ts → utils/size/getCombinedSizes2D.test.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Color } from "../../../types/Color";
|
|
2
|
+
import { UnifiedCanvasContext } from "../types/UnifiedCanvasContext";
|
|
3
|
+
import { UnifiedPath2D } from "../types/UnifiedPath2D";
|
|
4
|
+
interface Args {
|
|
5
|
+
readonly ctx: UnifiedCanvasContext;
|
|
6
|
+
readonly path: UnifiedPath2D | undefined;
|
|
7
|
+
readonly color: Color;
|
|
8
|
+
readonly opacity?: number | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function fillPath({ ctx, path, color, opacity }: Args): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
2
|
+
import { Position } from "../../../types/Position";
|
|
3
|
+
import { UnifiedPath2D } from "../types/UnifiedPath2D";
|
|
4
|
+
export declare function getPathFromPositions(positions: Position[], createPath: () => UnifiedPath2D): PathWithLength;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Size } from "../../../../types/Size";
|
|
2
|
+
import { TextStyle } from "../../../../types/TextStyle";
|
|
3
|
+
import { TextUnit } from "../../../../types/TextUnit";
|
|
4
|
+
import { UnifiedCanvasContext } from "../../types/UnifiedCanvasContext";
|
|
5
|
+
export declare function getTextUnitMeasurements(textUnits: TextUnit[][], style: TextStyle, ctx: UnifiedCanvasContext): Size[][];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const Anchor: {
|
|
2
|
+
readonly TOP_LEFT: "TopLeft";
|
|
3
|
+
readonly TOP: "Top";
|
|
4
|
+
readonly TOP_RIGHT: "TopRight";
|
|
5
|
+
readonly LEFT: "Left";
|
|
6
|
+
readonly CENTER: "Center";
|
|
7
|
+
readonly RIGHT: "Right";
|
|
8
|
+
readonly BOTTOM_LEFT: "BottomLeft";
|
|
9
|
+
readonly BOTTOM: "Bottom";
|
|
10
|
+
readonly BOTTOM_RIGHT: "BottomRight";
|
|
11
|
+
};
|
|
12
|
+
export type Anchor = (typeof Anchor)[keyof typeof Anchor];
|
|
13
|
+
export declare const DEFAULT_ANCHOR: Anchor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnimationType } from "./AnimationType";
|
|
2
|
+
import { BaseUnitSlideAnimation } from "./BaseUnitSlideAnimation";
|
|
3
|
+
import { EasingFunction } from "./EasingFunction";
|
|
4
|
+
import { Interpolator } from "./Interpolator";
|
|
5
|
+
import { SlideObject } from "./SlideObject";
|
|
6
|
+
export interface Animate<T extends SlideObject> extends BaseUnitSlideAnimation {
|
|
7
|
+
readonly type: typeof AnimationType.ANIMATE;
|
|
8
|
+
readonly object: T;
|
|
9
|
+
readonly props: Partial<Omit<T, "objectType">>;
|
|
10
|
+
readonly duration: number;
|
|
11
|
+
readonly easing: EasingFunction;
|
|
12
|
+
/** Whether animation should block future animations from starting. */
|
|
13
|
+
readonly block: boolean;
|
|
14
|
+
/** Custom interpolators to use for performing animation. */
|
|
15
|
+
readonly interpolators: Interpolator<any>[] | null;
|
|
16
|
+
}
|
|
17
|
+
export type AnimationParams<T extends SlideObject> = number | Partial<Omit<Animate<T>, "object" | "props">>;
|
|
18
|
+
export declare function Animate<T extends SlideObject>(object: T, props: Partial<Omit<T, "objectType">>, animationParams?: AnimationParams<T>): Animate<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const AnimationType: {
|
|
2
|
+
/** Represents an animated change in an object's properties. */
|
|
3
|
+
readonly ANIMATE: "Animate";
|
|
4
|
+
/** Represents a pause in the animation timeline. */
|
|
5
|
+
readonly PAUSE: "Pause";
|
|
6
|
+
/** Represents an immediate update to an object's properties without animation. */
|
|
7
|
+
readonly UPDATE: "Update";
|
|
8
|
+
};
|
|
9
|
+
export type AnimationType = (typeof AnimationType)[keyof typeof AnimationType];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnimationType } from "./AnimationType";
|
|
2
|
+
export interface BaseUnitSlideAnimation {
|
|
3
|
+
readonly type: AnimationType;
|
|
4
|
+
/** Indicates whether this animation is a key animation to be included in exports. */
|
|
5
|
+
readonly isKey: boolean;
|
|
6
|
+
readonly shortcut: string | string[] | null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Position } from "./Position";
|
|
2
|
+
import { Size } from "./Size";
|
|
3
|
+
export interface BoundingBox {
|
|
4
|
+
/** The position of the top-left corner of the bounding box */
|
|
5
|
+
readonly origin: Position;
|
|
6
|
+
/** The size of the bounding box */
|
|
7
|
+
readonly size: Size;
|
|
8
|
+
}
|
|
9
|
+
export declare function BoundingBox(props?: Partial<BoundingBox> | null): BoundingBox;
|
|
10
|
+
export declare const DEFAULT_BOUNDING_BOX: BoundingBox;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Color {
|
|
2
|
+
/** Red channel, in [0, 255] */
|
|
3
|
+
red: number;
|
|
4
|
+
/** Green channel, in [0, 255] */
|
|
5
|
+
green: number;
|
|
6
|
+
/** Blue channel, in [0, 255] */
|
|
7
|
+
blue: number;
|
|
8
|
+
/** Alpha channel, in [0, 1] */
|
|
9
|
+
alpha: number;
|
|
10
|
+
}
|
|
11
|
+
type HexColor = `#${string}`;
|
|
12
|
+
export declare function Color(color: Partial<Color> | HexColor): Color;
|
|
13
|
+
export declare function Color(red: number, green: number, blue: number, alpha?: number): Color;
|
|
14
|
+
export declare namespace Color {
|
|
15
|
+
var BLACK: Color;
|
|
16
|
+
var BLUE: Color;
|
|
17
|
+
var GREEN: Color;
|
|
18
|
+
var RED: Color;
|
|
19
|
+
var TRANSPARENT: Color;
|
|
20
|
+
var WHITE: Color;
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_COLOR: Color;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { easeCubic, easeCubicIn, easeCubicOut } from "d3-ease";
|
|
2
|
+
import { EasingFunction } from "./EasingFunction";
|
|
3
|
+
export declare const Easing: {
|
|
4
|
+
readonly LINEAR: (t: number) => number;
|
|
5
|
+
readonly CUBIC: typeof easeCubic;
|
|
6
|
+
readonly CUBIC_IN: typeof easeCubicIn;
|
|
7
|
+
readonly CUBIC_OUT: typeof easeCubicOut;
|
|
8
|
+
readonly BACK_IN_OUT: import("d3-ease").BackEasingFactory;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_EASING: EasingFunction;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Values for the CSS font-style property. */
|
|
2
|
+
export declare const FontStyle: {
|
|
3
|
+
readonly NORMAL: "normal";
|
|
4
|
+
readonly ITALIC: "italic";
|
|
5
|
+
readonly OBLIQUE: "oblique";
|
|
6
|
+
};
|
|
7
|
+
export type FontStyle = (typeof FontStyle)[keyof typeof FontStyle];
|
|
8
|
+
export declare const DEFAULT_FONT_STYLE: FontStyle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const FontWeight: {
|
|
2
|
+
readonly THIN: 100;
|
|
3
|
+
readonly EXTRA_LIGHT: 200;
|
|
4
|
+
readonly LIGHT: 300;
|
|
5
|
+
readonly NORMAL: 400;
|
|
6
|
+
readonly MEDIUM: 500;
|
|
7
|
+
readonly SEMI_BOLD: 600;
|
|
8
|
+
readonly BOLD: 700;
|
|
9
|
+
readonly EXTRA_BOLD: 800;
|
|
10
|
+
readonly BLACK: 900;
|
|
11
|
+
};
|
|
12
|
+
export type FontWeight = (typeof FontWeight)[keyof typeof FontWeight];
|
|
13
|
+
export declare const DEFAULT_FONT_WEIGHT: FontWeight;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** An interpolator defines a function for interpolating between values of arbitrary type T. */
|
|
2
|
+
export interface Interpolator<T> {
|
|
3
|
+
/** Function to check if a value should be interpolated with this interpolator. */
|
|
4
|
+
readonly check: (value: unknown, propertyName: string) => value is T;
|
|
5
|
+
/** Function to interpolate between two values. */
|
|
6
|
+
readonly interpolate: (from: T, to: T, proportion: number) => T;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const ObjectType: {
|
|
2
|
+
readonly ARROW: "Arrow";
|
|
3
|
+
readonly CIRCLE: "Circle";
|
|
4
|
+
readonly GROUP: "Group";
|
|
5
|
+
readonly IMAGE: "Image";
|
|
6
|
+
readonly LINE: "Line";
|
|
7
|
+
readonly MASK: "Mask";
|
|
8
|
+
readonly PATH: "Path";
|
|
9
|
+
readonly POLYGON: "Polygon";
|
|
10
|
+
readonly RECTANGLE: "Rectangle";
|
|
11
|
+
readonly SLIDE_OBJECT: "SlideObject";
|
|
12
|
+
readonly TEXT: "Text";
|
|
13
|
+
};
|
|
14
|
+
export type ObjectType = (typeof ObjectType)[keyof typeof ObjectType];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnimationType } from "./AnimationType";
|
|
2
|
+
import { BaseUnitSlideAnimation } from "./BaseUnitSlideAnimation";
|
|
3
|
+
export interface Pause extends BaseUnitSlideAnimation {
|
|
4
|
+
readonly type: typeof AnimationType.PAUSE;
|
|
5
|
+
readonly duration: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function Pause(duration?: number): Pause;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { Resources } from "./Resources";
|
|
3
|
+
import { Size } from "./Size";
|
|
4
|
+
import { Slide } from "./Slide";
|
|
5
|
+
export interface Presentation {
|
|
6
|
+
/** The background color of the presentation. */
|
|
7
|
+
readonly backgroundColor: Color;
|
|
8
|
+
/** The slides to present as part of the presentation. */
|
|
9
|
+
readonly slides: Slide[];
|
|
10
|
+
/** The title of the presentation. */
|
|
11
|
+
readonly title: string;
|
|
12
|
+
/** The resources used in the presentation. */
|
|
13
|
+
readonly resources: Resources;
|
|
14
|
+
/** The dimensions of the presentation's viewport. */
|
|
15
|
+
readonly size: Size;
|
|
16
|
+
}
|
|
17
|
+
export declare function Presentation(props?: Partial<Presentation> | null): Presentation;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutable state held by presentation for tracking shortcuts to jump between slides.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export interface ShortcutState {
|
|
6
|
+
/** Currently typed text command. */
|
|
7
|
+
textCommand: string | null;
|
|
8
|
+
shortcuts: Record<string, ShortcutConfig>;
|
|
9
|
+
}
|
|
10
|
+
export interface ShortcutConfig {
|
|
11
|
+
readonly slideIndex: number | null;
|
|
12
|
+
readonly buildIndex: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SlideAnimation } from "./SlideAnimation";
|
|
2
|
+
import { SlideObject } from "./SlideObject";
|
|
3
|
+
export interface Slide {
|
|
4
|
+
readonly objects: SlideObject[];
|
|
5
|
+
readonly animations: SlideAnimation[];
|
|
6
|
+
readonly isAllKey: boolean;
|
|
7
|
+
readonly isEndKey: boolean;
|
|
8
|
+
readonly isStartKey: boolean;
|
|
9
|
+
readonly shortcut: string | string[] | null;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Slide(props?: Partial<Slide> | null): Slide;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Animate } from "./Animate";
|
|
2
|
+
import { Pause } from "./Pause";
|
|
3
|
+
import { SlideObject } from "./SlideObject";
|
|
4
|
+
import { Update } from "./Update";
|
|
5
|
+
export type UnitSlideAnimation = Animate<SlideObject> | Update<SlideObject> | Pause;
|
|
6
|
+
export type SlideAnimation = UnitSlideAnimation | UnitSlideAnimation[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { FontStyle } from "./FontStyle";
|
|
3
|
+
import { FontWeight } from "./FontWeight";
|
|
4
|
+
export interface TextStyle {
|
|
5
|
+
readonly color: Color;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly fontSize: number;
|
|
8
|
+
readonly fontStyle: FontStyle;
|
|
9
|
+
readonly fontWeight: FontWeight | number;
|
|
10
|
+
readonly ligatures: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_TEXT_STYLE: TextStyle;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TextStyle } from "./TextStyle";
|
|
2
|
+
/** A possibly styled piece of text inside of a text object. */
|
|
3
|
+
export interface TextUnit extends Partial<TextStyle> {
|
|
4
|
+
readonly text: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function TextUnit(text: string, props?: Partial<Omit<TextUnit, "text">>): TextUnit;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnimationType } from "./AnimationType";
|
|
2
|
+
import { BaseUnitSlideAnimation } from "./BaseUnitSlideAnimation";
|
|
3
|
+
import { SlideObject } from "./SlideObject";
|
|
4
|
+
export interface Update<T extends SlideObject> extends BaseUnitSlideAnimation {
|
|
5
|
+
readonly type: typeof AnimationType.UPDATE;
|
|
6
|
+
readonly object: T;
|
|
7
|
+
readonly props: Partial<Omit<T, "objectType">>;
|
|
8
|
+
}
|
|
9
|
+
export declare function Update<T extends SlideObject>(object: T, props: Partial<Omit<T, "objectType">>): Update<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SlideAnimation } from "../../types/SlideAnimation";
|
|
2
|
+
import { SlideObject } from "../../types/SlideObject";
|
|
3
|
+
/**
|
|
4
|
+
* Mutably updates the object state to reflect the end state of the animation.
|
|
5
|
+
*
|
|
6
|
+
* If a build time is provided, the object state is updated to the state at that
|
|
7
|
+
* time into the animation.
|
|
8
|
+
*
|
|
9
|
+
* @param objectState Map from original objects to current object state.
|
|
10
|
+
* @param slideAnimation The animation to apply.
|
|
11
|
+
* @param buildTime Optional time (in ms) into the animation to apply.
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateObjectStateWithAnimation(objectState: Map<SlideObject, SlideObject>, slideAnimation: SlideAnimation | null, buildTime?: number | null): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Color } from "../../types/Color";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the alpha value for a color in [0, 1], given the color and the overall opacity of a shape.
|
|
4
|
+
* Combines the color's alpha and the overall opacity.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAlphaForColor(color: Color, opacity?: number | null): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertNever(value: never, message?: string): never;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Interpolator } from "../../types/Interpolator";
|
|
2
|
+
import { SlideObject } from "../../types/SlideObject";
|
|
3
|
+
export declare function interpolate<T extends SlideObject>(object: T, props: Partial<T>, proportion: number, customInterpolators?: Interpolator<unknown>[] | null): T;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Anchor } from "../../types/Anchor";
|
|
2
|
+
import { BoundingBox } from "../../types/BoundingBox";
|
|
3
|
+
import { Position } from "../../types/Position";
|
|
4
|
+
import { Size } from "../../types/Size";
|
|
5
|
+
export declare function getBoundingBox(position: Position, anchor: Anchor, size: Size): BoundingBox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Position } from "../../types/Position";
|
|
2
|
+
import { Size } from "../../types/Size";
|
|
3
|
+
interface Return {
|
|
4
|
+
scaleX: (proportion: number) => number;
|
|
5
|
+
scaleY: (proportion: number) => number;
|
|
6
|
+
position: (xProportion: number, yProportion: number) => Position;
|
|
7
|
+
}
|
|
8
|
+
/** Returns sizing functions for calculating proportional sizes. */
|
|
9
|
+
export declare function getSizingFunctions(size: Size): Return;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Arrow } from "../../../objects/Arrow";
|
|
2
|
+
import { Position } from "../../../types/Position";
|
|
3
|
+
interface Return {
|
|
4
|
+
readonly arrowPoints: Position[];
|
|
5
|
+
readonly arrowheadPoints: Position[];
|
|
6
|
+
readonly doubledArrowheadPoints: Position[];
|
|
7
|
+
}
|
|
8
|
+
export declare function getArrowPoints(arrow: Arrow): Return;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Circle } from "../../../objects/Circle";
|
|
2
|
+
import { UnifiedPath2D } from "../../../renderer/browser-canvas/types/UnifiedPath2D";
|
|
3
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
4
|
+
export declare function getCirclePath(circle: Circle, createPath: () => UnifiedPath2D): PathWithLength;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Line } from "../../../objects/Line";
|
|
2
|
+
import { UnifiedPath2D } from "../../../renderer/browser-canvas/types/UnifiedPath2D";
|
|
3
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
4
|
+
export declare function getLinePath(line: Line, createPath: () => UnifiedPath2D): PathWithLength;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Polygon } from "../../../objects/Polygon";
|
|
2
|
+
import { UnifiedPath2D } from "../../../renderer/browser-canvas/types/UnifiedPath2D";
|
|
3
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
4
|
+
export declare function getPolygonPath(polygon: Polygon, createPath: () => UnifiedPath2D): PathWithLength;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Rectangle } from "../../../objects/Rectangle";
|
|
2
|
+
import { UnifiedPath2D } from "../../../renderer/browser-canvas/types/UnifiedPath2D";
|
|
3
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
4
|
+
export declare function getRectanglePath(rectangle: Rectangle, createPath: () => UnifiedPath2D): PathWithLength;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UnifiedPath2D } from "../../../renderer/browser-canvas/types/UnifiedPath2D";
|
|
2
|
+
import { PathWithLength } from "../../../types/PathWithLength";
|
|
3
|
+
import { Position } from "../../../types/Position";
|
|
4
|
+
import { Size } from "../../../types/Size";
|
|
5
|
+
export declare function getRoundedRectanglePath(origin: Position, size: Size, rounding: number, createPath: () => UnifiedPath2D, overshoot?: number): PathWithLength;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Slide } from "../../types/Slide";
|
|
2
|
+
import { SlideObject } from "../../types/SlideObject";
|
|
3
|
+
interface Args {
|
|
4
|
+
readonly slide: Slide;
|
|
5
|
+
readonly buildIndex: number;
|
|
6
|
+
readonly buildTime: number | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns a mapping from original object (by reference equality) to its current state.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getObjectState({ slide, buildIndex, buildTime, }: Args): Map<SlideObject, SlideObject>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isFullBodyPresentation(element: HTMLElement): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Presentation } from "../../types/Presentation";
|
|
2
|
+
import { ShortcutState } from "../../types/ShortcutState";
|
|
3
|
+
interface Callbacks {
|
|
4
|
+
readonly onNext: (skipIntermediateBuilds: boolean) => void;
|
|
5
|
+
readonly onPrevious: (skipIntermediateBuilds: boolean) => void;
|
|
6
|
+
readonly onRenderSlide: (slideIndex: number | null, buildIndex: number) => void;
|
|
7
|
+
readonly onShowNavigator: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function setupKeyEventListeners(presentation: Presentation, element: HTMLElement, shortcutState: ShortcutState, { onNext, onPrevious, onRenderSlide, onShowNavigator }: Callbacks): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOCAL_STORAGE_KEY = "presenterState";
|