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

Commit 010fce7

Browse files
iwonbigbrofacebook-github-bot
authored andcommitted
Revert D13097194: [codemod][types-first] Add type annotations to html/shared
Differential Revision: D13097194 Original commit changeset: 3e698c746fda fbshipit-source-id: 8af5ee4fac8cdeb10726bbc9c650238593ff5f6e
1 parent 6f4102d commit 010fce7

File tree

11 files changed

+32
-42
lines changed

11 files changed

+32
-42
lines changed

src/component/base/DraftEditor.react.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
465465
* a specified scroll position (for cases like `cut` behavior where it should
466466
* be restored to a known position).
467467
*/
468-
focus: any = (scrollPosition?: DraftScrollPosition): void => {
468+
focus = (scrollPosition?: DraftScrollPosition): void => {
469469
const {editorState} = this.props;
470470
const alreadyHasFocus = editorState.getSelection().getHasFocus();
471471
const editorNode = ReactDOM.findDOMNode(this.editor);
@@ -504,7 +504,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
504504
}
505505
};
506506

507-
blur: any = (): void => {
507+
blur = (): void => {
508508
const editorNode = ReactDOM.findDOMNode(this.editor);
509509
invariant(
510510
editorNode instanceof HTMLElement,
@@ -520,11 +520,11 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
520520
* handler module to ensure that DOM events are managed appropriately for
521521
* the active mode.
522522
*/
523-
setMode: any = (mode: DraftEditorModes): void => {
523+
setMode = (mode: DraftEditorModes): void => {
524524
this._handler = handlerMap[mode];
525525
};
526526

527-
exitCurrentMode: any = (): void => {
527+
exitCurrentMode = (): void => {
528528
this.setMode('edit');
529529
};
530530

@@ -537,7 +537,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
537537
* reconciliation occurs on a version of the DOM that is synchronized with
538538
* our EditorState.
539539
*/
540-
restoreEditorDOM: any = (scrollPosition?: DraftScrollPosition): void => {
540+
restoreEditorDOM = (scrollPosition?: DraftScrollPosition): void => {
541541
this.setState({contentsKey: this.state.contentsKey + 1}, () => {
542542
this.focus(scrollPosition);
543543
});
@@ -548,7 +548,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
548548
*
549549
* Set the clipboard state for a cut/copy event.
550550
*/
551-
setClipboard: any = (clipboard: ?BlockMap): void => {
551+
setClipboard = (clipboard: ?BlockMap): void => {
552552
this._clipboard = clipboard;
553553
};
554554

@@ -557,7 +557,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
557557
*
558558
* Retrieve the clipboard state for a cut/copy event.
559559
*/
560-
getClipboard: any = (): ?BlockMap => {
560+
getClipboard = (): ?BlockMap => {
561561
return this._clipboard;
562562
};
563563

@@ -570,7 +570,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
570570
* an `onChange` prop to receive state updates passed along from this
571571
* function.
572572
*/
573-
update: any = (editorState: EditorState): void => {
573+
update = (editorState: EditorState): void => {
574574
this._latestEditorState = editorState;
575575
this.props.onChange(editorState);
576576
};
@@ -580,14 +580,14 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
580580
* a dragged element enters and leaves the editor (or any of its children),
581581
* to determine when the dragged element absolutely leaves the editor.
582582
*/
583-
onDragEnter: any = (): void => {
583+
onDragEnter = (): void => {
584584
this._dragCount++;
585585
};
586586

587587
/**
588588
* See `onDragEnter()`.
589589
*/
590-
onDragLeave: any = (): void => {
590+
onDragLeave = (): void => {
591591
this._dragCount--;
592592
if (this._dragCount === 0) {
593593
this.exitCurrentMode();

src/component/selection/getRangeClientRects.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ function getRangeClientRectsChrome(range: Range): Array<ClientRect> {
6161
/**
6262
* Like range.getClientRects() but normalizes for browser bugs.
6363
*/
64-
const getRangeClientRects = ((isChrome
64+
const getRangeClientRects = isChrome
6565
? getRangeClientRectsChrome
6666
: function(range: Range): Array<ClientRect> {
6767
return Array.from(range.getClientRects());
68-
}): (range: Range) => Array<ClientRect>);
68+
};
6969

7070
module.exports = getRangeClientRects;

src/component/utils/_DraftTestHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BLACK_LIST_PROPS = ['data-reactroot'];
1515
const transformSnapshotProps = (
1616
node: any,
1717
blackList: Array<string> = BLACK_LIST_PROPS,
18-
): any => {
18+
) => {
1919
const stack = [node];
2020
while (stack.length) {
2121
const node = stack.pop();

src/model/entity/DraftEntityInstance.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const Immutable = require('immutable');
2121

2222
const {Record} = Immutable;
2323

24-
const DraftEntityInstanceRecord = (Record({
24+
const DraftEntityInstanceRecord = Record({
2525
type: 'TOKEN',
2626
mutability: 'IMMUTABLE',
2727
data: Object,
28-
}): any);
28+
});
2929

3030
/**
3131
* An instance of a document entity, consisting of a `type` and relevant

src/model/immutable/BlockTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const defaultDecoratorRange: {
4949
leaves: null,
5050
};
5151

52-
const DecoratorRange = (Record(defaultDecoratorRange): any);
52+
const DecoratorRange = Record(defaultDecoratorRange);
5353

5454
const BlockTree = {
5555
/**

src/model/immutable/CharacterMetadata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const defaultRecord: CharacterMetadataConfig = {
3333
entity: null,
3434
};
3535

36-
const CharacterMetadataRecord = (Record(defaultRecord): any);
36+
const CharacterMetadataRecord = Record(defaultRecord);
3737

3838
class CharacterMetadata extends CharacterMetadataRecord {
3939
getStyle(): DraftInlineStyle {

src/model/immutable/ContentBlock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const defaultRecord: BlockNodeConfig = {
3535
data: Map(),
3636
};
3737

38-
const ContentBlockRecord = (Record(defaultRecord): any);
38+
const ContentBlockRecord = Record(defaultRecord);
3939

4040
const decorateCharacterList = (config: BlockNodeConfig): BlockNodeConfig => {
4141
if (!config) {

src/model/immutable/ContentState.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const defaultRecord: {
4545
selectionAfter: null,
4646
};
4747

48-
const ContentStateRecord = (Record(defaultRecord): any);
48+
const ContentStateRecord = Record(defaultRecord);
4949

5050
class ContentState extends ContentStateRecord {
5151
getEntityMap(): any {
@@ -122,7 +122,7 @@ class ContentState extends ContentStateRecord {
122122
.join(delimiter || '\n');
123123
}
124124

125-
getLastCreatedEntityKey(): string {
125+
getLastCreatedEntityKey() {
126126
// TODO: update this when we fully remove DraftEntity
127127
return DraftEntity.__getLastCreatedEntityKey();
128128
}

src/model/immutable/EditorState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const defaultRecord: EditorStateRecordType = {
6161
undoStack: Stack(),
6262
};
6363

64-
const EditorStateRecord = (Record(defaultRecord): any);
64+
const EditorStateRecord = Record(defaultRecord);
6565

6666
class EditorState {
6767
_immutable: EditorStateRecord;

src/model/immutable/SampleDraftInlineStyle.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,41 @@ module.exports = {
1919
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
2020
* found when Flow v0.85 was deployed. To see the error, delete this comment
2121
* and run Flow. */
22-
BOLD: (OrderedSet.of('BOLD'): OrderedSet<any>),
22+
BOLD: OrderedSet.of('BOLD'),
2323
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
2424
* found when Flow v0.85 was deployed. To see the error, delete this comment
2525
* and run Flow. */
26-
BOLD_ITALIC: (OrderedSet.of('BOLD', 'ITALIC'): OrderedSet<any>),
26+
BOLD_ITALIC: OrderedSet.of('BOLD', 'ITALIC'),
2727
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
2828
* found when Flow v0.85 was deployed. To see the error, delete this comment
2929
* and run Flow. */
30-
BOLD_ITALIC_UNDERLINE: (OrderedSet.of(
31-
'BOLD',
32-
'ITALIC',
33-
'UNDERLINE',
34-
/* $FlowFixMe(>=0.86.0 site=www) This comment suppresses an error found when
35-
* automatically adding a type annotation with the codemod Komodo/Annotate_
36-
* exports. To see the error delete this comment and run Flow. */
37-
): OrderedSet<any>),
30+
BOLD_ITALIC_UNDERLINE: OrderedSet.of('BOLD', 'ITALIC', 'UNDERLINE'),
3831
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
3932
* found when Flow v0.85 was deployed. To see the error, delete this comment
4033
* and run Flow. */
41-
BOLD_UNDERLINE: (OrderedSet.of('BOLD', 'UNDERLINE'): OrderedSet<any>),
34+
BOLD_UNDERLINE: OrderedSet.of('BOLD', 'UNDERLINE'),
4235
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
4336
* found when Flow v0.85 was deployed. To see the error, delete this comment
4437
* and run Flow. */
45-
CODE: (OrderedSet.of('CODE'): OrderedSet<any>),
38+
CODE: OrderedSet.of('CODE'),
4639
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
4740
* found when Flow v0.85 was deployed. To see the error, delete this comment
4841
* and run Flow. */
49-
ITALIC: (OrderedSet.of('ITALIC'): OrderedSet<any>),
42+
ITALIC: OrderedSet.of('ITALIC'),
5043
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
5144
* found when Flow v0.85 was deployed. To see the error, delete this comment
5245
* and run Flow. */
53-
ITALIC_UNDERLINE: (OrderedSet.of('ITALIC', 'UNDERLINE'): OrderedSet<any>),
46+
ITALIC_UNDERLINE: OrderedSet.of('ITALIC', 'UNDERLINE'),
5447
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
5548
* found when Flow v0.85 was deployed. To see the error, delete this comment
5649
* and run Flow. */
57-
NONE: (OrderedSet(): OrderedSet<any>),
50+
NONE: OrderedSet(),
5851
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
5952
* found when Flow v0.85 was deployed. To see the error, delete this comment
6053
* and run Flow. */
61-
STRIKETHROUGH: (OrderedSet.of('STRIKETHROUGH'): OrderedSet<any>),
54+
STRIKETHROUGH: OrderedSet.of('STRIKETHROUGH'),
6255
/* $FlowFixMe(>=0.85.0 site=www,mobile) This comment suppresses an error
6356
* found when Flow v0.85 was deployed. To see the error, delete this comment
6457
* and run Flow. */
65-
UNDERLINE: (OrderedSet.of('UNDERLINE'): OrderedSet<any>),
58+
UNDERLINE: OrderedSet.of('UNDERLINE'),
6659
};

0 commit comments

Comments
 (0)