Initial commit andmodule declaration file

This commit is contained in:
Dmitriy Shishkov 2021-08-03 02:45:40 +03:00
commit a1b47a38cc
No known key found for this signature in database
GPG Key ID: 14358F96FCDD8060
2 changed files with 45 additions and 0 deletions

22
html-pagination.d.ts vendored Normal file
View File

@ -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;

23
package.json Normal file
View File

@ -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"
}