function parse(args) {
            var direction;
            switch (args.to) {
                case EditorScroll_.RawDirection.Up:
                    direction = 1 /* Up */;
                    break;
                case EditorScroll_.RawDirection.Down:
                    direction = 2 /* Down */;
                    break;
                default:
                    // Illegal arguments
                    return null;
            }
            var unit;
            switch (args.by) {
                case EditorScroll_.RawUnit.Line:
                    unit = 1 /* Line */;
                    break;
                case EditorScroll_.RawUnit.WrappedLine:
                    unit = 2 /* WrappedLine */;
                    break;
                case EditorScroll_.RawUnit.Page:
                    unit = 3 /* Page */;
                    break;
                case EditorScroll_.RawUnit.HalfPage:
                    unit = 4 /* HalfPage */;
                    break;
                default:
                    unit = 2 /* WrappedLine */;
            }
            var value = Math.floor(args.value || 1);
            var revealCursor = !!args.revealCursor;
            return {
                direction: direction,
                unit: unit,
                value: value,
                revealCursor: revealCursor,
                select: (!!args.select)
            };
        }
Units for editor scroll 'by' argument