microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/typings/exponent/xdl.d.ts
151lines · modecode
| 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: { |
| 17 | loginAsync(loginType: string, options: ILoginOptions): Promise<IUser>; |
| 18 | logoutAsync(): Promise<void>; |
| 19 | getCurrentUserAsync(): Promise<IUser>; |
| 20 | } |
| 21 | |
| 22 | var UserManager: { |
| 23 | loginAsync(loginType: string, options: ILoginOptions): Promise<IUser>; |
| 24 | logoutAsync(): Promise<void>; |
| 25 | getCurrentUserAsync(): Promise<IUser>; |
| 26 | } |
| 27 | |
| 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 | |
| 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 | |
| 81 | var Project: { |
| 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>; |
| 92 | setOptionsAsync(projectRoot: string, options?: IOptions): Promise<void>; |
| 93 | } |
| 94 | |
| 95 | var UrlUtils: { |
| 96 | constructManifestUrlAsync(projectRoot: string, opts?: any, requestHostname?: string): Promise<string>; |
| 97 | } |
| 98 | |
| 99 | var Versions: { |
| 100 | sdkVersionsAsync(): Promise<SDKVersions>; |
| 101 | releasedSdkVersionsAsync(): Promise<SDKVersions>; |
| 102 | } |
| 103 | |
| 104 | var Android: { |
| 105 | startAdbReverseAsync(projectRoot: string): Promise<boolean>; |
| 106 | stopAdbReverseAsync(projectRoot: string): Promise<void>; |
| 107 | } |
| 108 | |
| 109 | interface IApiConfig { |
| 110 | scheme: string, |
| 111 | host: string, |
| 112 | port: number |
| 113 | } |
| 114 | |
| 115 | interface INgrokConfig { |
| 116 | authToken: string, |
| 117 | authTokenPublicId: string, |
| 118 | domain: string |
| 119 | } |
| 120 | |
| 121 | interface IValidationConfig { |
| 122 | reactNativeVersionWarnings: boolean |
| 123 | } |
| 124 | |
| 125 | interface IConfig { |
| 126 | api: IApiConfig, |
| 127 | ngrok: INgrokConfig, |
| 128 | developerTool: any, |
| 129 | validation: IValidationConfig |
| 130 | } |
| 131 | |
| 132 | var Config: IConfig; |
| 133 | |
| 134 | interface IBunyanStream { |
| 135 | type?: string; |
| 136 | level?: number | string; |
| 137 | path?: string; |
| 138 | stream?: NodeJS.WritableStream | IBunyanStream; |
| 139 | closeOnExit?: boolean; |
| 140 | period?: string; |
| 141 | count?: number; |
| 142 | } |
| 143 | |
| 144 | var ProjectUtils: { |
| 145 | attachLoggerStream(rootPath: string, options?: IBunyanStream): void; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | declare module "xdl" { |
| 150 | export = xdl; |
| 151 | } |