compute-scroll-into-view 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +6 -5
  2. package/typings/index.d.ts +19 -0
package/package.json CHANGED
@@ -8,11 +8,12 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/stipsan/compute-scroll-into-view.git"
10
10
  },
11
- "version": "1.0.15",
11
+ "version": "1.0.16",
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.module.js",
14
14
  "files": [
15
15
  "dist",
16
+ "typings",
16
17
  "umd/compute-scroll-into-view.min.js",
17
18
  "umd/compute-scroll-into-view.min.js.map"
18
19
  ],
@@ -27,21 +28,21 @@
27
28
  "typecheck": "tsc --noEmit"
28
29
  },
29
30
  "sideEffects": false,
30
- "typings": "dist/index.d.ts",
31
+ "typings": "typings/index.d.ts",
31
32
  "devDependencies": {
32
33
  "concurrently": "5.3.0",
33
34
  "husky": "4.2.5",
34
35
  "jest": "26.4.2",
35
- "jest-junit": "10.0.0",
36
+ "jest-junit": "11.1.0",
36
37
  "jest-puppeteer": "4.4.0",
37
38
  "lint-staged": "10.2.13",
38
39
  "microbundle": "^0.12.3",
39
40
  "prettier": "2.1.1",
40
41
  "prettier-package-json": "2.1.3",
41
- "puppeteer": "3.3.0",
42
+ "puppeteer": "5.2.1",
42
43
  "rimraf": "3.0.2",
43
44
  "serve": "11.3.2",
44
- "typescript": "3.9.7"
45
+ "typescript": "4.0.2"
45
46
  },
46
47
  "keywords": [
47
48
  "if-needed",
@@ -0,0 +1,19 @@
1
+ declare type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
2
+ declare type ScrollMode = 'always' | 'if-needed';
3
+ declare type SkipOverflowHiddenElements = boolean;
4
+ interface Options {
5
+ block?: ScrollLogicalPosition;
6
+ inline?: ScrollLogicalPosition;
7
+ scrollMode?: ScrollMode;
8
+ boundary?: CustomScrollBoundary;
9
+ skipOverflowHiddenElements?: SkipOverflowHiddenElements;
10
+ }
11
+ declare type CustomScrollBoundaryCallback = (parent: Element) => boolean;
12
+ declare type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null;
13
+ interface CustomScrollAction {
14
+ el: Element;
15
+ top: number;
16
+ left: number;
17
+ }
18
+ declare const _default: (target: Element, options: Options) => CustomScrollAction[];
19
+ export default _default;