Skip to content

Commit

Permalink
fixing flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon committed May 17, 2018
1 parent 65b7eb0 commit 9d0725b
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 134 deletions.
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"dist/react-beautiful-dnd.js": {
"bundled": 400269,
"minified": 151652,
"gzipped": 43139
"bundled": 391074,
"minified": 148259,
"gzipped": 42162
},
"dist/react-beautiful-dnd.min.js": {
"bundled": 358556,
"minified": 134751,
"gzipped": 38201
"bundled": 353559,
"minified": 135149,
"gzipped": 37985
},
"dist/react-beautiful-dnd.esm.js": {
"bundled": 177759,
"minified": 89807,
"gzipped": 22649,
"bundled": 174113,
"minified": 88585,
"gzipped": 22372,
"treeshaked": {
"rollup": 78288,
"webpack": 80060
"rollup": 76698,
"webpack": 78485
}
}
}
1 change: 1 addition & 0 deletions src/state/action-creators.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const bulkCollectionStarting = (): BulkCollectionStartingAction => ({
});

type UpdateDroppableScrollArgs = {
id: DroppableId,
offset: Position,
}

Expand Down
8 changes: 2 additions & 6 deletions src/state/auto-scroller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type Position } from 'css-box-model';
import createFluidScroller, { type FluidScroller } from './fluid-scroller';
import createJumpScroller, { type JumpScroller } from './jump-scroller';
import type { AutoScroller } from './auto-scroller-types';
import { move as moveAction } from '../action-creators';
import type {
DraggableId,
DroppableId,
Expand All @@ -13,12 +14,7 @@ import type {
type Args = {|
scrollDroppable: (id: DroppableId, change: Position) => void,
scrollWindow: (change: Position) => void,
move: (
id: DraggableId,
client: Position,
viewport: Viewport,
shouldAnimate?: boolean
) => void,
move: typeof moveAction,
|}

export default ({
Expand Down
11 changes: 3 additions & 8 deletions src/state/auto-scroller/jump-scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
getWindowOverlap,
getDroppableOverlap,
} from './can-scroll';
import { move as moveAction } from '../action-creators';
import type {
DraggableId,
DroppableId,
DroppableDimension,
DraggableLocation,
Expand All @@ -20,12 +20,7 @@ import type {
type Args = {|
scrollDroppable: (id: DroppableId, offset: Position) => void,
scrollWindow: (offset: Position) => void,
move: (
id: DraggableId,
client: Position,
viewport: Viewport,
shouldAnimate?: boolean
) => void,
move: typeof moveAction,
|}

export type JumpScroller = (state: DraggingState | BulkCollectionState) => void;
Expand All @@ -39,7 +34,7 @@ export default ({
}: Args): JumpScroller => {
const moveByOffset = (state: DraggingState | BulkCollectionState, offset: Position) => {
const client: Position = add(state.current.client.selection, offset);
move(state.critical.draggable.id, client, state.window.viewport, true);
move({ client, shouldAnimate: true });
};

const scrollDroppableAsMuchAsItCan = (
Expand Down
5 changes: 2 additions & 3 deletions src/state/dimension-marshal/dimension-marshal-types.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import { type Position } from 'css-box-model';
import {
bulkCollectionStarting
bulkCollectionStarting,
type BulkReplaceArgs,
} from '../action-creators';
import type {
Expand Down Expand Up @@ -58,8 +58,6 @@ export type Entries = {|
|}

export type DimensionMarshal = {|
// to let the system know a bulk collection is starting
onBulkCollectionStart: typeof bulkCollectionStarting,
// Draggable
registerDraggable: (
descriptor: DraggableDescriptor,
Expand Down Expand Up @@ -97,4 +95,5 @@ export type Callbacks = {|
bulkReplace: (args: BulkReplaceArgs) => void,
updateDroppableScroll: (id: DroppableId, newScroll: Position) => void,
updateDroppableIsEnabled: (id: DroppableId, isEnabled: boolean) => void,
bulkCollectionStarting: typeof bulkCollectionStarting,
|}
2 changes: 1 addition & 1 deletion src/state/middleware/util/message-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
DragStart,
DragUpdate,
DropResult,
} from '../../types';
} from '../../../types';

export type MessagePreset = {|
onDragStart: (start: DragStart) => string,
Expand Down
Loading

0 comments on commit 9d0725b

Please sign in to comment.