microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/typings/exponent/xdl.d.ts
165lines · modeblame
1c32fe84Patricio Beltran9 years ago | 1 | // Type definitions for xdl 0.9.0 |
| 2 | // Project: https://github.com/exponentjs/xdl | |
| 3 | // Definitions by: Patricio Beltran <https://github.com/patobeltran> | |
| 4 | | |
| 5 | declare module xdl { | |
| 6 | interface ILoginOptions { | |
| 7 | username: string, | |
| 8 | password: string | |
| 9 | } | |
| 10 | | |
| 11 | interface IUser { | |
| 12 | type: string, | |
| 13 | username: string | |
| 14 | } | |
| 15 | | |
| 16 | var User: { | |
ce5e88eeYuri Skorokhodov5 years ago | 17 | loginAsync(loginType: string, options: ILoginOptions): Promise<IUser>; |
| 18 | logoutAsync(): Promise<void>; | |
| 19 | getCurrentUserAsync(): Promise<IUser>; | |
1c32fe84Patricio Beltran9 years ago | 20 | } |
| 21 | | |
4aec730eYuri Skorokhodov6 years ago | 22 | var UserManager: { |
ce5e88eeYuri Skorokhodov5 years ago | 23 | loginAsync(loginType: string, options: ILoginOptions): Promise<IUser>; |
| 24 | logoutAsync(): Promise<void>; | |
| 25 | getCurrentUserAsync(): Promise<IUser>; | |
4aec730eYuri Skorokhodov6 years ago | 26 | } |
| 27 | | |
1c32fe84Patricio Beltran9 years ago | 28 | interface IStartOptions { |
| 29 | reset?: boolean | |
| 30 | } | |
| 31 | | |
| 32 | interface IUrlOptions { | |
| 33 | urlType?: "exp" | "http" | "redirect", | |
| 34 | hostType?: "tunnel" | "lan" | "localhost", | |
| 35 | dev: boolean, | |
| 36 | minify: boolean | |
| 37 | } | |
| 38 | | |
| 39 | interface IPublishOptions { | |
| 40 | quiet: boolean | |
| 41 | } | |
| 42 | | |
| 43 | interface IReactNativeServerOptions { | |
| 44 | reset: boolean | |
| 45 | } | |
| 46 | | |
| 47 | interface IOptions { | |
| 48 | packagerPort: number | |
| 49 | } | |
| 50 | | |
| 51 | interface IPublishResponse { | |
| 52 | err: any, | |
| 53 | url: string | |
| 54 | } | |
| 55 | | |
8f50947fRedMickey5 years ago | 56 | interface SDKVersion { |
| 57 | androidExpoViewUrl?: string; | |
| 58 | expoReactNativeTag: string; | |
| 59 | /* deprecated */ exponentReactNativeTag?: string; | |
| 60 | expokitNpmPackage?: string; | |
| 61 | facebookReactNativeVersion: string; | |
| 62 | facebookReactVersion?: string; | |
| 63 | iosExpoViewUrl?: string; | |
| 64 | /* deprecated */ iosExponentViewUrl?: string; | |
| 65 | iosVersion?: string; | |
| 66 | isDeprecated?: boolean; | |
| 67 | packagesToInstallWhenEjecting?: { [name: string]: string }; | |
| 68 | releaseNoteUrl?: string; | |
| 69 | iosClientUrl?: string; | |
| 70 | iosClientVersion?: string; | |
| 71 | androidClientUrl?: string; | |
| 72 | androidClientVersion?: string; | |
| 73 | relatedPackages?: { [name: string]: string }; | |
| 74 | beta?: boolean; | |
| 75 | } | |
| 76 | | |
| 77 | interface SDKVersions { | |
| 78 | [version: string]: SDKVersion; | |
| 79 | } | |
| 80 | | |
1c32fe84Patricio Beltran9 years ago | 81 | var Project: { |
ce5e88eeYuri Skorokhodov5 years ago | 82 | startAsync(projectRoot: string, options?: IStartOptions): Promise<void>; |
| 83 | stopAsync(projectRoot: string): Promise<void>; | |
| 84 | getUrlAsync(projectRoot: string, options?: IUrlOptions): Promise<string>; | |
| 85 | publishAsync(projectRoot: string, options?: IPublishOptions): Promise<IPublishResponse>; | |
| 86 | startExpoServerAsync(projectRoot: string): Promise<void>; | |
| 87 | stopExpoServerAsync(projectRoot: string): Promise<void>; | |
| 88 | startReactNativeServerAsync(projectRoot: string, options?: IReactNativeServerOptions): Promise<void>; | |
| 89 | stopReactNativeServerAsync(projectRoot: string): Promise<void>; | |
| 90 | startTunnelsAsync(projectRoot: string): Promise<void>; | |
| 91 | stopTunnelsAsync(projectRoot: string): Promise<void>; | |
ec230406RedMickey4 years ago | 92 | } |
| 93 | | |
| 94 | var ProjectSettings: { | |
| 95 | setPackagerInfoAsync(projectRoot: string, json: Partial<IOptions>): Promise<IOptions>; | |
1c32fe84Patricio Beltran9 years ago | 96 | } |
| 97 | | |
a81a5847JiglioNero5 years ago | 98 | var UrlUtils: { |
| 99 | constructManifestUrlAsync(projectRoot: string, opts?: any, requestHostname?: string): Promise<string>; | |
| 100 | } | |
| 101 | | |
1c32fe84Patricio Beltran9 years ago | 102 | var Versions: { |
8f50947fRedMickey5 years ago | 103 | sdkVersionsAsync(): Promise<SDKVersions>; |
| 104 | releasedSdkVersionsAsync(): Promise<SDKVersions>; | |
1c32fe84Patricio Beltran9 years ago | 105 | } |
| 106 | | |
62c4de22RedMickey6 years ago | 107 | var Android: { |
ce5e88eeYuri Skorokhodov5 years ago | 108 | startAdbReverseAsync(projectRoot: string): Promise<boolean>; |
| 109 | stopAdbReverseAsync(projectRoot: string): Promise<void>; | |
62c4de22RedMickey6 years ago | 110 | } |
| 111 | | |
1c32fe84Patricio Beltran9 years ago | 112 | interface IApiConfig { |
| 113 | scheme: string, | |
| 114 | host: string, | |
| 115 | port: number | |
| 116 | } | |
| 117 | | |
| 118 | interface INgrokConfig { | |
| 119 | authToken: string, | |
| 120 | authTokenPublicId: string, | |
| 121 | domain: string | |
| 122 | } | |
| 123 | | |
| 124 | interface IValidationConfig { | |
| 125 | reactNativeVersionWarnings: boolean | |
| 126 | } | |
| 127 | | |
| 128 | interface IConfig { | |
| 129 | api: IApiConfig, | |
| 130 | ngrok: INgrokConfig, | |
| 131 | developerTool: any, | |
| 132 | validation: IValidationConfig | |
| 133 | } | |
| 134 | | |
| 135 | var Config: IConfig; | |
7059d307Patricio Beltran9 years ago | 136 | |
| 137 | interface IBunyanStream { | |
| 138 | type?: string; | |
| 139 | level?: number | string; | |
| 140 | path?: string; | |
| 141 | stream?: NodeJS.WritableStream | IBunyanStream; | |
| 142 | closeOnExit?: boolean; | |
| 143 | period?: string; | |
| 144 | count?: number; | |
| 145 | } | |
| 146 | | |
| 147 | var ProjectUtils: { | |
| 148 | attachLoggerStream(rootPath: string, options?: IBunyanStream): void; | |
| 149 | } | |
efb436fcRedMickey5 years ago | 150 | |
| 151 | interface ResolveNgrok | |
| 152 | { | |
| 153 | resolveNgrokAsync( | |
| 154 | projectRoot: string, | |
| 155 | { | |
| 156 | shouldPrompt = true, | |
| 157 | autoInstall = false, | |
| 158 | }: { shouldPrompt?: boolean; autoInstall?: boolean } = {}, | |
| 159 | ): Promise<any>; | |
| 160 | }; | |
1c32fe84Patricio Beltran9 years ago | 161 | } |
| 162 | | |
| 163 | declare module "xdl" { | |
| 164 | export = xdl; | |
| 165 | } |