This interface is implemented by a document view object. You can get a reference to an active document view using the activeView property. All views of a given document can be accessed using the IDocument.views property.
interface IDocumentView extends ${IWindow} {
// Properties
readonly ${document}: ${IDocument};
readonly ${cursor}: ${ICursor};
readonly ${selection}: ${ISelection};
${insertMode}: boolean;
${displayAs}: ${DisplayAs};
${addressDisplayAs}: ${AddressDisplayAs};
${groupBy}: ${GroupBy};
${columns}: number;
readonly ${currentColumns}: number;
${bigEndian}: boolean;
${encoding}: ${Encodings};
${codePane}: boolean;
${textPane}: boolean;
// Methods
${activateCodePane}(): void;
${activateTextPane}(): void;
${editCell}(value: string, shiftCursor = false): void;
${typeChar}(text: string): void;
${refresh}(): void;
${connectWith}(anotherView: IDocumentView): void;
${disconnect}(): void;
${lockUpdate}(lock: boolean): void;
// Clipboard Methods
${cutAsync}(merge = false): Promise<void>;
${copyAsync}(merge = false): Promise<void>;
${pasteAsync}(textPane?: boolean): Promise<void>;
${clearAsync}(): Promise<void>;
// Selection Methods
${selectAll}(): void;
${selectModifiedAsync}(): Promise<void>;
${copySelectionRangesAsync}(): Promise<void>;
${exportSelectionRangesAsync}(fileName: string): Promise<void>;
${saveSelectionAsync}(fileName: string): Promise<void>;
${loadSelectionAsync}(fileName: string, loadType = ${SelectionLoadType}.New): Promise<void>;
// Navigation Methods
${goto}(offset: number, gotoMode: ${GotoMode}, selectUpdateFlags = ${SelectionUpdateMode}.NoChange): void;
// Document Modification Methods
${fillAsync}(pattern: ${IPattern}, range?: ${ISelection}, flags = ${FillFlags}.None): Promise<void>;
${insert}(pattern: ${IPattern}, size?: number): void;
${insertFile}(path: string, insertMode?: boolean): void;
${insertHexAsync}(path: string, format: ${HexFormat}, flags = ${InsertHexFlags}.None): Promise<void>;
${encryptAsync}(providerName: string,
providerType: number,
algorithmId: number,
keyLength: number,
password: string,
range: ${ISelection}): Promise<void>;
${decryptAsync}(providerName: string,
providerType: number,
algorithmId: number,
keyLength: number,
password: string,
range: ${ISelection}): Promise<void>;
${modifyBits}(mask: number): void;
${gapAsync}(range: ${ISelection}): Promise<void>;
// Find Methods
${findAsync}(pattern: ${IPattern}, range: ${ISelection}, flags = ${FindFlags}.Forward): Promise<${FindResult}>;
${findRegExpAsync}(pattern: string,
unicode: boolean,
flags = ${FindFlags}.Forward,
subExpression = 0): Promise<${FindResult}>;
${findNextAsync}(): Promise<${FindResult}>;
${findPrevAsync}(): Promise<${FindResult}>;
${findAllAsync}(pattern: ${IPattern}, range: ${ISelection}, flags = ${FindFlags}.Forward): Promise<number>;
${findAllRegExpAsync}(pattern: string,
unicode: boolean,
flags = ${FindFlags}.Forward,
subExpression = 0): Promise<number>;
// Replace Methods
${replaceAsync}(command: ${ReplaceCommand},
findPattern: ${IPattern},
range: ${ISelection},
replacePattern: ${IPattern},
flags = ${FindFlags}.None): Promise<boolean>;
${replaceRegExpAsync}(findPattern: string,
findUnicode: boolean,
replacePattern: string | ${IPattern},
flags = ${FindFlags}.None,
subExpression = 0,
replaceRegExpUnicode = false): Promise<boolean>;
${replaceAllAsync}(findPattern: ${IPattern},
range: ${ISelection},
replacePattern: ${IPattern},
flags = ${FindFlags}.None): Promise<number>;
${replaceAllRegExpAsync}(findPattern: string,
findUnicode: boolean,
replacePattern: string | ${IPattern},
flags = ${FindFlags}.None,
subExpression = 0,
replaceRegExpUnicode = false): Promise<number>;
// Data Operations
${bitwiseOpAsync}(operation: ${BitwiseOperation}, pattern: ${IPattern}, range: ${OperationRange}): Promise<void>;
${arithmeticOpAsync}(operation: ${ArithmeticOperation},
range: ${OperationRange},
value?: number,
operandSize?: ${OperandSize}): Promise<void>;
${shiftOpAsync}(operation: ${ShiftOperation},
range: ${OperationRange},
value: number,
operandSize?: ${OperandSize}): Promise<void>;
${caseOpAsync}(operation: ${CaseOperation},
range: ${OperationRange},
encoding: ${Encodings}): Promise<void>;
${reverseOpAsync}(operation: ${ReverseOperation},
range: ${OperationRange},
operandSize?: ${OperandSize}): Promise<void>;
}
// This interface is not available in managed environment
// This interface is not available in native environment
readonly document: ${IDocument};
// This property is not available in managed environment
// This property is not available in native environment
Returns a reference to a view's document object.
readonly cursor: ${ICursor};
// This property is not available in managed environment
// This property is not available in native environment
Returns a reference to a view's cursor object.
readonly selection: ${ISelection};
// This property is not available in managed environment
// This property is not available in native environment
Returns a reference to a view's selection object.
insertMode: boolean;
// This property is not available in managed environment
// This property is not available in native environment
Query or change the current view's insert mode.
displayAs: ${DisplayAs};
// This property is not available in managed environment
// This property is not available in native environment
Query or change the current view's view type.
addressDisplayAs: ${AddressDisplayAs};
// This property is not available in managed environment
// This property is not available in native environment
Query or change the current view's address display type.
groupBy: ${GroupBy};
// This property is not available in managed environment
// This property is not available in native environment
Query or change the grouping mode.
columns: number;
// This property is not available in managed environment
// This property is not available in native environment
Query or change the number of columns in an editor window. Set to 0
to switch to “auto columns” mode.
readonly currentColumns: number;
// This property is not available in managed environment
// This property is not available in native environment
Returns the actual number of columns. Equals columns
unless it is 0
. In the latter case, returns the actual number of columns.
bigEndian: boolean;
// This property is not available in managed environment
// This property is not available in native environment
Query or change the editor window's byte order.
encoding: ${Encodings};
// This property is not available in managed environment
// This property is not available in native environment
Query or change the current view's encoding. Set to Encodings.UTF16 to switch to the UNICODE mode.
codePane: boolean;
// This property is not available in managed environment
// This property is not available in native environment
Switch the code pane on or off.
textPane: boolean;
// This property is not available in managed environment
// This property is not available in native environment
Switch the text pane on or off.
activateCodePane(): void;
// This method is not available in managed environment
// This method is not available in native environment
Activate the code pane (move cursor to the code pane).
activateTextPane(): void;
// This method is not available in managed environment
// This method is not available in native environment
Activate the text pane (move cursor to the text pane).
editCell(value: string, shiftCursor = false): void;
// This method is not available in managed environment
// This method is not available in native environment
value
shiftCursor
true
to automatically shift cursor to the next cell.Changes the value in the current cell. Used for decimal and floating-point value types.
typeChar(text: string): void;
// This method is not available in managed environment
// This method is not available in native environment
text
Changes the value in the current cell. Used for hexadecimal, octal and binary value types.
refresh(): void;
// This method is not available in managed environment
// This method is not available in native environment
connectWith(anotherView: IDocumentView): void;
// This method is not available in managed environment
// This method is not available in native environment
anotherView
this
.Connects two views. After connection, cursor movement and position are synchronized between the views. Use the disconnect method to break the connection. If one of the connected views is closed, the connection is also broken.
If the view has been previously connected, it is disconnected first.
var doc1 = ${openFile}("c:\\temp\\document1.bin");
var doc2 = ${openFile}("c:\\temp\\document2.bin");
doc1.views[0].connectWith(doc2.views[0]);
disconnect(): void;
// This method is not available in managed environment
// This method is not available in native environment
Disconnect the current view from any connected view. You don't have to disconnect the other “end” of a connection, it gets disconnected automatically.
lockUpdate(lock: boolean): void;
// This method is not available in managed environment
// This method is not available in native environment
lock
true
to lock window updates and false
to unlock.Lock all updates to the document view's window (if lock
is set to true
) or unlock and refresh the window (if lock
is set to false
).
You must unlock the window before the script stops execution.
cutAsync(merge = false): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
merge
true
to merge selection ranges together, false
to leave them as is.A promise object that gets completed as soon as operation finishes.
Delete the selected ranges from the document and put them into the Clipboard. Optional merge
parameter specifies whether multiple selection ranges should be joined into a single range.
copyAsync(merge = false): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
merge
true
to merge selection ranges together, false
to leave them as is.A promise object that gets completed as soon as operation finishes.
Copy selected document data into the Clipboard. Optional merge
parameter specifies whether multiple selection ranges should be joined into a single range.
pasteAsync(textPane?: boolean): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
textPane
true
to paste into the text pane, false
to paste into the code pane. If omitted, the current pane is used.A promise object that gets completed as soon as operation finishes.
Paste data from the Clipboard into the document.
clearAsync(): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
A promise object that gets completed as soon as operation finishes.
Deletes selected data from the document.
selectAll(): void;
// This method is not available in managed environment
// This method is not available in native environment
Select the entire document.
selectModifiedAsync(): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
A promise object that gets completed as soon as operation finishes.
Add all modified data ranges to a selection.
copySelectionRangesAsync(): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
A promise object that gets completed as soon as operation finishes.
Copy the selection ranges information in text format into the Clipboard.
exportSelectionRangesAsync(fileName: string): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
fileName
A promise object that gets completed as soon as operation finishes.
Export the selection ranges information in text format into the given file.
saveSelectionAsync(fileName: string): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
fileName
A promise object that gets completed as soon as operation finishes.
Save the current selection into the file.
loadSelectionAsync(fileName: string, loadType = ${SelectionLoadType}.New): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
fileName
loadType
A promise object that gets completed as soon as operation finishes.
Load a selection from a file and optionally combine it with a current selection, depending on the value of loadType
parameter.
goto(offset: number, gotoMode: ${GotoMode}, selectUpdateFlags = ${SelectionUpdateMode}.NoChange): void;
// This method is not available in managed environment
// This method is not available in native environment
offset
gotoMode
parameter tells how to interpret this parameter.gotoMode
offset
parameter.selectUpdateFlags
Move the cursor (and collapse all alternate cursors) to a given offset. The value of the offset
parameter is interpreted according to the gotoMode
parameter. You can also specify how the operation affects the current selection with an optional selectUpdateFlags
parameter. See the SelectionUpdateMode section for more information.
fillAsync(pattern: ${IPattern}, range?: ${ISelection}, flags = ${FillFlags}.None): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
pattern
range
flags
A promise object that gets completed as soon as operation finishes.
Fill the given selection (or a current selection, if range
is null or omitted) with a given pattern
. Optional flags
parameter specify the operation mode.
insert(pattern: ${IPattern}, size?: number): void;
// This method is not available in managed environment
// This method is not available in native environment
pattern
size
pattern
, only part of a pattern is used, it the size is greater than the size of a pattern
, a pattern is repeated. If omitted or equals to zero, the actual pattern's size is used.Insert (or overwrite) a given pattern into the document. Insertion takes place at each multiple cursor location. The value of the IDocumentView.insertMode property is taken into account when performing this operation.
insertFile(path: string, insertMode?: boolean): void;
// This method is not available in managed environment
// This method is not available in native environment
path
insertMode
true
to insert the file into the document, false
to overwrite existing data. If omitted, the value of the IDocumentView.insertMode property is used.Insert the contents of a given file at each multiple cursor location. The insertMode
parameter tells if the existing data should be overwritten or not.
insertHexAsync(path: string, format: ${HexFormat}, flags = ${InsertHexFlags}.None): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
path
null
to take file contents from the Clipboard.format
flags
A promise object that gets completed as soon as operation finishes.
Insert the (decoded) contents of a given encoded hex file in the editor. format
is used to specify the format of the hex file and flags
modify the file decoding behavior.
encryptAsync(providerName: string,
providerType: number,
algorithmId: number,
keyLength: number,
password: string,
range: ${ISelection}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
providerName
providerType
algorithmId
keyLength
0
.password
range
Promise object that get completed as soon as operation finishes.
Encrypt the given selection using specified cryptographic algorithm and using a passed password
to generate encryption key.
decryptAsync(providerName: string,
providerType: number,
algorithmId: number,
keyLength: number,
password: string,
range: ${ISelection}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
providerName
providerType
algorithmId
keyLength
0
.password
range
Promise object that get completed as soon as operation finishes.
Decrypt the given selection using specified cryptographic algorithm and using a passed password
to generate encryption key.
modifyBits(mask: number): void;
// This method is not available in managed environment
// This method is not available in native environment
mask
Modify the current cell with a given mask.
gapAsync(range: ${ISelection}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
range
“Gaps” specified regions, that is, marks them as “absent”. Currently persisted only in encoded binary formats, like Intel HEX or Motorola S-records.
findAsync(pattern: ${IPattern}, range: ${ISelection}, flags = ${FindFlags}.Forward): Promise<${FindResult}>;
// This method is not available in managed environment
// This method is not available in native environment
pattern
range
flags
A promise object that gets completed when a next occurrence is found or the end of the file is reached.
Find the first occurrence of a given pattern
in a given range
. Optional flags
parameter modifies the search. The method returns a promise that produces an instance of a FindResult object when completes. If no more occurrences have been found, the result is null
.
findRegExpAsync(pattern: string,
unicode: boolean,
flags = ${FindFlags}.Forward,
subExpression = 0): Promise<${FindResult}>;
// This method is not available in managed environment
// This method is not available in native environment
pattern
unicode
true
to search for UTF-16 encoded text, false
to use the current encoding.flags
subExpression
0
means the full expression.A promise object that gets completed when a next occurrence is found or the end of the file is reached.
Find the first occurrence of a given regular expression pattern. Optional flags
parameter modifies the search. The method returns a promise that produces an instance of a FindResult object when completes. If no more occurrences have been found, the result is null
.
findNextAsync(): Promise<${FindResult}>;
// This method is not available in managed environment
// This method is not available in native environment
A promise object that gets completed when a next occurrence is found or the end of the file is reached.
Find the next occurrence of a pattern used in the previous search.
findPrevAsync(): Promise<${FindResult}>;
// This method is not available in managed environment
// This method is not available in native environment
A promise object that gets completed when a next occurrence is found or the beginning of the file is reached.
Find the previous occurrence of a pattern used in the previous search.
findAllAsync(pattern: ${IPattern}, range: ${ISelection}, flags = ${FindFlags}.Forward): Promise<number>;
// This method is not available in managed environment
// This method is not available in native environment
pattern
range
flags
A promise object that gets completed when a all occurrences have been found. The promise result is the total number of occurrences.
Locate all instances of a given pattern and select them in a document view. This methods returns a promise that produces a total number of occurrences when completed.
findAllRegExpAsync(pattern: string,
unicode: boolean,
flags = ${FindFlags}.Forward,
subExpression = 0): Promise<number>;
// This method is not available in managed environment
// This method is not available in native environment
pattern
unicode
true
to search for UTF-16 encoded text, false
to use the current encoding.flags
subExpression
0
means the full expression.A promise object that gets completed when a all occurrences have been found. The promise result is the total number of occurrences.
Locate all instances of a given regular expression pattern and select them in a document view. This methods returns a promise that produces a total number of occurrences when completed.
replaceAsync(command: ${ReplaceCommand},
findPattern: ${IPattern},
range: ${ISelection},
replacePattern: ${IPattern},
flags = ${FindFlags}.None): Promise<boolean>;
// This method is not available in managed environment
// This method is not available in native environment
command
findPattern
range
replacePattern
flags
A promise object that gets completed the when operation finishes. The promise yields a boolean that tells if the match was found.
Find the next occurrence of a findPattern
if command
equals ReplaceCommand.Find or replace the last found occurrence with a replacePattern
if command
equals ReplaceCommand.Replace.
replaceRegExpAsync(findPattern: string,
findUnicode: boolean,
replacePattern: string | ${IPattern},
flags = ${FindFlags}.None,
subExpression = 0,
replaceRegExpUnicode = false): Promise<boolean>;
// This method is not available in managed environment
// This method is not available in native environment
findPattern
findUnicode
true
to treat search string as UTF-16
encoded and false
to use the current view's encoding.replacePattern
flags
subExpression
0
matches the whole expression.replaceRegExpUnicode
replacePattern
is a regular expression replace pattern, specifies if it has UTF-16
encoding.A promise object that gets completed when a match is found. The promise result is true
if match is found and false
otherwise.
command: ReplaceCommand
Find and replace a next match of a specified regular expression. A replace pattern may either be a pattern object or a special form of regular expression, called replace regular expression.
replaceAllAsync(findPattern: ${IPattern},
range: ${ISelection},
replacePattern: ${IPattern},
flags = ${FindFlags}.None): Promise<number>;
// This method is not available in managed environment
// This method is not available in native environment
findPattern
range
replacePattern
flags
A promise object that gets completed when a all occurrences have been found. The promise result is the total number of occurrences.
Find and replace all occurrences of a findPattern
with a replacePattern
. the next occurrence of a given regular expression. If match is found, it is replaced with a replacePattern
, which can be either a pattern object or a replace regular expression string.
replaceAllRegExpAsync(findPattern: string,
findUnicode: boolean,
replacePattern: string | ${IPattern},
flags = ${FindFlags}.None,
subExpression = 0,
replaceRegExpUnicode = false): Promise<number>;
// This method is not available in managed environment
// This method is not available in native environment
findPattern
findUnicode
true
to treat search string as UTF-16
encoded and false
to use the current view's encoding.replacePattern
flags
subExpression
0
matches the whole expression.replaceRegExpUnicode
replacePattern
is a regular expression replace pattern, specifies if it has UTF-16
encoding.A promise object that gets completed when a all occurrences have been found. The promise result is the total number of occurrences.
Replace all occurrences of a given regular expression with either pattern object or a replace regular expression.
bitwiseOpAsync(operation: ${BitwiseOperation}, pattern: ${IPattern}, range: ${OperationRange}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
operation
pattern
range
A promise object that gets completed when the operation finishes.
Perform a given bitwise operation. For all values of the operation
parameter besides BitwiseOperation.Not, a non-empty pattern
is required.
await ${activeView}.bitwiseOpAsync(${BitwiseOperation.Xor}, ${createPattern}(new Uint8Array([0xaa])), ${OperationRange.WholeFile});
arithmeticOpAsync(operation: ${ArithmeticOperation},
range: ${OperationRange},
value?: number,
operandSize?: ${OperandSize}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
operation
range
value
operation
equals ArithmeticOperation.Negation.operandSize
A promise object that gets completed when the operation finishes.
Perform a given arithmetic operation. All arithmetic operations besides ArithmeticOperation.Negation require an operand.
await ${activeView}.arithmeticOpAsync(${ArithmeticOperation.Multiplication}, ${OperationRange.WholeFile}, 2, ${OperandSize.Word});
shiftOpAsync(operation: ${ShiftOperation},
range: ${OperationRange},
value: number,
operandSize?: ${OperandSize}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
operation
range
value
operandSize
A promise object that gets completed when the operation finishes.
Perform a given shift operation.
await ${activeView}.shiftOpAsync(${ShiftOperation.RotateLeft}, ${OperationRange.WholeFile}, 3, ${OperandSize.Word});
caseOpAsync(operation: ${CaseOperation},
range: ${OperationRange},
encoding: ${Encodings}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
operation
range
encoding
A promise object that gets completed when the operation finishes.
Perform a given case change operation.
await ${activeView}.caseOpAsync(${CaseOperation.Toggle}, ${OperationRange.WholeFile}, activeView.encoding);
reverseOpAsync(operation: ${ReverseOperation},
range: ${OperationRange},
operandSize?: ${OperandSize}): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
operation
range
operandSize
A promise object that gets completed when the operation finishes.
Perform a given bit or byte reverse operation.
await ${activeView}.reverseOpAsync(${ReverseOperation.Bits}, ${OperationRange.WholeFile}, ${OperandSize.Word});
IWindow IDocument ICursor ISelection DisplayAs AddressDisplayAs GroupBy Encodings SelectionLoadType GotoMode SelectionUpdateMode IPattern FillFlags FindFlags FindResult ReplaceCommand BitwiseOperation OperationRange ArithmeticOperation OperandSize activeView createPattern BitwiseOperation.Xor OperationRange.WholeFile ArithmeticOperation.Multiplication OperandSize.Word ShiftOperation ShiftOperation.RotateLeft CaseOperation CaseOperation.Toggle ReverseOperation ReverseOperation.Bits openFile