diff --git a/.prettierignore b/.prettierignore --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,6 @@ +flow-typed landing/dist -landing/flow-typed -lib/flow-typed web/dist -web/flow-typed keyserver/app_compiled keyserver/landing_compiled keyserver/dist @@ -10,10 +8,8 @@ keyserver/facts keyserver/images keyserver/fonts -keyserver/flow-typed keyserver/src/landing keyserver/src/lib keyserver/src/web native/android -native/flow-typed native/ios diff --git a/services/electron-update-server/flow-typed/npm/express_v4.17.x.js b/services/electron-update-server/flow-typed/npm/express_v4.17.x.js --- a/services/electron-update-server/flow-typed/npm/express_v4.17.x.js +++ b/services/electron-update-server/flow-typed/npm/express_v4.17.x.js @@ -51,10 +51,7 @@ foo: string | void; } */ -declare class express$Request - extends http$IncomingMessage - mixins express$RequestResponseBase -{ +declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase { baseUrl: string; body: mixed; cookies: { [cookie: string]: string, ... }; @@ -67,7 +64,7 @@ originalUrl: string; params: express$RequestParams; path: string; - protocol: 'https' | 'http'; + protocol: "https" | "http"; query: { [name: string]: string | Array, ... }; res?: express$Response; route: string; @@ -84,10 +81,7 @@ header(field: string): string | void; is(type: string): string | false; param(name: string, defaultValue?: string): string | void; - range( - size: number, - options?: express$RangeParserOptions, - ): Array | number | void; + range(size: number, options?: express$RangeParserOptions): Array | number | void; } declare type express$CookieOptions = { @@ -106,7 +100,7 @@ declare type express$RenderCallback = ( err: Error | null, - html?: string, + html?: string ) => mixed; declare type express$SendFileOptions = { @@ -114,14 +108,11 @@ root?: string, lastModified?: boolean, headers?: { [name: string]: string, ... }, - dotfiles?: 'allow' | 'deny' | 'ignore', + dotfiles?: "allow" | "deny" | "ignore", ... }; -declare class express$Response - extends http$ServerResponse - mixins express$RequestResponseBase -{ +declare class express$Response extends http$ServerResponse mixins express$RequestResponseBase { headersSent: boolean; locals: { [name: string]: mixed, ... }; append(field: string, value?: string): this; @@ -131,7 +122,7 @@ download( path: string, filename?: string, - callback?: (err?: ?Error) => void, + callback?: (err?: ?Error) => void ): this; format(typesObject: { [type: string]: Function, ... }): this; json(body?: mixed): this; @@ -143,14 +134,17 @@ render( view: string, locals?: { [name: string]: mixed, ... }, - callback?: express$RenderCallback, + callback?: express$RenderCallback + ): this; + render( + view: string, + callback?: express$RenderCallback ): this; - render(view: string, callback?: express$RenderCallback): this; send(body?: mixed): this; sendFile( path: string, options?: express$SendFileOptions, - callback?: (err?: ?Error) => mixed, + callback?: (err?: ?Error) => mixed ): this; sendStatus(statusCode: number): this; header(field: string, value?: string): this; @@ -163,13 +157,13 @@ req: express$Request; } -declare type express$NextFunction = (err?: ?Error | 'route') => mixed; +declare type express$NextFunction = (err?: ?Error | "route") => mixed; declare type express$Middleware< Req: express$Request = express$Request, Res: express$Response = express$Response, > = - | ((req: Req, res: Res, next: express$NextFunction) => mixed) - | ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed); + ((req: Req, res: Res, next: express$NextFunction) => mixed) | + ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed); declare interface express$RouteMethodType< T, @@ -219,38 +213,26 @@ connect: express$RouteMethodType; } -declare type express$RouterUseable< - Req: express$Request, - Res: express$Response, -> = +declare type express$RouterUseable = | express$Middleware | express$Router | $ReadOnlyArray | express$Router>; declare class express$Router< - Req: express$Request = express$Request, - Res: express$Response = express$Response, - > - extends express$Route -{ + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> extends express$Route { constructor(options?: express$RouterOptions): void; route(path: string): express$Route; static ( options?: express$RouterOptions, ): express$Router; - use( - express$RouterUseable, - ...express$RouterUseable[] - ): this; - use( - express$Path, - express$RouterUseable, - ...express$RouterUseable[] - ): this; + use(express$RouterUseable, ...express$RouterUseable[]): this; + use(express$Path, express$RouterUseable, ...express$RouterUseable[]): this; handle( req: http$IncomingMessage<>, res: http$ServerResponse, - next: express$NextFunction, + next: express$NextFunction ): void; param( param: string, @@ -260,12 +242,12 @@ next: express$NextFunction, value: string, paramName: string, - ) => mixed, + ) => mixed ): void; ( req: http$IncomingMessage<>, res: http$ServerResponse, - next?: ?express$NextFunction, + next?: ?express$NextFunction ): void; } @@ -278,12 +260,9 @@ */ declare class express$Application< - Req: express$Request = express$Request, - Res: express$Response = express$Response, - > - extends express$Router - mixins events$EventEmitter -{ + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> extends express$Router mixins events$EventEmitter { constructor(): void; locals: { [name: string]: mixed, ... }; mountpath: string; @@ -291,12 +270,12 @@ port: number, hostname?: string, backlog?: number, - callback?: (err?: ?Error) => mixed, + callback?: (err?: ?Error) => mixed ): ?http$Server; listen( port: number, hostname?: string, - callback?: (err?: ?Error) => mixed, + callback?: (err?: ?Error) => mixed ): ?http$Server; listen(port: number, callback?: (err?: ?Error) => mixed): ?http$Server; listen(path: string, callback?: (err?: ?Error) => mixed): ?http$Server; @@ -314,18 +293,18 @@ render( name: string, optionsOrFunction: { [name: string]: mixed, ... }, - callback: express$RenderCallback, + callback: express$RenderCallback ): void; handle( req: http$IncomingMessage<>, res: http$ServerResponse, - next?: ?express$NextFunction, + next?: ?express$NextFunction ): void; // callable signature is not inherited ( req: http$IncomingMessage<>, res: http$ServerResponse, - next?: ?express$NextFunction, + next?: ?express$NextFunction ): void; } @@ -339,7 +318,7 @@ req: express$Request, res: express$Response, buf: Buffer, - encoding: string, + encoding: string ) => mixed, ... }; @@ -354,12 +333,12 @@ req: express$Request, res: express$Response, buf: Buffer, - encoding: string, + encoding: string ) => mixed, ... -}; +} -declare module 'express' { +declare module "express" { declare export type RouterOptions = express$RouterOptions; declare export type CookieOptions = express$CookieOptions; declare export type Middleware< @@ -377,16 +356,10 @@ declare module.exports: { // If you try to call like a function, it will use this signature - (): express$Application< - Req, - Res, - >, + (): express$Application, json: (opts: ?JsonOptions) => express$Middleware<>, // `static` property on the function - static: ( - root: string, - options?: Object, - ) => express$Middleware, + static: (root: string, options?: Object) => express$Middleware, // `Router` property on the function Router: typeof express$Router, urlencoded: (opts: ?express$UrlEncodedOptions) => express$Middleware<>,