@atomist/rug
Version:
TypeScript model for Atomist Rugs, see http://docs.atomist.com/
72 lines (62 loc) • 1.72 kB
text/typescript
/*
* Copyright 2015-2017 Atomist Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TreeNode, GraphNode, FormatInfo, PathExpressionEngine } from "@atomist/rug/tree/PathExpression";
import { ProjectContext } from "@atomist/rug/operations/ProjectEditor";
import { ViewSupport } from "./ViewSupport";
import { MutableView } from "./MutableView";
import { File } from "./File";
export { Line };
/**
* Represents a line within a text file
*/
interface Line extends ViewSupport, MutableView {
/**
* DEPRECATED - Return this line's content
*
* @returns {string}
*/
content(): string;
/**
* Containing file
*
* @property {File} file
*/
readonly file: File;
/**
* Line length
*
* @property {number} length
*/
readonly length: number;
/**
* Line number from 0
*
* @property {number} num
*/
readonly num: number;
/**
* Line number from 1
*
* @property {number} numFrom1
*/
readonly numFrom1: number;
/**
* Update this line's content
*
* @param s2 {string} The content to update this line to
*/
update(s2: string): void;
}