aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.d.ts
blob: 7a7ec1bf50fa1ba8aeed1a3c123e5dccb64c5e7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/// <reference types="node" />
import { BaseException } from '@angular-devkit/core';
import MagicString from 'magic-string';
import { LinkedList } from './linked-list';
export declare class IndexOutOfBoundException extends BaseException {
    constructor(index: number, min: number, max?: number);
}
/** @deprecated Since v13.0 */
export declare class ContentCannotBeRemovedException extends BaseException {
    constructor();
}
/**
 * A Chunk description, including left/right content that has been inserted.
 * If _left/_right is null, this means that content was deleted. If the _content is null,
 * it means the content itself was deleted.
 *
 * @see UpdateBuffer
 * @deprecated Since v13.0
 */
export declare class Chunk {
    start: number;
    end: number;
    originalContent: Buffer;
    private _content;
    private _left;
    private _right;
    private _assertLeft;
    private _assertRight;
    next: Chunk | null;
    constructor(start: number, end: number, originalContent: Buffer);
    get length(): number;
    toString(encoding?: BufferEncoding): string;
    slice(start: number): Chunk;
    append(buffer: Buffer, essential: boolean): void;
    prepend(buffer: Buffer, essential: boolean): void;
    assert(left: boolean, _content: boolean, right: boolean): void;
    remove(left: boolean, content: boolean, right: boolean): void;
    copy(target: Buffer, start: number): number;
}
/**
 * Base class for an update buffer implementation that allows buffers to be inserted to the _right
 * or _left, or deleted, while keeping indices to the original buffer.
 */
export declare abstract class UpdateBufferBase {
    protected _originalContent: Buffer;
    constructor(_originalContent: Buffer);
    abstract get length(): number;
    abstract get original(): Buffer;
    abstract toString(encoding?: string): string;
    abstract generate(): Buffer;
    abstract insertLeft(index: number, content: Buffer, assert?: boolean): void;
    abstract insertRight(index: number, content: Buffer, assert?: boolean): void;
    abstract remove(index: number, length: number): void;
    /**
     * Creates an UpdateBufferBase instance. Depending on the NG_UPDATE_BUFFER_V2
     * environment variable, will either create an UpdateBuffer or an UpdateBuffer2
     * instance.
     *
     * See: https://github.com/angular/angular-cli/issues/21110
     *
     * @param originalContent The original content of the update buffer instance.
     * @returns An UpdateBufferBase instance.
     */
    static create(originalContent: Buffer): UpdateBufferBase;
}
/**
 * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while
 * keeping indices to the original buffer.
 *
 * The constructor takes an original buffer, and keeps it into a linked list of chunks, smaller
 * buffers that keep track of _content inserted to the _right or _left of it.
 *
 * Since the Node Buffer structure is non-destructive when slicing, we try to use slicing to create
 * new chunks, and always keep chunks pointing to the original content.
 *
 * @deprecated Since v13.0
 */
export declare class UpdateBuffer extends UpdateBufferBase {
    protected _linkedList: LinkedList<Chunk>;
    constructor(originalContent: Buffer);
    protected _assertIndex(index: number): void;
    protected _slice(start: number): [Chunk, Chunk];
    /**
     * Gets the position in the content based on the position in the string.
     * Some characters might be wider than one byte, thus we have to determine the position using
     * string functions.
     */
    protected _getTextPosition(index: number): number;
    get length(): number;
    get original(): Buffer;
    toString(encoding?: BufferEncoding): string;
    generate(): Buffer;
    insertLeft(index: number, content: Buffer, assert?: boolean): void;
    insertRight(index: number, content: Buffer, assert?: boolean): void;
    remove(index: number, length: number): void;
}
/**
 * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while
 * keeping indices to the original buffer.
 */
export declare class UpdateBuffer2 extends UpdateBufferBase {
    protected _mutatableContent: MagicString;
    protected _assertIndex(index: number): void;
    get length(): number;
    get original(): Buffer;
    toString(): string;
    generate(): Buffer;
    insertLeft(index: number, content: Buffer): void;
    insertRight(index: number, content: Buffer): void;
    remove(index: number, length: number): void;
}