|
| 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> { } |
0 commit comments