Merge pull request #14551 from curtisw0/react-sticky

Add definitions for react-sticky
This commit is contained in:
Arthur Ozga
2017-02-10 13:13:16 -08:00
committed by GitHub
4 changed files with 63 additions and 0 deletions

27
react-sticky/index.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
// Type definitions for react-sticky 5.0
// Project: https://github.com/captivationsoftware/react-sticky
// Definitions by: Matej Lednicky <http://www.thinkcreatix.com/>, Curtis Warren <https://github.com/curtisw0>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as React from "react";
declare module "react-sticky" {
export var StickyContainer: React.ComponentClass<React.HTMLAttributes<HTMLDivElement>>;
export interface StickyProps {
isActive: boolean;
className: string;
style: any;
stickyClassName: string;
stickyStyle: any;
topOffset: number;
bottomOffset: number;
onStickyStateChange: (isSticky: boolean) => void;
}
export var Sticky: React.ComponentClass<StickyProps>;
}

View File

@@ -0,0 +1,9 @@
import {Sticky, StickyContainer} from "react-sticky";
import * as React from "react";
const StickyComponent: JSX.Element =
<StickyContainer className="sticky-container">
<Sticky isActive={true} className="sticky" style={{}} stickyClassName="sticky" stickyStyle={{}} topOffset={0} bottomOffset={0} onStickyStateChange={(isSticky: boolean): void => undefined}>
</Sticky>
</StickyContainer>;

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"jsx": "react",
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-sticky-tests.tsx"
]
}

2
react-sticky/tslint.json Normal file
View File

@@ -0,0 +1,2 @@
{ "extends": "../tslint.json" }