source: trip-planner-front/node_modules/magic-string/index.d.ts@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.2 KB
Line 
1export interface BundleOptions {
2 intro?: string;
3 separator?: string;
4}
5
6export interface SourceMapOptions {
7 hires: boolean;
8 file: string;
9 source: string;
10 includeContent: boolean;
11}
12
13export type SourceMapSegment =
14 | [number]
15 | [number, number, number, number]
16 | [number, number, number, number, number];
17
18export interface DecodedSourceMap {
19 file: string;
20 sources: string[];
21 sourcesContent: string[];
22 names: string[];
23 mappings: SourceMapSegment[][];
24}
25
26export class SourceMap {
27 constructor(properties: DecodedSourceMap);
28
29 version: number;
30 file: string;
31 sources: string[];
32 sourcesContent: string[];
33 names: string[];
34 mappings: string;
35
36 toString(): string;
37 toUrl(): string;
38}
39
40export class Bundle {
41 constructor(options?: BundleOptions);
42 addSource(source: MagicString | { filename?: string, content: MagicString }): Bundle;
43 append(str: string, options?: BundleOptions): Bundle;
44 clone(): Bundle;
45 generateMap(options?: Partial<SourceMapOptions>): SourceMap;
46 generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
47 getIndentString(): string;
48 indent(indentStr?: string): Bundle;
49 indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
50 prepend(str: string): Bundle;
51 toString(): string;
52 trimLines(): Bundle;
53 trim(charType?: string): Bundle;
54 trimStart(charType?: string): Bundle;
55 trimEnd(charType?: string): Bundle;
56 isEmpty(): boolean;
57 length(): number;
58}
59
60export type ExclusionRange = [ number, number ];
61
62export interface MagicStringOptions {
63 filename: string,
64 indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
65}
66
67export interface IndentOptions {
68 exclude: ExclusionRange | Array<ExclusionRange>;
69 indentStart: boolean;
70}
71
72export interface OverwriteOptions {
73 storeName?: boolean;
74 contentOnly?: boolean;
75}
76
77export default class MagicString {
78 constructor(str: string, options?: MagicStringOptions);
79 addSourcemapLocation(char: number): void;
80 append(content: string): MagicString;
81 appendLeft(index: number, content: string): MagicString;
82 appendRight(index: number, content: string): MagicString;
83 clone(): MagicString;
84 generateMap(options?: Partial<SourceMapOptions>): SourceMap;
85 generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
86 getIndentString(): string;
87
88 indent(options?: IndentOptions): MagicString;
89 indent(indentStr?: string, options?: IndentOptions): MagicString;
90 indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
91
92 move(start: number, end: number, index: number): MagicString;
93 overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;
94 prepend(content: string): MagicString;
95 prependLeft(index: number, content: string): MagicString;
96 prependRight(index: number, content: string): MagicString;
97 remove(start: number, end: number): MagicString;
98 slice(start: number, end: number): string;
99 snip(start: number, end: number): MagicString;
100 trim(charType?: string): MagicString;
101 trimStart(charType?: string): MagicString;
102 trimEnd(charType?: string): MagicString;
103 trimLines(): MagicString;
104
105 lastChar(): string;
106 lastLine(): string;
107 isEmpty(): boolean;
108 length(): number;
109
110 original: string;
111}
Note: See TracBrowser for help on using the repository browser.