-
Notifications
You must be signed in to change notification settings - Fork 12k
/
_golden-api.d.ts
1143 lines (940 loc) · 36.3 KB
/
_golden-api.d.ts
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
export interface AdditionalPropertiesValidatorError extends SchemaValidatorErrorBase {
keyword: 'additionalProperties';
params: {
additionalProperty: string;
};
}
export declare function addUndefinedDefaults(value: JsonValue, _pointer: JsonPointer, schema?: JsonSchema): JsonValue;
export declare class AliasHost<StatsT extends object = {}> extends ResolverHost<StatsT> {
protected _aliases: Map<Path, Path>;
get aliases(): Map<Path, Path>;
protected _resolve(path: Path): Path;
}
export interface Analytics {
event(category: string, action: string, options?: EventOptions): void;
flush(): Promise<void>;
pageview(path: string, options?: PageviewOptions): void;
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
}
export declare type AnalyticsForwarderFn = (report: JsonObject & AnalyticsReport) => void;
export declare type AnalyticsReport = AnalyticsReportEvent | AnalyticsReportScreenview | AnalyticsReportPageview | AnalyticsReportTiming;
export interface AnalyticsReportBase extends JsonObject {
kind: AnalyticsReportKind;
}
export declare class AnalyticsReporter {
protected _analytics: Analytics;
constructor(_analytics: Analytics);
report(report: AnalyticsReport): void;
}
export interface AnalyticsReportEvent extends AnalyticsReportBase {
action: string;
category: string;
kind: AnalyticsReportKind.Event;
options: JsonObject & EventOptions;
}
export declare enum AnalyticsReportKind {
Event = "event",
Screenview = "screenview",
Pageview = "pageview",
Timing = "timing"
}
export interface AnalyticsReportPageview extends AnalyticsReportBase {
kind: AnalyticsReportKind.Pageview;
options: JsonObject & PageviewOptions;
path: string;
}
export interface AnalyticsReportScreenview extends AnalyticsReportBase {
appName: string;
kind: AnalyticsReportKind.Screenview;
options: JsonObject & ScreenviewOptions;
screenName: string;
}
export interface AnalyticsReportTiming extends AnalyticsReportBase {
category: string;
kind: AnalyticsReportKind.Timing;
options: JsonObject & TimingOptions;
time: string | number;
variable: string;
}
export declare function asPosixPath(path: Path): PosixPath;
export declare function asWindowsPath(path: Path): WindowsPath;
export declare class BaseException extends Error {
constructor(message?: string);
}
export declare function basename(path: Path): PathFragment;
export declare function buildJsonPointer(fragments: string[]): JsonPointer;
export declare function camelize(str: string): string;
export declare function capitalize(str: string): string;
export declare class CircularDependencyFoundException extends BaseException {
constructor();
}
export declare function classify(str: string): string;
export declare function clean<T>(array: Array<T | undefined>): Array<T>;
export declare class ContentHasMutatedException extends BaseException {
constructor(path: string);
}
export declare class CordHost extends SimpleMemoryHost {
protected _back: ReadonlyHost;
protected _filesToCreate: Set<Path>;
protected _filesToDelete: Set<Path>;
protected _filesToOverwrite: Set<Path>;
protected _filesToRename: Map<Path, Path>;
protected _filesToRenameRevert: Map<Path, Path>;
get backend(): ReadonlyHost;
get capabilities(): HostCapabilities;
constructor(_back: ReadonlyHost);
clone(): CordHost;
commit(host: Host, force?: boolean): Observable<void>;
create(path: Path, content: FileBuffer): Observable<void>;
delete(path: Path): Observable<void>;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
overwrite(path: Path, content: FileBuffer): Observable<void>;
read(path: Path): Observable<FileBuffer>;
records(): CordHostRecord[];
rename(from: Path, to: Path): Observable<void>;
stat(path: Path): Observable<Stats | null> | null;
watch(path: Path, options?: HostWatchOptions): null;
willCreate(path: Path): boolean;
willDelete(path: Path): boolean;
willOverwrite(path: Path): boolean;
willRename(path: Path): boolean;
willRenameTo(path: Path, to: Path): boolean;
write(path: Path, content: FileBuffer): Observable<void>;
}
export interface CordHostCreate {
content: FileBuffer;
kind: 'create';
path: Path;
}
export interface CordHostDelete {
kind: 'delete';
path: Path;
}
export interface CordHostOverwrite {
content: FileBuffer;
kind: 'overwrite';
path: Path;
}
export declare type CordHostRecord = CordHostCreate | CordHostOverwrite | CordHostRename | CordHostDelete;
export interface CordHostRename {
from: Path;
kind: 'rename';
to: Path;
}
export declare class CoreSchemaRegistry implements SchemaRegistry {
constructor(formats?: SchemaFormat[]);
protected _resolver(ref: string, validate?: ajv.ValidateFunction): {
context?: ajv.ValidateFunction;
schema?: JsonObject;
};
addFormat(format: SchemaFormat): void;
addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
compile(schema: JsonSchema): Observable<SchemaValidator>;
flatten(schema: JsonObject): Observable<JsonObject>;
registerUriHandler(handler: UriHandler): void;
usePromptProvider(provider: PromptProvider): void;
useXDeprecatedProvider(onUsage: (message: string) => void): void;
}
export declare function createSyncHost<StatsT extends object = {}>(handler: SyncHostHandler<StatsT>): Host<StatsT>;
export declare function createWorkspaceHost(host: virtualFs.Host): WorkspaceHost;
export interface CustomDimensionsAndMetricsOptions {
dimensions?: (boolean | number | string)[];
metrics?: (boolean | number | string)[];
}
export declare function dasherize(str: string): string;
export declare function decamelize(str: string): string;
export declare function deepCopy<T extends any>(value: T): T;
export declare type DefinitionCollectionListener<V extends object> = (name: string, action: 'add' | 'remove' | 'replace', newValue: V | undefined, oldValue: V | undefined, collection: DefinitionCollection<V>) => void;
export declare class DependencyNotFoundException extends BaseException {
constructor();
}
export declare function dirname(path: Path): Path;
export declare class Empty implements ReadonlyHost {
readonly capabilities: HostCapabilities;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
read(path: Path): Observable<FileBuffer>;
stat(path: Path): Observable<Stats<{}> | null>;
}
export interface EventOptions extends CustomDimensionsAndMetricsOptions {
label?: string;
value?: string;
}
export declare function extname(path: Path): string;
export declare class FileAlreadyExistException extends BaseException {
constructor(path: string);
}
export declare const fileBuffer: TemplateTag<FileBuffer>;
export declare type FileBuffer = ArrayBuffer;
export declare type FileBufferLike = ArrayBufferLike;
export declare function fileBufferToString(fileBuffer: FileBuffer): string;
export declare class FileDoesNotExistException extends BaseException {
constructor(path: string);
}
export interface FormatValidatorError extends SchemaValidatorErrorBase {
keyword: 'format';
params: {
format: string;
};
}
export declare class ForwardingAnalytics implements Analytics {
protected _fn: AnalyticsForwarderFn;
constructor(_fn: AnalyticsForwarderFn);
event(category: string, action: string, options?: EventOptions): void;
flush(): Promise<void>;
pageview(path: string, options?: PageviewOptions): void;
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
}
export declare function fragment(path: string): PathFragment;
export declare function getSystemPath(path: Path): string;
export declare function getTypesOfSchema(schema: JsonSchema): Set<string>;
export interface Host<StatsT extends object = {}> extends ReadonlyHost<StatsT> {
delete(path: Path): Observable<void>;
rename(from: Path, to: Path): Observable<void>;
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
write(path: Path, content: FileBufferLike): Observable<void>;
}
export interface HostCapabilities {
synchronous: boolean;
}
export interface HostWatchEvent {
readonly path: Path;
readonly time: Date;
readonly type: HostWatchEventType;
}
export declare const enum HostWatchEventType {
Changed = 0,
Created = 1,
Deleted = 2,
Renamed = 3
}
export interface HostWatchOptions {
readonly persistent?: boolean;
readonly recursive?: boolean;
}
export declare function indentBy(indentations: number): TemplateTag;
export declare class IndentLogger extends Logger {
constructor(name: string, parent?: Logger | null, indentation?: string);
}
export declare class InvalidJsonCharacterException extends JsonException {
character: number;
invalidChar: string;
line: number;
offset: number;
constructor(context: JsonParserContext);
}
export declare class InvalidPathException extends BaseException {
constructor(path: string);
}
export declare class InvalidUpdateRecordException extends BaseException {
constructor();
}
export declare function isAbsolute(p: Path): boolean;
export declare function isJsonArray(value: JsonValue): value is JsonArray;
export declare function isJsonObject(value: JsonValue): value is JsonObject;
export declare function isObservable(obj: any | Observable<any>): obj is Observable<any>;
export declare function isPromise(obj: any): obj is Promise<any>;
export declare function join(p1: Path, ...others: string[]): Path;
export declare function joinJsonPointer(root: JsonPointer, ...others: string[]): JsonPointer;
export interface JsonArray extends Array<JsonValue> {
}
export interface JsonAstArray extends JsonAstNodeBase {
readonly elements: JsonAstNode[];
readonly kind: 'array';
readonly value: JsonArray;
}
export interface JsonAstComment extends JsonAstNodeBase {
readonly content: string;
readonly kind: 'comment';
}
export interface JsonAstConstantFalse extends JsonAstNodeBase {
readonly kind: 'false';
readonly value: false;
}
export interface JsonAstConstantNull extends JsonAstNodeBase {
readonly kind: 'null';
readonly value: null;
}
export interface JsonAstConstantTrue extends JsonAstNodeBase {
readonly kind: 'true';
readonly value: true;
}
export interface JsonAstIdentifier extends JsonAstNodeBase {
readonly kind: 'identifier';
readonly value: string;
}
export interface JsonAstKeyValue extends JsonAstNodeBase {
readonly key: JsonAstString | JsonAstIdentifier;
readonly kind: 'keyvalue';
readonly value: JsonAstNode;
}
export interface JsonAstMultilineComment extends JsonAstNodeBase {
readonly content: string;
readonly kind: 'multicomment';
}
export declare type JsonAstNode = JsonAstNumber | JsonAstString | JsonAstIdentifier | JsonAstArray | JsonAstObject | JsonAstConstantFalse | JsonAstConstantNull | JsonAstConstantTrue;
export interface JsonAstNodeBase {
readonly comments?: (JsonAstComment | JsonAstMultilineComment)[];
readonly end: Position;
readonly start: Position;
readonly text: string;
}
export interface JsonAstNumber extends JsonAstNodeBase {
readonly kind: 'number';
readonly value: number;
}
export interface JsonAstObject extends JsonAstNodeBase {
readonly kind: 'object';
readonly properties: JsonAstKeyValue[];
readonly value: JsonObject;
}
export interface JsonAstString extends JsonAstNodeBase {
readonly kind: 'string';
readonly value: string;
}
export declare class JsonException extends BaseException {
}
export interface JsonObject {
[prop: string]: JsonValue;
}
export declare enum JsonParseMode {
Strict = 0,
CommentsAllowed = 1,
SingleQuotesAllowed = 2,
IdentifierKeyNamesAllowed = 4,
TrailingCommasAllowed = 8,
HexadecimalNumberAllowed = 16,
MultiLineStringAllowed = 32,
LaxNumberParsingAllowed = 64,
NumberConstantsAllowed = 128,
Default = 0,
Loose = 255,
Json = 0,
Json5 = 255
}
export interface JsonParserContext {
readonly mode: JsonParseMode;
readonly original: string;
position: Position;
previous: Position;
}
export declare type JsonPointer = string & {
__PRIVATE_DEVKIT_JSON_POINTER: void;
};
export interface JsonSchemaVisitor {
(current: JsonObject | JsonArray, pointer: JsonPointer, parentSchema?: JsonObject | JsonArray, index?: string): void;
}
export declare type JsonValue = JsonAstNode['value'];
export interface JsonVisitor {
(value: JsonValue, pointer: JsonPointer, schema?: JsonObject, root?: JsonObject | JsonArray): Observable<JsonValue> | JsonValue;
}
export declare class LevelCapLogger extends LevelTransformLogger {
readonly levelCap: LogLevel;
readonly name: string;
readonly parent: Logger | null;
constructor(name: string, parent: Logger | null, levelCap: LogLevel);
static levelMap: {
[cap: string]: {
[level: string]: string;
};
};
}
export declare class LevelTransformLogger extends Logger {
readonly levelTransform: (level: LogLevel) => LogLevel;
readonly name: string;
readonly parent: Logger | null;
constructor(name: string, parent: Logger | null, levelTransform: (level: LogLevel) => LogLevel);
createChild(name: string): Logger;
log(level: LogLevel, message: string, metadata?: JsonObject): void;
}
export declare function levenshtein(a: string, b: string): number;
export interface LimitValidatorError extends SchemaValidatorErrorBase {
keyword: 'maxItems' | 'minItems' | 'maxLength' | 'minLength' | 'maxProperties' | 'minProperties';
params: {
limit: number;
};
}
export interface LogEntry extends LoggerMetadata {
level: LogLevel;
message: string;
timestamp: number;
}
export declare class Logger extends Observable<LogEntry> implements LoggerApi {
protected _metadata: LoggerMetadata;
protected get _observable(): Observable<LogEntry>;
protected set _observable(v: Observable<LogEntry>);
protected readonly _subject: Subject<LogEntry>;
readonly name: string;
readonly parent: Logger | null;
constructor(name: string, parent?: Logger | null);
asApi(): LoggerApi;
complete(): void;
createChild(name: string): Logger;
debug(message: string, metadata?: JsonObject): void;
error(message: string, metadata?: JsonObject): void;
fatal(message: string, metadata?: JsonObject): void;
forEach(next: (value: LogEntry) => void, PromiseCtor?: typeof Promise): Promise<void>;
info(message: string, metadata?: JsonObject): void;
lift<R>(operator: Operator<LogEntry, R>): Observable<R>;
log(level: LogLevel, message: string, metadata?: JsonObject): void;
next(entry: LogEntry): void;
subscribe(): Subscription;
subscribe(observer: PartialObserver<LogEntry>): Subscription;
subscribe(next?: (value: LogEntry) => void, error?: (error: Error) => void, complete?: () => void): Subscription;
toString(): string;
warn(message: string, metadata?: JsonObject): void;
}
export interface LoggerApi {
createChild(name: string): Logger;
debug(message: string, metadata?: JsonObject): void;
error(message: string, metadata?: JsonObject): void;
fatal(message: string, metadata?: JsonObject): void;
info(message: string, metadata?: JsonObject): void;
log(level: LogLevel, message: string, metadata?: JsonObject): void;
warn(message: string, metadata?: JsonObject): void;
}
export interface LoggerMetadata extends JsonObject {
name: string;
path: string[];
}
export declare class LoggingAnalytics implements Analytics {
protected _logger: Logger;
constructor(_logger: Logger);
event(category: string, action: string, options?: EventOptions): void;
flush(): Promise<void>;
pageview(path: string, options?: PageviewOptions): void;
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
}
export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
export declare function mapObject<T, V>(obj: {
[k: string]: T;
}, mapper: (k: string, v: T) => V): {
[k: string]: V;
};
export declare class MergeConflictException extends BaseException {
constructor(path: string);
}
export declare class MultiAnalytics implements Analytics {
protected _backends: Analytics[];
constructor(_backends?: Analytics[]);
event(category: string, action: string, options?: EventOptions): void;
flush(): Promise<void>;
pageview(path: string, options?: PageviewOptions): void;
push(...backend: Analytics[]): void;
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
}
export declare enum NgCliAnalyticsDimensions {
CpuCount = 1,
CpuSpeed = 2,
RamInGigabytes = 3,
NodeVersion = 4,
NgAddCollection = 6,
NgBuildBuildEventLog = 7,
NgIvyEnabled = 8,
BuildErrors = 20
}
export declare const NgCliAnalyticsDimensionsFlagInfo: {
[name: string]: [string, string];
};
export declare enum NgCliAnalyticsMetrics {
NgComponentCount = 1,
UNUSED_2 = 2,
UNUSED_3 = 3,
UNUSED_4 = 4,
BuildTime = 5,
NgOnInitCount = 6,
InitialChunkSize = 7,
TotalChunkCount = 8,
TotalChunkSize = 9,
LazyChunkCount = 10,
LazyChunkSize = 11,
AssetCount = 12,
AssetSize = 13,
PolyfillSize = 14,
CssSize = 15
}
export declare const NgCliAnalyticsMetricsFlagInfo: {
[name: string]: [string, string];
};
export declare function noCacheNormalize(path: string): Path;
export declare class NoopAnalytics implements Analytics {
event(): void;
flush(): Promise<void>;
pageview(): void;
screenview(): void;
timing(): void;
}
export declare function normalize(path: string): Path;
export declare const NormalizedRoot: Path;
export declare const NormalizedSep: Path;
export declare class NullLogger extends Logger {
constructor(parent?: Logger | null);
asApi(): LoggerApi;
}
export declare function oneLine(strings: TemplateStringsArray, ...values: any[]): string;
export interface PageviewOptions extends CustomDimensionsAndMetricsOptions {
hostname?: string;
title?: string;
}
export declare function parseJson(input: string, mode?: JsonParseMode, options?: ParseJsonOptions): JsonValue;
export declare function parseJsonAst(input: string, mode?: JsonParseMode): JsonAstNode;
export interface ParseJsonOptions {
path?: string;
}
export declare function parseJsonPointer(pointer: JsonPointer): string[];
export declare class PartiallyOrderedSet<T> implements Set<T> {
get [Symbol.toStringTag](): 'Set';
get size(): number;
[Symbol.iterator](): Generator<T, void, unknown>;
protected _checkCircularDependencies(item: T, deps: Set<T>): void;
add(item: T, deps?: (Set<T> | T[])): this;
clear(): void;
delete(item: T): boolean;
entries(): IterableIterator<[T, T]>;
forEach(callbackfn: (value: T, value2: T, set: PartiallyOrderedSet<T>) => void, thisArg?: any): void;
has(item: T): boolean;
keys(): IterableIterator<T>;
values(): IterableIterator<T>;
}
export declare const path: TemplateTag<Path>;
export declare type Path = string & {
__PRIVATE_DEVKIT_PATH: void;
};
export declare class PathCannotBeFragmentException extends BaseException {
constructor(path: string);
}
export declare type PathFragment = Path & {
__PRIVATE_DEVKIT_PATH_FRAGMENT: void;
};
export declare class PathIsDirectoryException extends BaseException {
constructor(path: string);
}
export declare class PathIsFileException extends BaseException {
constructor(path: string);
}
export declare class PathMustBeAbsoluteException extends BaseException {
constructor(path: string);
}
export declare class PathSpecificJsonException extends JsonException {
exception: JsonException;
path: string;
constructor(path: string, exception: JsonException);
}
export declare class PatternMatchingHost<StatsT extends object = {}> extends ResolverHost<StatsT> {
protected _patterns: Map<RegExp, ReplacementFunction>;
protected _resolve(path: Path): Path;
addPattern(pattern: string | string[], replacementFn: ReplacementFunction): void;
}
export interface Position {
readonly character: number;
readonly line: number;
readonly offset: number;
}
export declare type PosixPath = string & {
__PRIVATE_DEVKIT_POSIX_PATH: void;
};
export declare class PriorityQueue<T> {
get size(): number;
constructor(_comparator: (x: T, y: T) => number);
clear(): void;
peek(): T | undefined;
pop(): T | undefined;
push(item: T): void;
toArray(): Array<T>;
}
export interface ProjectDefinition {
readonly extensions: Record<string, JsonValue | undefined>;
prefix?: string;
root: string;
sourceRoot?: string;
readonly targets: TargetDefinitionCollection;
}
export declare class ProjectDefinitionCollection extends DefinitionCollection<ProjectDefinition> {
constructor(initial?: Record<string, ProjectDefinition>, listener?: DefinitionCollectionListener<ProjectDefinition>);
add(definition: {
name: string;
root: string;
sourceRoot?: string;
prefix?: string;
targets?: Record<string, TargetDefinition | undefined>;
[key: string]: unknown;
}): ProjectDefinition;
set(name: string, value: ProjectDefinition): this;
}
export interface PromptDefinition {
default?: string | string[] | number | boolean | null;
id: string;
items?: Array<string | {
value: JsonValue;
label: string;
}>;
message: string;
multiselect?: boolean;
raw?: string | JsonObject;
type: string;
validator?: (value: JsonValue) => boolean | string | Promise<boolean | string>;
}
export declare type PromptProvider = (definitions: Array<PromptDefinition>) => SubscribableOrPromise<{
[id: string]: JsonValue;
}>;
export interface ReadonlyHost<StatsT extends object = {}> {
readonly capabilities: HostCapabilities;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
read(path: Path): Observable<FileBuffer>;
stat(path: Path): Observable<Stats<StatsT> | null> | null;
}
export declare function readWorkspace(path: string, host: WorkspaceHost, format?: WorkspaceFormat): Promise<{
workspace: WorkspaceDefinition;
}>;
export interface ReferenceResolver<ContextT> {
(ref: string, context?: ContextT): {
context?: ContextT;
schema?: JsonObject;
};
}
export interface RefValidatorError extends SchemaValidatorErrorBase {
keyword: '$ref';
params: {
ref: string;
};
}
export declare function relative(from: Path, to: Path): Path;
export declare type ReplacementFunction = (path: Path) => Path;
export interface RequiredValidatorError extends SchemaValidatorErrorBase {
keyword: 'required';
params: {
missingProperty: string;
};
}
export declare function resetNormalizeCache(): void;
export declare function resolve(p1: Path, p2: Path): Path;
export declare abstract class ResolverHost<T extends object> implements Host<T> {
protected _delegate: Host<T>;
get capabilities(): HostCapabilities;
constructor(_delegate: Host<T>);
protected abstract _resolve(path: Path): Path;
delete(path: Path): Observable<void>;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
read(path: Path): Observable<FileBuffer>;
rename(from: Path, to: Path): Observable<void>;
stat(path: Path): Observable<Stats<T> | null> | null;
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
write(path: Path, content: FileBuffer): Observable<void>;
}
export declare class SafeReadonlyHost<StatsT extends object = {}> implements ReadonlyHost<StatsT> {
get capabilities(): HostCapabilities;
constructor(_delegate: ReadonlyHost<StatsT>);
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
read(path: Path): Observable<FileBuffer>;
stat(path: Path): Observable<Stats<StatsT> | null> | null;
}
export interface SchemaFormat {
formatter: SchemaFormatter;
name: string;
}
export interface SchemaFormatter {
readonly async: boolean;
validate(data: any): boolean | Observable<boolean>;
}
export interface SchemaKeywordValidator {
(data: JsonValue, schema: JsonValue, parent: JsonObject | JsonArray | undefined, parentProperty: string | number | undefined, pointer: JsonPointer, rootData: JsonValue): boolean | Observable<boolean>;
}
export interface SchemaRegistry {
addFormat(format: SchemaFormat): void;
addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
compile(schema: Object): Observable<SchemaValidator>;
flatten(schema: JsonObject | string): Observable<JsonObject>;
usePromptProvider(provider: PromptProvider): void;
useXDeprecatedProvider(onUsage: (message: string) => void): void;
}
export declare class SchemaValidationException extends BaseException {
readonly errors: SchemaValidatorError[];
constructor(errors?: SchemaValidatorError[], baseMessage?: string);
static createMessages(errors?: SchemaValidatorError[]): string[];
}
export interface SchemaValidator {
(data: JsonValue, options?: SchemaValidatorOptions): Observable<SchemaValidatorResult>;
}
export declare type SchemaValidatorError = RefValidatorError | LimitValidatorError | AdditionalPropertiesValidatorError | FormatValidatorError | RequiredValidatorError;
export interface SchemaValidatorErrorBase {
data?: JsonValue;
dataPath: string;
keyword: string;
message?: string;
}
export interface SchemaValidatorOptions {
applyPostTransforms?: boolean;
applyPreTransforms?: boolean;
withPrompts?: boolean;
}
export interface SchemaValidatorResult {
data: JsonValue;
errors?: SchemaValidatorError[];
success: boolean;
}
export declare class ScopedHost<T extends object> extends ResolverHost<T> {
protected _root: Path;
constructor(delegate: Host<T>, _root?: Path);
protected _resolve(path: Path): Path;
}
export interface ScreenviewOptions extends CustomDimensionsAndMetricsOptions {
appId?: string;
appInstallerId?: string;
appVersion?: string;
}
export declare class SimpleMemoryHost implements Host<{}> {
protected _cache: Map<Path, Stats<SimpleMemoryHostStats>>;
get capabilities(): HostCapabilities;
constructor();
protected _delete(path: Path): void;
protected _exists(path: Path): boolean;
protected _isDirectory(path: Path): boolean;
protected _isFile(path: Path): boolean;
protected _list(path: Path): PathFragment[];
protected _newDirStats(): {
inspect(): string;
isFile(): boolean;
isDirectory(): boolean;
size: number;
atime: Date;
ctime: Date;
mtime: Date;
birthtime: Date;
content: null;
};
protected _newFileStats(content: FileBuffer, oldStats?: Stats<SimpleMemoryHostStats>): {
inspect(): string;
isFile(): boolean;
isDirectory(): boolean;
size: number;
atime: Date;
ctime: Date;
mtime: Date;
birthtime: Date;
content: ArrayBuffer;
};
protected _read(path: Path): FileBuffer;
protected _rename(from: Path, to: Path): void;
protected _stat(path: Path): Stats<SimpleMemoryHostStats> | null;
protected _toAbsolute(path: Path): Path;
protected _updateWatchers(path: Path, type: HostWatchEventType): void;
protected _watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent>;
protected _write(path: Path, content: FileBuffer): void;
delete(path: Path): Observable<void>;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
list(path: Path): Observable<PathFragment[]>;
read(path: Path): Observable<FileBuffer>;
rename(from: Path, to: Path): Observable<void>;
reset(): void;
stat(path: Path): Observable<Stats<{}> | null> | null;
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
write(path: Path, content: FileBuffer): Observable<void>;
}
export interface SimpleMemoryHostStats {
readonly content: FileBuffer | null;
}
export interface SmartDefaultProvider<T> {
(schema: JsonObject): T | Observable<T>;
}
export declare function split(path: Path): PathFragment[];
export declare type Stats<T extends object = {}> = T & {
isFile(): boolean;
isDirectory(): boolean;
readonly size: number;
readonly atime: Date;
readonly mtime: Date;
readonly ctime: Date;
readonly birthtime: Date;
};
export declare function stringToFileBuffer(str: string): FileBuffer;
export declare function stripIndent(strings: TemplateStringsArray, ...values: any[]): string;
export declare function stripIndents(strings: TemplateStringsArray, ...values: any[]): string;
export declare class SyncDelegateHost<T extends object = {}> {
protected _delegate: Host<T>;
get capabilities(): HostCapabilities;
get delegate(): Host<T>;
constructor(_delegate: Host<T>);
protected _doSyncCall<ResultT>(observable: Observable<ResultT>): ResultT;
delete(path: Path): void;
exists(path: Path): boolean;
isDirectory(path: Path): boolean;
isFile(path: Path): boolean;
list(path: Path): PathFragment[];
read(path: Path): FileBuffer;
rename(from: Path, to: Path): void;
stat(path: Path): Stats<T> | null;
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
write(path: Path, content: FileBufferLike): void;
}
export interface SyncHostHandler<StatsT extends object = {}> {
delete(path: Path): void;
exists(path: Path): boolean;
isDirectory(path: Path): boolean;
isFile(path: Path): boolean;
list(path: Path): PathFragment[];
read(path: Path): FileBuffer;
rename(from: Path, to: Path): void;
stat(path: Path): Stats<StatsT> | null;
write(path: Path, content: FileBufferLike): void;
}
export declare class SynchronousDelegateExpectedException extends BaseException {
constructor();
}
export interface TargetDefinition {
builder: string;
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
options?: Record<string, JsonValue | undefined>;
}
export declare class TargetDefinitionCollection extends DefinitionCollection<TargetDefinition> {
constructor(initial?: Record<string, TargetDefinition>, listener?: DefinitionCollectionListener<TargetDefinition>);
add(definition: {
name: string;
} & TargetDefinition): TargetDefinition;
set(name: string, value: TargetDefinition): this;
}
export declare function template<T>(content: string, options?: TemplateOptions): (input: T) => string;
export interface TemplateAst {
children: TemplateAstNode[];
content: string;
fileName: string;
}