Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: IFlipSetting #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
file: 'build/index.js',
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
file: 'build/index.es.js',
Expand Down
50 changes: 25 additions & 25 deletions src/html-flip-book/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,50 @@ export type PageOrientation = 'portrait' | 'landscape';

export interface IFlipSetting {
/** Page number from which to start viewing */
startPage: number;
startPage?: number;
/** Whether the book will be stretched under the parent element or not */
size: 'fixed' | 'stretch';
size?: 'fixed' | 'stretch';

width: number;
height: number;

minWidth: number;
maxWidth: number;
minHeight: number;
maxHeight: number;
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;

/** Draw shadows or not when page flipping */
drawShadow: boolean;
drawShadow?: boolean;
/** Flipping animation time */
flippingTime: number;
flippingTime?: number;

/** Enable switching to portrait mode */
usePortrait: boolean;
usePortrait?: boolean;
/** Initial value to z-index */
startZIndex: number;
startZIndex?: number;
/** If this value is true, the parent element will be equal to the size of the book */
autoSize: boolean;
autoSize?: boolean;
/** Shadow intensity (1: max intensity, 0: hidden shadows) */
maxShadowOpacity: number;
maxShadowOpacity?: number;

/** If this value is true, the first and the last pages will be marked as hard and will be shown in single page mode */
showCover: boolean;
showCover?: boolean;
/** Disable content scrolling when touching a book on mobile devices */
mobileScrollSupport: boolean;
mobileScrollSupport?: boolean;

/** Set the forward event of clicking on child elements (buttons, links) */
clickEventForward: boolean;
clickEventForward?: boolean;

/** Using mouse and touch events to page flipping */
useMouseEvents: boolean;
useMouseEvents?: boolean;

swipeDistance: number;
swipeDistance?: number;

/** if this value is true, fold the corners of the book when the mouse pointer is over them. */
showPageCorners: boolean;
showPageCorners?: boolean;

/** if this value is true, flipping by clicking on the whole book will be locked. Only on corners */
disableFlipByClick: boolean;
disableFlipByClick?: boolean;
}

export interface IBookState {
Expand All @@ -55,9 +55,9 @@ export interface IBookState {
}

export interface IEventProps {
onFlip?: (flipEvent: any) => void;
onChangeOrientation?: (flipEvent: any) => void;
onChangeState?: (flipEvent: any) => void;
onInit?: (flipEvent: any) => void;
onUpdate?: (flipEvent: any) => void;
}
onFlip?: (flipEvent: unknown) => void;
onChangeOrientation?: (flipEvent: unknown) => void;
onChangeState?: (flipEvent: unknown) => void;
onInit?: (flipEvent: unknown) => void;
onUpdate?: (flipEvent: unknown) => void;
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable prettier/prettier */
import { HTMLFlipBook } from './html-flip-book';

export default HTMLFlipBook;