[react-stickynode] Update types to match version 3.0.2 (#45038)

* [react-stickynode] Update types to match version 3.0.2

* Fix spacing

* Fix version
This commit is contained in:
Mirosław Ciastek 2020-06-04 02:57:02 +02:00 committed by GitHub
parent d2c5b140b0
commit fdedaaf740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View File

@ -1,7 +1,8 @@
// Type definitions for react-stickynode 2.1
// Type definitions for react-stickynode 3.0
// Project: https://github.com/yahoo/react-stickynode
// Definitions by: Tim Stirrat <https://github.com/tstirrat>
// Kamil Socha <https://github.com/ksocha>
// Mirek Ciastek <https://github.com/mciastek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@ -40,16 +41,16 @@ declare namespace Sticky {
/**
* The offset from the top of window where the top of the element will
* be when sticky state is triggered(0 by default ).If it is a selector
* to a target(via `querySelector()`), the offset will be the height of
* be when sticky state is triggered(0 by default ). If it is a selector
* to a target (via `querySelector()`), the offset will be the height of
* the target.
*/
top?: number | string;
/**
* The offset from the top of document which release state will be
* triggered when the bottom of the element reaches at.If it is a
* selector to a target(via `querySelector()`), the offset will be the
* triggered when the bottom of the element reaches at. If it is a
* selector to a target (via `querySelector()`), the offset will be the
* bottom of the target.
*/
bottomBoundary?: number | string;
@ -57,18 +58,23 @@ declare namespace Sticky {
/** z-index of the sticky */
innerZ?: number | string;
/** Enable the use of CSS3 transforms (true by default). */
/** Enable the use of CSS3 transforms (`true` by default). */
enableTransforms?: boolean;
/**
* Class name to be applied to the element when the sticky state is
* active (active by default).
* active ('active' by default).
*/
activeClass?: string;
/**
* Class name to be applied to the inner element ('' by default).
*/
innerClass?: string;
/**
* Class name to be applied to the element when the sticky state is
* released (released by default).
* released ('released' by default).
*/
releasedClass?: string;

View File

@ -10,6 +10,7 @@ const StickyAllOptions: JSX.Element = (
enableTransforms={true}
activeClass="active"
releasedClass="released"
innerClass="innerClass"
onStateChange={s => s.status === Sticky.StatusCode.STATUS_ORIGINAL}
shouldFreeze={() => false}
>