mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Merge pull request #14551 from curtisw0/react-sticky
Add definitions for react-sticky
This commit is contained in:
27
react-sticky/index.d.ts
vendored
Normal file
27
react-sticky/index.d.ts
vendored
Normal 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>;
|
||||
|
||||
}
|
||||
|
||||
9
react-sticky/react-sticky-tests.tsx
Normal file
9
react-sticky/react-sticky-tests.tsx
Normal 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>;
|
||||
|
||||
25
react-sticky/tsconfig.json
Normal file
25
react-sticky/tsconfig.json
Normal 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
2
react-sticky/tslint.json
Normal file
@@ -0,0 +1,2 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
|
||||
Reference in New Issue
Block a user