///
///
import type { ProtocolResponse, ProtocolResponseData, ProtocolResponseErrorData } from '../ProtocolEvent';
export declare class VariablesResponse implements ProtocolResponse {
static fromJson(data: {
requestId: number;
variables: Variable[];
errorData?: ProtocolResponseErrorData;
}): VariablesResponse;
static fromBuffer(buffer: Buffer): VariablesResponse;
private readVariable;
private readVariableValue;
private flattenVariables;
toBuffer(): Buffer;
private writeVariable;
private writeVariableValue;
success: boolean;
readOffset: number;
data: VariablesResponseData;
}
export interface VariablesResponseData extends ProtocolResponseData {
variables: Variable[];
}
export declare enum VariableFlags {
/**
* value is a child of the requested variable
* e.g., an element of an array or field of an AA
*/
isChildKey = 1,
/**
* value is constant
*/
isConst = 2,
/**
* The referenced value is a container (e.g., a list or array)
*/
isContainer = 4,
/**
* The name is included in this VariableInfo
*/
isNameHere = 8,
/**
* value is reference-counted.
*/
isRefCounted = 16,
/**
* value is included in this VariableInfo
*/
isValueHere = 32,
/**
* Value is container, key lookup is case sensitive
* @since protocol 3.1.0
*/
isKeysCaseSensitive = 64,
/**
* Indicates whether the associated variable is virtual or not.
* @since protocol 3.3.0
*/
isVirtual = 128
}
/**
* Every type of variable supported by the protocol
*/
export declare enum VariableType {
AssociativeArray = "AssociativeArray",
Array = "Array",
Boolean = "Boolean",
Double = "Double",
Float = "Float",
Function = "Function",
Integer = "Integer",
Interface = "Interface",
Invalid = "Invalid",
List = "List",
LongInteger = "LongInteger",
Object = "Object",
String = "String",
Subroutine = "Subroutine",
SubtypedObject = "SubtypedObject",
Uninitialized = "Uninitialized",
Unknown = "Unknown"
}
export interface Variable {
/**
* 0 means this var isn't refCounted, and thus `refCount` will be omitted from reading and writing to buffer
*/
refCount: number;
/**
* I think this means "is this mutatable". Like an object would be isConst=false, but "some string" can only be replaced by a totally new string? But don't quote me on this
*/
isConst: boolean;
/**
* A type-dependent value based on the `variableType` field. It is not present for all types
*/
value: string | number | bigint | boolean | null;
/**
* The type of variable or value.
*/
type: VariableType;
/**
* The variable name. `undefined` means there was no variable name available
*/
name?: string;
/**
* If this variable is a container, what variable type are its keys? (integer for array, string for AA, etc...).
* TODO can we get roku to narrow this a bit?
*/
keyType?: VariableType;
/**
* Is this variable a container var (i.e. an array or object with children)
*/
isContainer: boolean;
/**
* Indicates whether the associated variable is virtual or not.
*/
isVirtual?: boolean;
/**
* If the variable is a container, it will have child elements. this is the number of those children. If `.children` is set, this field will be set to undefined
* (meaning it will be ignored during serialization)
*/
childCount?: number;
/**
* The full list of children for this variable. The entire Variable response may not be more than 2 total levels deep.
* (i.e. `parent` -> `children[]`). Children may not have additional children, those would need to be resolve using subsequent `variables` requests.
*/
children?: Variable[];
}