import type { char, From, Integer, Option, PositiveInteger, Result } from '@chzky/core'; import type { SearchPattern, StringAble, Vector } from '../../../mod.js'; import type { InterStr, StrConstant } from './interface.js'; import { DENO_CUSTOM_INSPECT, IndexOutOfBoundsError, SerializeError } from '@chzky/core'; import { Char } from '../../../mod.js'; /** ## `Str` : UTF-8 编码的、可增长的字符串。 + `Str`的目的主要是扩展`string`的能力,使用一个包装类来实现`string`的扩展,而不是直接修改`string`的原型 */ export interface Str extends InterStr { } export declare class InternalStr implements Str { #private; constructor(val: unknown); update(str: StringAble): void; as_string(): string; as_bytes(): Uint8Array; to_chars(): Array; to_vector(): Vector; chars(): Array; json_parse(): Result; capacity(): number; clear(): void; is_empty(): boolean; len(): number; find(substring: StringAble): Option; rfind(substring: StringAble): Option; extend_from_within(src: Array | Generator | Vector): Result; replace_range

(replace: StringAble, start: Integer

, end?: Integer): Result; insert

(index: Integer

, str: StringAble): Result; remove

(index: Integer

): Result; push(str: StringAble): void; unshift(str: StringAble): void; pop(): Option; shift(): Option; remove_matches(pattern: RegExp | StringAble): void; retain(cb: (c: char) => boolean): void; truncate

(min: Integer

): void; start_with(str: StringAble): boolean; end_with(str: StringAble): boolean; contains(str: StringAble): boolean; includes(str: StringAble): boolean; is_ascii(): boolean; make_ascii_lowercase(): void; make_ascii_uppercase(): void; lines(): Vector; split_off

(at: Integer

): Result; drain(range: Array | Generator | Vector): Result, IndexOutOfBoundsError>; get(range: Array | Generator | Vector): Option; at(index: number): Option; strip_prefix(str: StringAble): Option; strip_suffix(str: StringAble): Option; matches(pattern: RegExp | string | ((c: char) => boolean)): Vector; repeat

(n: PositiveInteger

): Str; replace(str: SearchPattern, replace: StringAble): Str; replacen(str: string | Str | RegExp, replace: StringAble, count: number): Str; split(pattern: SearchPattern): Vector; split_at

(at: Integer

): Result<[Str, Str], IndexOutOfBoundsError>; split_inclusive(pattern: StringAble): Vector; split_terminator(pattern: SearchPattern): Vector; split_once(pattern: SearchPattern): Option<[Str, Str]>; split_ascii_whitespace(): Vector; split_whitespace(): Vector; to_lowercase(): Str; to_uppercase(): Str; trim(): Str; trim_left(): Str; trim_right(): Str; trim_start(): Str; trim_end(): Str; [Symbol.iterator](): Iterator; into(value: From): R; toString(): string; valueOf(): string; [DENO_CUSTOM_INSPECT](): string; log(): void; eq(other: this): boolean; equals(val: unknown): boolean; clone(): Str; } /** ## `is_str` : 判断`Str`类型 */ export declare function is_str(value: unknown): value is Str; export declare const Str: StrConstant; //# sourceMappingURL=class.d.ts.map