Skip to main content

Module: util/tryConstructTarget

Namespaces

Functions

constructLineTarget

constructLineTarget(editor, range, isReversed): LineTarget | undefined

Constructs a LineTarget from the given range, or returns undefined if the range is undefined

Parameters

NameTypeDescription
editorTextEditorThe editor containing the range
rangeundefined | RangeThe range to convert into a target
isReversedbooleanWhether the rain should be backward

Returns

LineTarget | undefined

A new LineTarget constructed from the given range, or null if the range is undefined

Defined in

util/tryConstructTarget.ts:64


tryConstructPlainTarget

tryConstructPlainTarget(editor, range, isReversed): PlainTarget | undefined

Constructs a PlainTarget from the given range, or returns undefined if the range is undefined

Parameters

NameTypeDescription
editorTextEditorThe editor containing the range
rangeundefined | RangeThe range to convert into a target
isReversedbooleanWhether the rain should be backward

Returns

PlainTarget | undefined

A new PlainTarget constructed from the given range, or null if the range is undefined

Defined in

util/tryConstructTarget.ts:47


tryConstructTarget

tryConstructTarget<T>(constructor, editor, range, isReversed): T | undefined

Constructs a target from the given range or returns undefined if the range is undefined

Type parameters

NameType
Textends Target

Parameters

NameTypeDescription
constructorTargetConstructor<T>The type of target to construct
editorTextEditorThe editor containing the range
rangeundefined | RangeThe range to convert into a target
isReversedbooleanWhether the rain should be backward

Returns

T | undefined

A new target constructed from the given range, or null if the range is undefined

Defined in

util/tryConstructTarget.ts:23