Skip to content

Commit

Permalink
Remove selectOpInfo (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
chacha912 authored Aug 29, 2023
1 parent 2ac69bb commit 5527603
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
23 changes: 8 additions & 15 deletions src/document/operation/edit_operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,14 @@ export class EditOperation extends Operation {
if (!this.fromPos.equals(this.toPos)) {
root.registerElementHasRemovedNodes(text);
}
return changes.map(({ type, from, to, value }) => {
return type === 'content'
? {
type: 'edit',
from,
to,
value,
path: root.createPath(this.getParentCreatedAt()),
}
: {
type: 'select',
from,
to,
path: root.createPath(this.getParentCreatedAt()),
};
return changes.map(({ from, to, value }) => {
return {
type: 'edit',
from,
to,
value,
path: root.createPath(this.getParentCreatedAt()),
};
}) as Array<OperationInfo>;
}

Expand Down
12 changes: 1 addition & 11 deletions src/document/operation/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type OperationInfo =
/**
* `TextOperationInfo` represents the OperationInfo for the yorkie.Text.
*/
export type TextOperationInfo = EditOpInfo | StyleOpInfo | SelectOpInfo;
export type TextOperationInfo = EditOpInfo | StyleOpInfo;

/**
* `CounterOperationInfo` represents the OperationInfo for the yorkie.Counter.
Expand Down Expand Up @@ -130,16 +130,6 @@ export type StyleOpInfo = {
};
};

/**
* `SelectOpInfo` represents the information of the select operation.
*/
export type SelectOpInfo = {
type: 'select';
from: number;
to: number;
path: string;
};

/**
* `TreeEditOpInfo` represents the information of the tree edit operation.
*/
Expand Down
1 change: 0 additions & 1 deletion src/yorkie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export type {
MoveOpInfo,
EditOpInfo,
StyleOpInfo,
SelectOpInfo,
} from '@yorkie-js-sdk/src/document/operation/operation';

export {
Expand Down

0 comments on commit 5527603

Please sign in to comment.