mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Added type declarations
This commit is contained in:
parent
0da286b0a2
commit
6bfcd1e4eb
50 changed files with 1837 additions and 54 deletions
48
types/layout.d.ts
vendored
Normal file
48
types/layout.d.ts
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import Contents from "./contents";
|
||||
|
||||
interface LayoutSettings {
|
||||
layout: string,
|
||||
spread: string,
|
||||
minSpreadWidth: number,
|
||||
evenSpreads: boolean
|
||||
}
|
||||
|
||||
export default class Layout {
|
||||
constructor(settings: LayoutSettings);
|
||||
|
||||
settings: LayoutSettings;
|
||||
name: string;
|
||||
props: {
|
||||
name: string,
|
||||
spread: string,
|
||||
flow: string,
|
||||
width: number,
|
||||
height: number,
|
||||
spreadWidth: number,
|
||||
delta: number,
|
||||
columnWidth: number,
|
||||
gap: number,
|
||||
divisor: number
|
||||
};
|
||||
|
||||
flow(flow: string): string;
|
||||
|
||||
spread(spread: string, min: number): boolean;
|
||||
|
||||
calculate(_width:number, _height:number, _gap?:number): void;
|
||||
|
||||
format(contents: Contents): void | Promise<void>;
|
||||
|
||||
count(totalLength: number, pageLength: number): {spreads: Number, pages: Number};
|
||||
|
||||
// Event emitters
|
||||
emit(type: any, ...args: any[]): void;
|
||||
|
||||
off(type: any, listener: any): any;
|
||||
|
||||
on(type: any, listener: any): any;
|
||||
|
||||
once(type: any, listener: any, ...args: any[]): any;
|
||||
|
||||
private update(props: object): void;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue