silence some new ts squigglies in the editor (#3435)

This commit is contained in:
Fredrik Adelöw
2020-11-25 09:57:16 +01:00
committed by GitHub
parent 8fd5e64351
commit fae3fafcfa
10 changed files with 18 additions and 17 deletions
@@ -163,7 +163,7 @@ export class MicrosoftAuthProvider implements OAuthHandlers {
});
}
private getUserPhoto(accessToken: string): Promise<string> {
private getUserPhoto(accessToken: string): Promise<string | undefined> {
return new Promise(resolve => {
got
.get('https://graph.microsoft.com/v1.0/me/photos/48x48/$value', {
@@ -184,7 +184,7 @@ export class MicrosoftAuthProvider implements OAuthHandlers {
`Could not retrieve user profile photo from Microsoft Graph API: ${error}`,
);
// User profile photo is optional, ignore errors and resolve undefined
resolve();
resolve(undefined);
});
});
}
@@ -27,7 +27,7 @@
export function runPeriodically(fn: () => any, delayMs: number): () => void {
let cancel: () => void;
let cancelled = false;
const cancellationPromise = new Promise(resolve => {
const cancellationPromise = new Promise<void>(resolve => {
cancel = () => {
resolve();
cancelled = true;
@@ -66,7 +66,7 @@ export const runCommand = async ({
args,
logStream = new PassThrough(),
}: RunCommandOptions) => {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const process = spawn(command, args);
process.stdout.on('data', stream => {
@@ -109,7 +109,7 @@ export const runDockerContainer = async ({
dockerClient,
createOptions = {},
}: RunDockerContainerOptions) => {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
dockerClient.pull(imageName, {}, (err, stream) => {
if (err) return reject(err);
stream.pipe(logStream, { end: false });
@@ -120,6 +120,7 @@ export const runDockerContainer = async ({
});
const userOptions: UserOptions = {};
// @ts-ignore
if (process.getuid && process.getgid) {
// Files that are created inside the Docker container will be owned by
// root on the host system on non Mac systems, because of reasons. Mainly the fact that
@@ -63,7 +63,7 @@ export async function runDockerContainer({
);
}
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
dockerClient.pull(imageName, {}, (err, stream) => {
if (err) return reject(err);
stream.pipe(logStream, { end: false });
@@ -119,7 +119,7 @@ export const runCommand = async ({
options,
logStream = new PassThrough(),
}: RunCommandOptions) => {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const process = spawn(command, args, options);
process.stdout.on('data', stream => {