Skip to content

Commit d27d2e4

Browse files
🤖 Merge PR DefinitelyTyped#70438 [react-retool]: add typings for react-retool package by @ImmortalJoker
1 parent 4d7fce0 commit d27d2e4

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!**/*.d.ts
3+
!**/*.d.cts
4+
!**/*.d.mts
5+
!**/*.d.*.ts
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { CSSProperties, FunctionComponent, IframeHTMLAttributes } from "react";
2+
3+
export interface RetoolProps {
4+
width?: IframeHTMLAttributes<HTMLIFrameElement>["width"];
5+
height?: IframeHTMLAttributes<HTMLIFrameElement>["height"];
6+
url: IframeHTMLAttributes<HTMLIFrameElement>["src"];
7+
data?: Record<string, unknown>;
8+
onData?: (data: unknown) => void;
9+
sandbox?: true | IframeHTMLAttributes<HTMLIFrameElement>["sandbox"];
10+
allow?: IframeHTMLAttributes<HTMLIFrameElement>["allow"];
11+
styling?: CSSProperties;
12+
}
13+
14+
export const Retool: FunctionComponent<RetoolProps>;
15+
16+
export default Retool;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Retool from "./components/Retool";
2+
3+
export default Retool;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"private": true,
3+
"name": "@types/react-retool",
4+
"version": "1.4.9999",
5+
"projects": [
6+
"https://github.com/tryretool/react-retool#readme"
7+
],
8+
"dependencies": {
9+
"@types/react": "*"
10+
},
11+
"devDependencies": {
12+
"@types/react-retool": "workspace:."
13+
},
14+
"owners": [
15+
{
16+
"name": "Kent Walters",
17+
"githubUsername": "kentwalters"
18+
},
19+
{
20+
"name": "Ben Baker",
21+
"githubUsername": "BenjamynBaker"
22+
},
23+
{
24+
"name": "Yehor Krasnov",
25+
"githubUsername": "immortaljoker"
26+
}
27+
]
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from "react";
2+
import Retool from "react-retool";
3+
4+
<>
5+
<Retool url="http://test.com" />
6+
7+
<Retool url="http://test.com" width={10} />
8+
<Retool url="http://test.com" width={"10px"} height={10} />
9+
10+
<Retool url="http://test.com" sandbox={true} />
11+
<Retool url="http://test.com" sandbox={"allow-scripts"} />
12+
13+
<Retool url="http://test.com" allow="fullscreen" />
14+
15+
<Retool url="http://test.com" styling={{ width: "100%" }} />
16+
17+
<Retool url="http://test.com" data={{ anyProperty: "100%" }} />
18+
19+
<Retool url="http://test.com" onData={(data: unknown) => {}} />
20+
</>;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react",
4+
"module": "node16",
5+
"lib": [
6+
"es6"
7+
],
8+
"noImplicitAny": true,
9+
"noImplicitThis": true,
10+
"strictFunctionTypes": true,
11+
"strictNullChecks": true,
12+
"types": [],
13+
"noEmit": true,
14+
"forceConsistentCasingInFileNames": true
15+
},
16+
"files": [
17+
"index.d.ts",
18+
"react-retool-tests.tsx"
19+
]
20+
}

0 commit comments

Comments
 (0)