Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Make a few types exact
Browse files Browse the repository at this point in the history
Summary: We have some types that could benefit from being exact. In general these are preferable for reasons of control and safety.

Reviewed By: dunnbobcat

Differential Revision: D20637710

fbshipit-source-id: 5d6090c51309eff2154406da2de6ec5948ec9360
  • Loading branch information
mrkev authored and facebook-github-bot committed Mar 27, 2020
1 parent 153482f commit 0950285
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/component/selection/DOMDerivedSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

import type SelectionState from 'SelectionState';

export type DOMDerivedSelection = {
export type DOMDerivedSelection = {|
selectionState: SelectionState,
needsRecovery: boolean,
...
};
|};
5 changes: 2 additions & 3 deletions src/component/selection/DraftOffsetKeyPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

'use strict';

export type DraftOffsetKeyPath = {
export type DraftOffsetKeyPath = {|
blockKey: string,
decoratorKey: number,
leafKey: number,
...
};
|};
5 changes: 2 additions & 3 deletions src/component/selection/getDraftEditorSelectionWithNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ const invariant = require('invariant');
const isElement = require('isElement');
const nullthrows = require('nullthrows');

type SelectionPoint = {
type SelectionPoint = {|
key: string,
offset: number,
...
};
|};

/**
* Convert the current selection range to an anchor/focus pair of offset keys
Expand Down
5 changes: 2 additions & 3 deletions src/component/selection/getRangeBoundingClientRect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@

const getRangeClientRects = require('getRangeClientRects');

export type FakeClientRect = {
export type FakeClientRect = {|
left: number,
width: number,
right: number,
top: number,
bottom: number,
height: number,
...
};
|};

/**
* Like range.getBoundingClientRect() but normalizes for browser bugs.
Expand Down

0 comments on commit 0950285

Please sign in to comment.