microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/typings/exponent/xdl.d.ts
126lines · 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 | var Project: { |
| 57 | startAsync(projectRoot: string, options?: IStartOptions): Promise<void>; |
| 58 | stopAsync(projectRoot: string): Promise<void>; |
| 59 | getUrlAsync(projectRoot: string, options?: IUrlOptions): Promise<string>; |
| 60 | publishAsync(projectRoot: string, options?: IPublishOptions): Promise<IPublishResponse>; |
| 61 | startExpoServerAsync(projectRoot: string): Promise<void>; |
| 62 | stopExpoServerAsync(projectRoot: string): Promise<void>; |
| 63 | startReactNativeServerAsync(projectRoot: string, options?: IReactNativeServerOptions): Promise<void>; |
| 64 | stopReactNativeServerAsync(projectRoot: string): Promise<void>; |
| 65 | startTunnelsAsync(projectRoot: string): Promise<void>; |
| 66 | stopTunnelsAsync(projectRoot: string): Promise<void>; |
| 67 | setOptionsAsync(projectRoot: string, options?: IOptions): Promise<void>; |
| 68 | } |
| 69 | |
| 70 | var UrlUtils: { |
| 71 | constructManifestUrlAsync(projectRoot: string, opts?: any, requestHostname?: string): Promise<string>; |
| 72 | } |
| 73 | |
| 74 | var Versions: { |
| 75 | facebookReactNativeVersionsAsync(): Promise<string[]>; |
| 76 | facebookReactNativeVersionToExpoVersionAsync(facebookReactNativeVersion: string): Promise<string>; |
| 77 | } |
| 78 | |
| 79 | var Android: { |
| 80 | startAdbReverseAsync(projectRoot: string): Promise<boolean>; |
| 81 | stopAdbReverseAsync(projectRoot: string): Promise<void>; |
| 82 | } |
| 83 | |
| 84 | interface IApiConfig { |
| 85 | scheme: string, |
| 86 | host: string, |
| 87 | port: number |
| 88 | } |
| 89 | |
| 90 | interface INgrokConfig { |
| 91 | authToken: string, |
| 92 | authTokenPublicId: string, |
| 93 | domain: string |
| 94 | } |
| 95 | |
| 96 | interface IValidationConfig { |
| 97 | reactNativeVersionWarnings: boolean |
| 98 | } |
| 99 | |
| 100 | interface IConfig { |
| 101 | api: IApiConfig, |
| 102 | ngrok: INgrokConfig, |
| 103 | developerTool: any, |
| 104 | validation: IValidationConfig |
| 105 | } |
| 106 | |
| 107 | var Config: IConfig; |
| 108 | |
| 109 | interface IBunyanStream { |
| 110 | type?: string; |
| 111 | level?: number | string; |
| 112 | path?: string; |
| 113 | stream?: NodeJS.WritableStream | IBunyanStream; |
| 114 | closeOnExit?: boolean; |
| 115 | period?: string; |
| 116 | count?: number; |
| 117 | } |
| 118 | |
| 119 | var ProjectUtils: { |
| 120 | attachLoggerStream(rootPath: string, options?: IBunyanStream): void; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | declare module "xdl" { |
| 125 | export = xdl; |
| 126 | } |