microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/typings/exponent/xdl.d.ts
111lines · 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): Q.Promise<IUser>; |
| 18 | logoutAsync(): Q.Promise<void>; |
| 19 | getCurrentUserAsync(): Q.Promise<IUser>; |
| 20 | } |
| 21 | |
| 22 | interface IStartOptions { |
| 23 | reset?: boolean |
| 24 | } |
| 25 | |
| 26 | interface IUrlOptions { |
| 27 | urlType?: "exp" | "http" | "redirect", |
| 28 | hostType?: "tunnel" | "lan" | "localhost", |
| 29 | dev: boolean, |
| 30 | minify: boolean |
| 31 | } |
| 32 | |
| 33 | interface IPublishOptions { |
| 34 | quiet: boolean |
| 35 | } |
| 36 | |
| 37 | interface IReactNativeServerOptions { |
| 38 | reset: boolean |
| 39 | } |
| 40 | |
| 41 | interface IOptions { |
| 42 | packagerPort: number |
| 43 | } |
| 44 | |
| 45 | interface IPublishResponse { |
| 46 | err: any, |
| 47 | url: string |
| 48 | } |
| 49 | |
| 50 | var Project: { |
| 51 | startAsync(projectRoot: string, options?: IStartOptions): Q.Promise<void>; |
| 52 | stopAsync(projectRoot: string): Q.Promise<void>; |
| 53 | getUrlAsync(projectRoot: string, options?: IUrlOptions): Q.Promise<string>; |
| 54 | publishAsync(projectRoot: string, options?: IPublishOptions): Q.Promise<IPublishResponse>; |
| 55 | startExpoServerAsync(projectRoot: string): Q.Promise<void>; |
| 56 | stopExpoServerAsync(projectRoot: string): Q.Promise<void>; |
| 57 | startReactNativeServerAsync(projectRoot: string, options?: IReactNativeServerOptions): Q.Promise<void>; |
| 58 | stopReactNativeServerAsync(projectRoot: string): Q.Promise<void>; |
| 59 | startTunnelsAsync(projectRoot: string): Q.Promise<void>; |
| 60 | stopTunnelsAsync(projectRoot: string): Q.Promise<void>; |
| 61 | setOptionsAsync(projectRoot: string, options?: IOptions): Q.Promise<void>; |
| 62 | } |
| 63 | |
| 64 | var Versions: { |
| 65 | facebookReactNativeVersionsAsync(): Q.Promise<string[]>; |
| 66 | facebookReactNativeVersionToExpoVersionAsync(facebookReactNativeVersion: string): Q.Promise<string>; |
| 67 | } |
| 68 | |
| 69 | interface IApiConfig { |
| 70 | scheme: string, |
| 71 | host: string, |
| 72 | port: number |
| 73 | } |
| 74 | |
| 75 | interface INgrokConfig { |
| 76 | authToken: string, |
| 77 | authTokenPublicId: string, |
| 78 | domain: string |
| 79 | } |
| 80 | |
| 81 | interface IValidationConfig { |
| 82 | reactNativeVersionWarnings: boolean |
| 83 | } |
| 84 | |
| 85 | interface IConfig { |
| 86 | api: IApiConfig, |
| 87 | ngrok: INgrokConfig, |
| 88 | developerTool: any, |
| 89 | validation: IValidationConfig |
| 90 | } |
| 91 | |
| 92 | var Config: IConfig; |
| 93 | |
| 94 | interface IBunyanStream { |
| 95 | type?: string; |
| 96 | level?: number | string; |
| 97 | path?: string; |
| 98 | stream?: NodeJS.WritableStream | IBunyanStream; |
| 99 | closeOnExit?: boolean; |
| 100 | period?: string; |
| 101 | count?: number; |
| 102 | } |
| 103 | |
| 104 | var ProjectUtils: { |
| 105 | attachLoggerStream(rootPath: string, options?: IBunyanStream): void; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | declare module "xdl" { |
| 110 | export = xdl; |
| 111 | } |