-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typings): Improve TS typings (#223)
* prepare to add flowtype tests * improve the quality of the typescript libdefs * Improve typescript declarations * improve further * update readme etc * Update index.ts
- Loading branch information
Showing
8 changed files
with
239 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Standard, based on CSSOM View spec | ||
export type ScrollBehavior = 'auto' | 'instant' | 'smooth' | ||
export type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest' | ||
// This new option is tracked in this PR, which is the most likely candidate at the time: https://github.com/w3c/csswg-drafts/pull/1805 | ||
export type ScrollMode = 'always' | 'if-needed' | ||
|
||
export interface Options { | ||
block?: ScrollLogicalPosition | ||
inline?: ScrollLogicalPosition | ||
scrollMode?: ScrollMode | ||
boundary?: CustomScrollBoundary | ||
} | ||
|
||
// Custom behavior, not in any spec | ||
export interface CustomScrollBoundaryCallback { | ||
(parent: Element): boolean | ||
} | ||
export type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | ||
export type CustomScrollAction = { el: Element; top: number; left: number } | ||
export interface CustomScrollBehaviorCallback<T> { | ||
(actions: CustomScrollAction[]): T | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"scroll-into-view-if-needed": "link:../.." | ||
}, | ||
"devDependencies": { | ||
"flow-bin": "0.71.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
[email protected]: | ||
version "0.71.0" | ||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.71.0.tgz#fd1b27a6458c3ebaa5cb811853182ed631918b70" | ||
|
||
"scroll-into-view-if-needed@link:../..": | ||
version "0.0.0" | ||
uid "" |
Oops, something went wrong.