Repository navigation
Expand file tree
/
Copy pathdeclarations.d.ts
More file actions
1192 lines (1062 loc) · 30.1 KB
/
Copy pathdeclarations.d.ts
File metadata and controls
1192 lines (1062 loc) · 30.1 KB
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
import { IOptions } from "../declarations";
import { IJsonFileSettingsService } from "./definitions/json-file-settings-service";
import {
IEventActionData,
IGoogleAnalyticsData,
} from "./definitions/google-analytics";
import type { DoctorService } from "../contracts/doctor-service";
import type { ChildProcess } from "../contracts/child-process";
import type { Errors } from "../contracts/errors";
import type { FileSystem } from "../contracts/file-system";
import type { HostInfo } from "../contracts/host-info";
import type { HttpClient } from "../contracts/http-client";
import type { OsInfo } from "../contracts/internal/os-info";
// tslint:disable-next-line:interface-name
interface Object {
[key: string]: any;
}
interface IStringDictionary extends IDictionary<string> {}
/**
* Describes iTunes Connect application types
*/
// tslint:disable-next-line:interface-name
interface IiTunesConnectApplicationType {
/**
* Applications developed for iOS
* @type {string}
*/
iOS: string;
/**
* Applications developed for Mac OS
* @type {string}
*/
Mac: string;
}
/**
* Describes the types of data that can be send to Google Analytics.
* Their values are the names of the methods in universnal-analytics that have to be called to track this type of data.
* Also known as Hit Type: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#t
*/
/**
* Descibes iTunes Connect applications
*/
// tslint:disable-next-line:interface-name
interface IiTunesConnectApplication {
/**
* Unique Apple ID for each application. Automatically generated and assigned by Apple.
* @type {string}
*/
adamId: string;
/**
* No information available.
* @type {number}
*/
addOnCount: number;
/**
* The application's bundle identifier.
* @type {string}
*/
bundleId: string;
/**
* Application's name
* @type {string}
*/
name: string;
/**
* Application's stock keeping unit. User-defined unique string to keep track of the applications
* @type {string}
*/
sku: string;
/**
* Application's type
* @type {string}
*/
type: string;
/**
* Application's current version
* @type {string}
*/
version: string;
}
/**
* Describes configuration settings that modify the behavior of some methods.
*/
interface IConfigurationSettings {
/**
* This string will be used when constructing the UserAgent http header.
* @type {string}
*/
userAgentName?: string;
/**
* Describes the profile directory that will be used for various CLI settings, like user-settings.json file location, extensions, etc.
* @type {string}
*/
profileDir?: string;
}
/**
* Describes service used to confugure various settings.
*/
interface ISettingsService {
/**
* Used to set various settings in order to modify the behavior of some methods.
* @param {IConfigurationSettings} settings Settings which will modify the behaviour of some methods.
* @returns {void}
*/
setSettings(settings: IConfigurationSettings): void;
/**
* Returns currently used profile directory.
* @returns {string}
*/
getProfileDir(): string;
}
/**
* Describes data returned from querying itunes' Content Delivery api
*/
interface IContentDeliveryBody {
/**
* Error object - likely present if result's Success is false.
*/
error?: Error;
/**
* Query results.
*/
result: {
/**
* A list of the user's applications.
* @type {IiTunesConnectApplication[]}
*/
Applications: IiTunesConnectApplication[];
/**
* Error code - likely present if Success is false.
* @type {number}
*/
ErrorCode?: number;
/**
* Error message - likely present if Success is false.
* @type {string}
*/
ErrorMessage?: string;
/**
* Error message - likely present if Success is false.
* @type {string[]}
*/
Errors?: string[];
/**
* Indication whether the query was a success or not.
* @type {boolean}
*/
Success: boolean;
};
}
declare module Server {
interface IResponse {
response: any;
body?: any;
headers: any;
error?: Error;
}
/** @deprecated Kept so existing annotations compile; use the {@link HttpClient} contract. */
interface IHttpClient extends HttpClient {}
interface IRequestResponseData {
statusCode: number;
headers: { [index: string]: any };
complete: boolean;
pipe(destination: any, options?: { end?: boolean }): IRequestResponseData;
on(event: string, listener: Function): void;
destroy(error?: Error): void;
}
}
interface IDisposable {
dispose(): void;
}
interface IShouldDispose {
shouldDispose: boolean;
setShouldDispose(shouldDispose: boolean): void;
}
/**
* Describes the type of data sent to analytics service.
*/
/**
* Describes the status of the current Analytics status, i.e. has the user allowed to be tracked.
*/
/**
* Describes types of options that manage -- flags.
*/
/**
* Describes options that can be passed to fs.readFile method.
*/
interface IReadFileOptions {
/**
* Defines the encoding. Defaults to null.
*/
encoding?: BufferEncoding | null;
/**
* Defines file flags. Defaults to "r".
*/
flag?: string;
}
/** @deprecated Kept so existing annotations compile; use the {@link FileSystem} contract. */
interface IFileSystem extends FileSystem {}
// duplicated from fs.Stats, because I cannot import it here
interface IFsStats {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atime: Date;
mtime: Date;
ctime: Date;
}
interface IOpener {
open(filename: string, appname?: string): void;
}
/** @deprecated Kept so existing annotations compile; use the {@link Errors} contract. */
interface IErrors extends Errors {}
interface IFailOptions {
name?: string;
formatStr?: string;
errorCode?: number;
proxyAuthenticationRequired?: boolean;
printOnStdout?: boolean;
}
/**
* Describes error raised when making http requests.
*/
interface IHttpRequestError extends Error {
/**
* Defines if the error is caused by the proxy requiring authentication.
*/
proxyAuthenticationRequired: boolean;
}
interface ICommandOptions {
disableAnalytics?: boolean;
enableHooks?: boolean;
disableCommandHelpSuggestion?: boolean;
}
interface ICommandDispatcher {
dispatchCommand(): Promise<void>;
}
interface ICancellationService extends IDisposable {
begin(name: string): Promise<void>;
end(name: string): void;
}
/** @deprecated Kept so existing annotations compile; use the {@link ChildProcess} contract. */
interface IChildProcess extends ChildProcess {}
interface IExecOptions {
showStderr: boolean;
}
interface ISpawnResult {
stderr: string;
stdout: string;
exitCode: number;
}
interface ISpawnFromEventOptions {
throwError: boolean;
emitOptions?: {
eventName: string;
};
timeout?: number;
}
interface IProjectDir {
projectDir: string;
}
interface IProjectHelper extends IProjectDir {
generateDefaultAppId(appName: string, baseAppId: string): string;
sanitizeName(appName: string): string;
}
interface IDictionary<T> {
[key: string]: T;
}
interface IAnalyticsService {
checkConsent(): Promise<void>;
trackException(exception: any, message: string): Promise<void>;
setStatus(settingName: string, enabled: boolean): Promise<void>;
getStatusMessage(
settingName: string,
jsonFormat: boolean,
readableSettingName: string,
): Promise<string>;
isEnabled(settingName: string): Promise<boolean>;
finishTracking(): Promise<void>;
/**
* Tracks the answer of question if user allows to be tracked.
* @param {{ acceptTrackFeatureUsage: boolean }} settings Object containing information about user's answer.
* @return {Promise<void>}
*/
trackAcceptFeatureUsage(settings: {
acceptTrackFeatureUsage: boolean;
}): Promise<void>;
/**
* Tracks data to Google Analytics project.
* @param {IGoogleAnalyticsData} data DTO describing the data that should be tracked.
* @return {Promise<void>}
*/
trackInGoogleAnalytics(data: IGoogleAnalyticsData): Promise<void>;
/**
* Tracks event action in Google Analytics project.
* @param {IEventActionData} data DTO describing information for the event.
* @return {Promise<void>}
*/
trackEventActionInGoogleAnalytics(data: IEventActionData): Promise<void>;
/**
* Defines if the instance should be disposed.
* @param {boolean} shouldDispose Defines if the instance should be disposed and the child processes should be disconnected.
* @returns {void}
*/
setShouldDispose(shouldDispose: boolean): void;
}
interface IAllowEmpty {
allowEmpty?: boolean;
}
interface IPrompterOptions extends IAllowEmpty {
defaultAction?: () => string;
}
type IPrompterAnswers<T extends string = string> = { [id in T]: any };
interface IPrompterQuestion<
T extends IPrompterAnswers<any> = IPrompterAnswers<any>,
> {
type?: string;
name?: string;
message?: string;
default?: any;
prefix?: string;
suffix?: string;
filter?(input: any, answers: T): any;
validate?(
input: any,
answers?: T,
): boolean | string | Promise<boolean | string>;
}
interface IAnalyticsSettingsService {
canDoRequest(): Promise<boolean>;
getUserId(): Promise<string>;
getClientName(): string;
/**
* Gets current user sessions count.
* @param {string} projectName The analytics project id for which the counter should be taken.
* @return {number} Number of user sessions.
*/
getUserSessionsCount(projectName: string): Promise<number>;
/**
* Set the number of user sessions.
* @param {number} count The number that will be set for user sessions.
* @param {string} projectName The analytics project id for which the counter should be set.
* @return {Promise<void>}
*/
setUserSessionsCount(count: number, projectName: string): Promise<void>;
/**
* Gets the unique client identifier (AnalyticsInstallationId). In case it does not exist - set it to new value and return it.
* @returns {Promise<string>}
*/
getClientId(): Promise<string>;
/**
* Gets user agent string identifing the current system in the following format: `${identifier} (${systemInfo}) ${osArch}`
* @param {string} identifier The product identifier.
* @returns {string} The user agent string.
*/
getUserAgentString(identifier: string): string;
}
interface IAutoCompletionService {
/**
* Enables command line autocompletion by creating a `.<cliname>rc` file and sourcing it in all profiles (.bash_profile, .bashrc, etc.).
* @returns {Promise<void>}
*/
enableAutoCompletion(): Promise<void>;
/**
* Disables auto completion by removing the entries from all profiles.
* @returns {void}
*/
disableAutoCompletion(): void;
/**
* Checks if autocompletion is enabled.
* @returns {boolean} true in case autocompletion is enabled in any file. false otherwise.
*/
isAutoCompletionEnabled(): boolean;
/**
* Checks if obsolete autocompletion code exists in any profile file.
* @returns {boolean} true in case there's some old code in any profile file. false otherwise.
*/
isObsoleteAutoCompletionEnabled(): boolean;
}
interface IHookExecutionOptions {
/**
* Set by call sites that fold the returned middlewares around a method (the
* `@hook` decorator). Where nothing consumes them, `ctx.wrap()` rejects
* instead of registering a middleware that would never run.
*/
consumesMiddlewares?: boolean;
}
interface IHooksService {
hookArgsName: string;
/** Resolves with the middlewares hooks registered through `ctx.wrap()`. */
executeBeforeHooks(
commandName: string,
hookArguments?: IDictionary<any>,
options?: IHookExecutionOptions,
): Promise<import("./define-hook").HookMiddleware[]>;
executeAfterHooks(
commandName: string,
hookArguments?: IDictionary<any>,
): Promise<void>;
}
interface IHook {
name: string;
fullPath: string;
}
/**
* Describes standard username/password type credentials.
*/
interface ICredentials {
username: string;
password: string;
}
interface IRejectUnauthorized {
/**
* Defines if NODE_TLS_REJECT_UNAUTHORIZED should be set to true or false. Default value is true.
*/
rejectUnauthorized: boolean;
}
/**
* Proxy settings required for http request.
*/
interface IProxySettings
extends IRejectUnauthorized, ICredentials, IProxySettingsBase {
/**
* Hostname of the machine used for proxy.
*/
hostname: string;
/**
* Port of the machine used for proxy that allows connections.
*/
port: string;
/**
* Protocol of the proxy - http or https
*/
protocol?: string;
}
interface IProxySettingsBase {
/**
* The url that should be passed to the request module in order to use the proxy.
* As request expects the property to be called `proxy` reuse the same name, so the IProxySettings object can be passed directly to request.
*/
proxy?: string;
}
interface IProxyLibSettings extends IRejectUnauthorized, ICredentials {
proxyUrl: string;
credentialsKey?: string;
userSpecifiedSettingsFilePath?: string;
}
/**
* Describes Service used for interaction with the proxy cache.
*/
interface IProxyService {
/**
* Caches proxy data.
* @param {IProxyLibSettings} settings Data to be cached.
* @returns {Promise<void>} The cache.
*/
setCache(settings: IProxyLibSettings): Promise<void>;
/**
* Retrieves proxy cache data.
* @returns {Promise<IProxySettings>} Proxy data.
*/
getCache(): Promise<IProxySettings>;
/**
* Clears proxy cache data.
* @returns {Promise<void>}
*/
clearCache(): Promise<void>;
/**
* Gets info about the proxy that can be printed and shown to the user.
* @returns {Promise<string>} Info about the proxy.
*/
getInfo(): Promise<string>;
}
interface IQrCodeImageData {
/**
* The original URL used for generating QR code image.
*/
originalUrl: string;
/**
* The shorten URL used for generating QR code image.
*/
shortenUrl: string;
/**
* Base64 encoded data used for generating QR code image.
*/
imageData: string;
}
interface IMicroTemplateService {
parseContent(data: string, options: { isHtml: boolean }): Promise<string>;
}
interface IHelpService {
generateHtmlPages(): Promise<void>;
/**
* Finds the html help for specified command and opens it in the browser.
* @param {ICommandData} commandData Data describing searched command - name and arguments.
* @returns {Promise<void>}
*/
openHelpForCommandInBrowser(commandData: ICommandData): Promise<void>;
/**
* Shows command line help for specified command.
* @param {string} commandData The name of the command for which to show the help.
* @returns {Promise<void>}
*/
showCommandLineHelp(commandData: ICommandData): Promise<void>;
}
/**
* Used to talk to xcode-select command-line tool.
*/
interface IXcodeSelectService {
/**
* Get the path to Contents directory inside Xcode.app.
* With a default installation this path is /Applications/Xcode.app/Contents
* @return {Promise<string>}
*/
getContentsDirectoryPath(): Promise<string>;
/**
* Get the path to Developer directory inside Xcode.app.
* With a default installation this path is /Applications/Xcode.app/Contents/Developer/
* @return {Promise<string>}
*/
getDeveloperDirectoryPath(): Promise<string>;
/**
* Get version of the currently used Xcode.
* @return {Promise<IVersionData>}
*/
getXcodeVersion(): Promise<IVersionData>;
}
interface IPlatform {
platform: string;
}
interface ISystemWarning {
message: string;
severity: SystemWarningsSeverity;
toString?: () => string;
}
interface ISysInfo {
getSysInfo(
config?: NativeScriptDoctor.ISysInfoConfig,
): Promise<NativeScriptDoctor.ISysInfoData>;
/**
* Returns the currently installed version of Xcode.
* @return {Promise<string>} Returns the currently installed version of Xcode or null if Xcode is not installed or executed on Linux or Windows.
*/
getXcodeVersion(): Promise<string>;
/**
* Returns the currently installed Java path based on JAVA_HOME and PATH..
* @return {Promise<string>} The currently installed Java path.
*/
getJavaPath(): Promise<string>;
/**
* Returns the currently installed Cocoapods version.
* @return {Promise<string>} Returns the currently installed Cocoapods version. It will return null if Cocoapods is not installed.
*/
getCocoaPodsVersion(): Promise<string>;
/**
* Returns the currently installed Java compiler version.
* @return {Promise<string>} The currently installed Java compiler version.
*/
getJavaCompilerVersion(): Promise<string>;
/**
* Gets JAVA version based on the executable in PATH.
* @return {Promise<string>}
*/
getJavaVersionFromPath(): Promise<string>;
/**
* Gets JAVA version based on the JAVA from JAVA_HOME.
* @return {Promise<string>}
*/
getJavaVersionFromJavaHome(): Promise<string>;
/**
* Gets all global warnings for the current environment, for example Node.js version compatibility, OS compatibility, etc.
* @return {Promise<ISystemWarning[]>} All warnings. Empty array is returned in case the system is setup correctly.
*/
getSystemWarnings(): Promise<ISystemWarning[]>;
/**
* Gets warning message for current macOS version.
* @return {Promise<string>} Message in case the current macOS version is deprecated, null otherwise.
*/
getMacOSWarningMessage(): Promise<ISystemWarning>;
/**
* Returns the value of engines.node key from CLI's package.json file.
* @return {string} The range of supported Node.js versions.
*/
getSupportedNodeVersionRange(): string;
/**
* Gets warning message in case the currently installed Xcode will not be supported in next versions
* @returns {string}
*/
getXcodeWarning(): Promise<string>;
}
/** @deprecated Kept so existing annotations compile; use the {@link HostInfo} contract. */
interface IHostInfo extends HostInfo {}
// tslint:disable-next-line:interface-name
interface GenericFunction<T> extends Function {
(...args: any[]): T;
}
declare global {
// tslint:disable-next-line:interface-name
interface Function {
$inject: {
args: string[];
name: string;
};
}
/**
* Extends Nodejs' Error interface.
* The native interface already has name and message properties
*/
// tslint:disable-next-line:interface-name
interface Error {
/**
* Error's stack trace
* @type {string}
*/
stack?: string;
/**
* Error's code - could be a string ('ENOENT'), as well as a number (127)
* @type {string|number}
*/
code?: string | number;
}
}
interface IRelease {
release: boolean;
}
interface IDeviceIdentifier {
device: string;
}
interface IJustLaunch {
justlaunch: boolean;
}
interface IAvd {
avd: string;
}
interface IAvailableDevices {
availableDevices: boolean;
}
interface IProfileDir {
profileDir: string;
}
interface IHasEmulatorOption {
emulator: boolean;
}
interface IYargArgv extends IDictionary<any> {
_: string[];
$0: string;
}
/**
* Describes dashed option (starting with --) passed on the command line.
* @interface
*/
interface IDashedOption {
/**
* Type of the option. It can be string, boolean, Array, etc.
*/
type: string;
/**
* Option has sensitive value
*/
hasSensitiveValue: boolean;
/**
* Shorthand option passed on the command line with `-` sign, for example `-v`
*/
alias?: any;
/**
* Defines if the options is mandatory or the number of mandatory arguments.
*/
demand?: any;
/**
* @see demand
*/
required?: any;
/**
* @see demand
*/
require?: any;
/**
* Sets default value of the -- option if it is NOT passed on the command line.
*/
default?: any;
/**
* Interpret the value as boolean, even if value is passed for it.
*/
boolean?: any;
/**
* Interpret the value as string, especially useful when you have to preserve numbers leading zeroes.
*/
string?: any;
/**
* Returns the count of the dashed options passed on the command line.
*/
count?: any;
/**
* Describes the usage of option.
*/
describe?: any;
/**
* No information about this option. Keep it here for backwards compatibility, but use describe instead.
*/
description?: any;
/**
* @see describe
*/
desc?: any;
/**
* Specifies either a single option key (string), or an array of options that must be followed by option values.
*/
requiresArg?: any;
}
/**
* Verifies the host OS configuration and prints warnings to the users
* Code behind of the "doctor" command
* @interface
*/
/** @deprecated Kept so existing annotations compile; use the {@link DoctorService} contract. */
interface IDoctorService extends DoctorService {}
interface IUtils {
getParsedTimeout(defaultTimeout: number): number;
getMilliSecondsTimeout(defaultTimeout: number): number;
}
/**
* Used for parsing of .plist files
*/
interface IPlistParser {
/**
* Parses the .plist file and returns the result as object
* @param {string} plistFilePath Absolute path to .plist file
* @return {Promise<any>} The parsed object
*/
parseFile(plistFilePath: string): Promise<any>;
parseFileSync(plistFilePath: string): any;
}
interface IUserSettingsService extends IJsonFileSettingsService {
// keep for backwards compatibility
}
/**
* Used for interaction with various resources located in a resources folder.
* @interface
*/
interface IResourceLoader {
/**
* Get an absolute path to a resource based on a relative one.
* @param {string} path Relative path to resource
* @return {string} Absolute path to resource
*/
resolvePath(path: string): string;
/**
* Opens a resource file for reading.
* @param {string} path Relative path to resource
* @return {NodeJS.ReadableStream} Read stream to the resource file
*/
openFile(path: string): NodeJS.ReadableStream;
readText(path: string): string;
/**
* Reads the contents of a resource file in JSON format.
* @param {string} path Relative path to resource
* @return {any} Object based on the JSON contents of the resource file.
*/
readJson(path: string): any;
}
/**
* Used for getting strings for informational/error messages.
*/
interface IMessagesService {
/**
* Array of the paths to the .json files containing all the messages.
* @type {string[]}
*/
pathsToMessageJsonFiles: string[];
/**
* @param {string} id Message's key in corresponding messages json file, could be complex (e.g. 'iOS.iTunes.ConnectError').
* @param {string[]} args Additional arguments used when the message's value is a string format.
* @return {string} The value found under the given id. If no value is found returns the id itself.
*/
getMessage(id: string, ...args: string[]): string;
}
/**
* Describes generated code parts.
*/
interface IServiceContractClientCode {
interfaceFile: string;
implementationFile: string;
}
/**
* Used for code generation.
*/
interface IServiceContractGenerator {
/**
* Generate code implementation along with interface
* @param {string} definitionsPath The path to the desired parent .d.ts file
* @return {Promise<IServiceContractClientCode>} The generated code parts
*/
generate(definitionsPath?: string): Promise<IServiceContractClientCode>;
}
/**
* Describes project file that should be livesynced
*/
interface IProjectFileInfo {
/**
* Full path to the file that has to be livesynced.
*/
filePath: string;
/**
* Filename that will be transefered on the device. This is the original filename with stripped platform and configuration names.
*/
onDeviceFileName: string;
/**
* Defines if the file should be included in the transfer. For example when device is Android, files that contain iOS in the name should not be synced.
*/
shouldIncludeFile: boolean;
}
interface IProjectFilesManager {
/**
* Enumerates all files and directories from the specified project files path.
*/
getProjectFiles(
projectFilesPath: string,
excludedProjectDirsAndFiles?: string[],
filter?: (filePath: string, stat: IFsStats) => boolean,
opts?: any,
): string[];
/**
* Checks if the file is excluded
*/
isFileExcluded(
filePath: string,
excludedProjectDirsAndFiles?: string[],
): boolean;
/**
* Returns an object that maps every local file path to device file path
* If projectFiles parameter is not specified enumerates the files from the specified projectFilesPath
*/
createLocalToDevicePaths(
deviceAppData: Mobile.IDeviceAppData,
projectFilesPath: string,
files: string[],
excludedProjectDirsAndFiles: string[],
projectFilesConfig?: IProjectFilesConfig,
): Promise<Mobile.ILocalToDevicePathData[]>;
/**
* Handle platform specific files.
* @param {string} directoryPath Directory from which to start looking for platform specific files. All subdirectories will be included.
* @param {string} platform Mobile platform - only platform specific files for this platform will be included.
* @param {IProjectFilesConfig} projectFilesConfig
* @param {string[]} excludedDirs Directories which should be skipped.
* @returns {void}
*/
processPlatformSpecificFiles(
directoryPath: string,
platform: string,
projectFilesConfig?: IProjectFilesConfig,
excludedDirs?: string[],
): void;
}
interface IProjectFilesProvider {
/**
* Checks if the file is excluded
*/
isFileExcluded(filePath: string): boolean;
/**
* Performs local file path mapping
*/
mapFilePath(
filePath: string,
platform: string,
projectData: any,
projectFilesConfig?: IProjectFilesConfig,
): string;
/**
* Returns information about file in the project, that includes file's name on device after removing platform or configuration from the name.
* @param {string} filePath Path to the project file.
* @param {string} platform platform for which to get the information.