commit a1b47a38ccec7a0c3a037957d77839ebc3c3680d Author: dm1sh Date: Tue Aug 3 02:45:40 2021 +0300 Initial commit andmodule declaration file diff --git a/html-pagination.d.ts b/html-pagination.d.ts new file mode 100644 index 0000000..d55c17b --- /dev/null +++ b/html-pagination.d.ts @@ -0,0 +1,22 @@ +export abstract class CacheInterface { + abstract g(key: string): string; + abstract s(key: string, value: string): void; +} + +/** + * Function to get page with specific number + * @param n Page number + */ +declare function getPage(n: number): string; + +/** + * Function to prepare unific data and compose page content getting function + * @param content HTML element with html content to display paginationly + * @param container HTML element which will store content to display + * @param cache Class implementing `g` and `s` methods for getting and setting elements of KV storage + */ +export function setup( + content: HTMLElement, + container: HTMLElement, + cache: CacheInterface +): typeof getPage; diff --git a/package.json b/package.json new file mode 100644 index 0000000..2200bf1 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "html-pagination", + "version": "1.0.0", + "description": "Package for html document pagination to fit container with fixed width", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dm1sh/html-pagination.git" + }, + "keywords": [ + "pagination", + "books" + ], + "author": "dm1sh", + "license": "MIT", + "bugs": { + "url": "https://github.com/dm1sh/html-pagination/issues" + }, + "homepage": "https://github.com/dm1sh/html-pagination#readme" +}