react-native-draggable icon indicating copy to clipboard operation
react-native-draggable copied to clipboard

Declaration file has invalid types

Open coreyar opened this issue 5 years ago • 0 comments

The index.d.ts file has invalid type code. The defaultProps assignment is not a type and causes compilation errors.

Invalid typing

Draggable.defaultProps = {
    renderText: '+',
    renderSize: 36,
    shouldReverse: false,
    disabled: false,
    debug: false,
    onDrag: () => {},
    onShortPressRelease: () => {},
    onDragRelease: () => {},
    onLongPress: () => {},
    onPressIn: () => {},
    onPressOut: () => {},
    onRelease: () => {},
    x: 0,
    y: 0,
    z: 1,
}

Errors

node_modules/react-native-draggable/index.d.ts:39:1 - error TS1036: Statements are not allowed in ambient contexts.
39 Draggable.defaultProps = {
node_modules/react-native-draggable/index.d.ts:45:19 - error TS1183: An implementation cannot be declared in ambient contexts.
45     onDrag: () => {},
node_modules/react-native-draggable/index.d.ts:46:32 - error TS1183: An implementation cannot be declared in ambient contexts.
46     onShortPressRelease: () => {},
node_modules/react-native-draggable/index.d.ts:47:26 - error TS1183: An implementation cannot be declared in ambient contexts.
47     onDragRelease: () => {},
node_modules/react-native-draggable/index.d.ts:48:24 - error TS1183: An implementation cannot be declared in ambient contexts.
48     onLongPress: () => {},
node_modules/react-native-draggable/index.d.ts:49:22 - error TS1183: An implementation cannot be declared in ambient contexts.
49     onPressIn: () => {},
node_modules/react-native-draggable/index.d.ts:50:23 - error TS1183: An implementation cannot be declared in ambient contexts.
50     onPressOut: () => {},
node_modules/react-native-draggable/index.d.ts:51:22 - error TS1183: An implementation cannot be declared in ambient contexts.
51     onRelease: () => {},

coreyar avatar Aug 24 '20 11:08 coreyar