Skip to content

Commit

Permalink
fix: make all props on Draw components optional in TS typings (#26)
Browse files Browse the repository at this point in the history
fixes #25
  • Loading branch information
amaury1093 authored Mar 23, 2019
1 parent 1b45f34 commit 5b0c307
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ const noop = () => {
type DrawHandler = (event: any) => void;

interface Props {
boxSelect: boolean;
clickBuffer: number;
controls: {
boxSelect?: boolean;
clickBuffer?: number;
controls?: Partial<{
point: boolean;
line_string: boolean;
polygon: boolean;
trash: boolean;
combine_features: boolean;
uncombine_features: boolean;
};
default_mode: string;
displayControlsDefault: boolean;
keybindings: boolean;
modes: object;
onDrawActionable: DrawHandler;
onDrawCombine: DrawHandler;
onDrawCreate: DrawHandler;
onDrawDelete: DrawHandler;
onDrawModeChange: DrawHandler;
onDrawRender: DrawHandler;
onDrawSelectionChange: DrawHandler;
onDrawUncombine: DrawHandler;
onDrawUpdate: DrawHandler;
position: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
touchBuffer: number;
touchEnabled: boolean;
styles: object[];
}>;
default_mode?: string;
displayControlsDefault?: boolean;
keybindings?: boolean;
modes?: object;
onDrawActionable?: DrawHandler;
onDrawCombine?: DrawHandler;
onDrawCreate?: DrawHandler;
onDrawDelete?: DrawHandler;
onDrawModeChange?: DrawHandler;
onDrawRender?: DrawHandler;
onDrawSelectionChange?: DrawHandler;
onDrawUncombine?: DrawHandler;
onDrawUpdate?: DrawHandler;
position?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
touchBuffer?: number;
touchEnabled?: boolean;
styles?: object[];
}

export default class DrawControl extends React.Component<Props> {
Expand Down

0 comments on commit 5b0c307

Please sign in to comment.