Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing onLayout prop typings #1607

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import * as ReactNative from 'react-native';
import { GestureResponderEvent, TransformsStyle } from 'react-native';
import { GestureResponderEvent, LayoutChangeEvent, TransformsStyle } from 'react-native';

// Common props
export type NumberProp = string | number;
Expand Down Expand Up @@ -221,6 +221,10 @@ export interface CommonMarkerProps {
markerEnd?: string;
}

export interface NativeProps {
onLayout?: (event: LayoutChangeEvent) => void;
}

export interface CommonPathProps
extends FillProps,
StrokeProps,
Expand All @@ -231,7 +235,8 @@ export interface CommonPathProps
TouchableProps,
DefinitionProps,
CommonMarkerProps,
CommonMaskProps {}
CommonMaskProps,
NativeProps {}

// Element props
export interface CircleProps extends CommonPathProps {
Expand Down
8 changes: 6 additions & 2 deletions src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as React from "react";
import * as ReactNative from "react-native";
import { GestureResponderEvent, TransformsStyle } from "react-native";
import { GestureResponderEvent, LayoutChangeEvent, TransformsStyle } from "react-native";
export type NumberProp = string | number;
export type NumberArray = NumberProp[] | NumberProp;
export type FillRule = "evenodd" | "nonzero";
Expand Down Expand Up @@ -187,6 +187,9 @@ export interface CommonMarkerProps {
markerMid?: string;
markerEnd?: string;
}
export interface NativeProps {
onLayout?: (event: LayoutChangeEvent) => void;
}
export type CommonPathProps = { ... } & FillProps &
StrokeProps &
ClipProps &
Expand All @@ -196,7 +199,8 @@ export type CommonPathProps = { ... } & FillProps &
TouchableProps &
DefinitionProps &
CommonMarkerProps &
CommonMaskProps;
CommonMaskProps &
NativeProps;
export type CircleProps = {
cx?: NumberProp,
cy?: NumberProp,
Expand Down