/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/StringPosition.ts * @create: 2018-09-01 10:52:52.750 * @modify: 2025-06-26 10:30:24.607 * @version: 6.0.0 * @times: 13 * @lines: 112 * @copyright: Copyright © 2018-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ /** * Represents a position or range within a string, defined by a start index and an optional end index. * * Provides utility methods and properties to work with string positions, such as calculating length, * comparing positions, and associating the position with a specific string. * * @remarks * - The `Start` property defines the starting index of the position. * - The `End` property (optional) defines the exclusive end index of the position. * - The `Length` property computes the length of the range as `End - Start`. * - The `RelatedString` property can be used to associate this position with a specific string. * * @example * ```typescript * const pos = new StringPosition(5, 10); * console.log(pos.Length); // 5 * ``` * * @public * * @since 4.0.0 * @version 2022-06-26 */ export declare class StringPosition { constructor(start: number); constructor(start: number, end: number); static Create(start: number, length: number): StringPosition; RelatedString: string | undefined; Start: number; End: number | undefined; get Length(): number; set Length(len: number); toString(): string; Equals(another: StringPosition, checkRelatedString?: boolean): boolean; } //# sourceMappingURL=StringPosition.d.ts.map