Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit 06827cc

Browse files
Fixed merge conflicts with upstream master
2 parents 5c4aa74 + 3bf9b23 commit 06827cc

File tree

5 files changed

+85
-4
lines changed

5 files changed

+85
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## (2019-01-02) `v2.0.1`
4+
5+
### Added
6+
7+
- `TypeScript` definitions
8+
39
## (2019-01-02) `v2.0.0`
410

511
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ React dat.GUI uses React and React-DOM `^16.0.0` aka React Fiber. It's recommend
5959

6060
First you'll need a wrapper component which will handle the updates from your dat.GUI, this component should pass the data for the GUI to control as well as an `onUpdate` function to the `DatGui` container component as props. Here's how you might do that:
6161

62-
```
63-
import '../node_modules/react-dat-gui/build/react-dat-gui.css';
62+
```jsx
63+
import 'react-dat-gui/build/react-dat-gui.css';
6464
import React, { Component } from 'react';
6565

6666
import DatGui, { DatBoolean, DatButton, DatNumber, DatString } from 'react-dat-gui';

index.d.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import * as React from 'react';
2+
3+
export interface DatGuiProps {
4+
data: any; // The data your dat.GUI controller will mutate
5+
onUpdate: (data: any) => any; // The method which will be called whenever an update is handled by the controller
6+
children: any; // The dat.GUI components that make up the controller
7+
liveUpdate?: boolean; // Determines if live updates should occur, defaults to true
8+
labelWidth?: number; // The width of the labels in pixels, defaults to 40
9+
className?: string; // The class name to set on the DatGui div
10+
style?: StyleSheet; // The style object to set on the DatGui div
11+
}
12+
13+
export default class DatGui extends React.Component<DatGuiProps, any> { }
14+
15+
export class DatUnchangableFieldProps {
16+
label?: string;
17+
}
18+
19+
export class DatChangableFieldProps extends DatUnchangableFieldProps {
20+
path: string;
21+
}
22+
23+
export interface DatButtonProps extends DatUnchangableFieldProps {
24+
onClick: (e: React.MouseEvent) => any;
25+
}
26+
27+
export class DatButton extends React.Component<DatButtonProps, any> { }
28+
29+
export interface DatFolderProps extends DatUnchangableFieldProps {
30+
title: string;
31+
closed: boolean;
32+
children: any;
33+
}
34+
35+
export class DatFolder extends React.Component<DatFolderProps, any> { }
36+
37+
export interface DatPresetsProps extends DatUnchangableFieldProps {
38+
onUpdate: (data: any) => any;
39+
options: {
40+
presetName?: string;
41+
data?: any; // Initial data
42+
preset: any; // Your preset
43+
}
44+
}
45+
46+
export class DatPresets extends React.Component<DatPresetsProps, any> { }
47+
48+
export interface DatBooleanProps extends DatChangableFieldProps { }
49+
50+
export class DatBoolean extends React.Component<DatBooleanProps, any> { }
51+
52+
export interface DatColorProps extends DatChangableFieldProps {
53+
[reactColorProp: string]: any;
54+
}
55+
56+
export class DatColor extends React.Component<DatColorProps, any> { }
57+
58+
export interface DatNumberProps extends DatChangableFieldProps {
59+
min: number;
60+
max: number;
61+
step: number;
62+
}
63+
64+
export class DatNumber extends React.Component<DatNumberProps, any> { }
65+
66+
export interface DatSelectProps extends DatChangableFieldProps {
67+
options: any[];
68+
}
69+
70+
export class DatSelect extends React.Component<DatSelectProps, any> { }
71+
72+
export interface DatStringProps extends DatChangableFieldProps { }
73+
74+
export class DatString extends React.Component<DatStringProps, any> { }

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "react-dat-gui",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "dat.GUI reimagined for React",
55
"main": "build/react-dat-gui.js",
66
"style": "build/react-dat-gui.css",
7+
"types": "index.d.ts",
78
"contributors": [
89
{
910
"name": "Claus Wahlers",

0 commit comments

Comments
 (0)