Module: libs/vscode-common/testUtil/toPlainObject
Type aliases
PositionPlainObject
Ƭ PositionPlainObject: Object
Type declaration
Name | Type |
---|---|
character | number |
line | number |
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:6
RangePlainObject
Ƭ RangePlainObject: Object
Type declaration
Name | Type |
---|---|
end | PositionPlainObject |
start | PositionPlainObject |
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:11
SelectionPlainObject
Ƭ SelectionPlainObject: Object
Type declaration
Name | Type |
---|---|
active | PositionPlainObject |
anchor | PositionPlainObject |
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:16
SerializedMarks
Ƭ SerializedMarks: Object
Index signature
▪ [decoratedCharacter: string
]: RangePlainObject
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:52
TargetPlainObject
Ƭ TargetPlainObject: Object
Type for a plain object representing a Target, to be used for
serialization via json. Note that this definition is still quite incomplete,
as it is missing a lot of attributes, so today can only properly round-trip
an UntypedTarget
, but for other types it at least captures the fact that
they are not UntypedTargets
, so we can use to check that actions return
rich targets, even if we don't check everything about the target, and we
can't use it to construct rich targets as inputs to actions in tests.
Type declaration
Name | Type | Description |
---|---|---|
contentRange | RangePlainObject | Corresponds to Target.contentRange |
hasExplicitRange | boolean | Corresponds to Target.hasExplicitRange. |
isReversed | boolean | Corresponds to Target.isReversed. |
type | string | The type name of the target, eg UntypedTarget . |
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:30
Functions
marksToPlainObject
▸ marksToPlainObject(marks
): SerializedMarks
Parameters
Name | Type |
---|---|
marks | Object |
Returns
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:98
positionToPlainObject
▸ positionToPlainObject(__namedParameters
): PositionPlainObject
Parameters
Name | Type |
---|---|
__namedParameters | Position |
Returns
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:91
rangeToPlainObject
▸ rangeToPlainObject(range
): RangePlainObject
Parameters
Name | Type |
---|---|
range | Range |
Returns
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:56
selectionToPlainObject
▸ selectionToPlainObject(selection
): SelectionPlainObject
Parameters
Name | Type |
---|---|
selection | Selection |
Returns
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:63
targetToPlainObject
▸ targetToPlainObject(target
): TargetPlainObject
Given a target, constructs an object suitable for serialization by json. Note that this implementation is quite incomplete, but is suitable for round-tripping UntypedTarget objects and capturing the fact that an object is not an un typed target if it is not, via the type attribute.
Parameters
Name | Type | Description |
---|---|---|
target | Target | The target to convert to a plain object |
Returns
A plain object that can be json serialized
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:82
testDecorationsToPlainObject
▸ testDecorationsToPlainObject(decorations
): { end
: PositionPlainObject
; name
: "pendingDeleteBackground"
| "referencedBackground"
| "pendingModification0Background"
| "pendingModification1Background"
| "justAddedBackground"
| "highlight0Background"
| "highlight1Background"
; start
: PositionPlainObject
; type
: "token"
| "line"
}[]
Parameters
Name | Type |
---|---|
decorations | TestDecoration [] |
Returns
{ end
: PositionPlainObject
; name
: "pendingDeleteBackground"
| "referencedBackground"
| "pendingModification0Background"
| "pendingModification1Background"
| "justAddedBackground"
| "highlight0Background"
| "highlight1Background"
; start
: PositionPlainObject
; type
: "token"
| "line"
}[]
Defined in
libs/vscode-common/testUtil/toPlainObject.ts:109