import { BLANK_CONVERTER } from '../utility/blank-converter';
import { AbstractEditableDataStream, } from '../utility/editable-data-stream';
import { VariableView } from './byte-index-variable-view';
export class AbstractVariable extends AbstractEditableDataStream {
    /**
     * Create a subvariable instance from the given variable index
     * @param key the uniq variable identifier to use for data manager
     * @param rawIndexes list of array index (starting from 0) to extract. Each index represents 1 byte of data
     *
     * @deprecated manually create your instance
     */
    variableView(key, rawIndexes, options) {
        return new VariableView(key, {
            converter: (options === null || options === void 0 ? void 0 : options.converter) || BLANK_CONVERTER,
            indexes: rawIndexes,
            variable: this,
            useLastKnownValueBeforeWrite: options === null || options === void 0 ? void 0 : options.useLastKnownValueBeforeWrite,
        });
    }
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QtdmFyaWFibGUtc3RyZWFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vZGF0YS9zcmMvbGliL3RhcmdldC12YXJpYWJsZS9hYnN0cmFjdC12YXJpYWJsZS1zdHJlYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQzdELE9BQU8sRUFDTCwwQkFBMEIsR0FFM0IsTUFBTSxpQ0FBaUMsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFFMUQsTUFBTSxPQUFnQixnQkFHcEIsU0FBUSwwQkFBeUQ7SUFDakU7Ozs7OztPQU1HO0lBQ0gsWUFBWSxDQUNWLEdBQU0sRUFDTixVQUFvQixFQUNwQixPQUdDO1FBRUQsT0FBTyxJQUFJLFlBQVksQ0FBTyxHQUFHLEVBQUU7WUFDakMsU0FBUyxFQUFFLENBQUEsT0FBTyxhQUFQLE9BQU8sdUJBQVAsT0FBTyxDQUFFLFNBQVMsS0FBSSxlQUFlO1lBQ2hELE9BQU8sRUFBRSxVQUFVO1lBQ25CLFFBQVEsRUFBRSxJQUFJO1lBQ2QsNEJBQTRCLEVBQUUsT0FBTyxhQUFQLE9BQU8sdUJBQVAsT0FBTyxDQUFFLDRCQUE0QjtTQUNwRSxDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0YifQ==