From 9a1bab09147edd71f7ca23c43d2c5e9d1b53ca5c Mon Sep 17 00:00:00 2001 From: zakari9959 Date: Sat, 26 Aug 2023 15:37:57 +0200 Subject: [PATCH] chore: add ts-correction --- rollup.config.js | 1 + src/html-flip-book/settings.ts | 50 +++++++++++++++++----------------- src/index.ts | 1 + 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 9bfeea4..6e8968b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,6 +13,7 @@ export default { file: 'build/index.js', format: 'cjs', sourcemap: true, + exports: 'auto', }, { file: 'build/index.es.js', diff --git a/src/html-flip-book/settings.ts b/src/html-flip-book/settings.ts index a294c52..10c92ca 100644 --- a/src/html-flip-book/settings.ts +++ b/src/html-flip-book/settings.ts @@ -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 { @@ -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; + } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9a307d8..f55012c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ import { HTMLFlipBook } from './html-flip-book'; export default HTMLFlipBook;