1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

[PM-22309] Resolve TypeScript 5.8 blockers for tool owned files (#16065)

* Add explicit return types to resolve typescript 5.8 blockers

* Remove type from input
This commit is contained in:
Oscar Hinton
2025-08-19 11:13:22 +02:00
committed by GitHub
parent e942645d44
commit a45f053a7f
2 changed files with 13 additions and 9 deletions

View File

@@ -45,12 +45,14 @@ export class BufferedState<Input, Output, Dependency> implements SingleUserState
map((dependency) => [key.shouldOverwrite(dependency), dependency] as const), map((dependency) => [key.shouldOverwrite(dependency), dependency] as const),
); );
const overwrite$ = combineLatest([hasValue$, overwriteDependency$]).pipe( const overwrite$ = combineLatest([hasValue$, overwriteDependency$]).pipe(
concatMap(async ([hasValue, [shouldOverwrite, dependency]]) => { concatMap(
async ([hasValue, [shouldOverwrite, dependency]]): Promise<readonly [false, null]> => {
if (hasValue && shouldOverwrite) { if (hasValue && shouldOverwrite) {
await this.overwriteOutput(dependency); await this.overwriteOutput(dependency);
} }
return [false, null] as const; return [false, null] as const;
}), },
),
); );
// drive overwrites only when there's a subscription; // drive overwrites only when there's a subscription;
@@ -71,7 +73,7 @@ export class BufferedState<Input, Output, Dependency> implements SingleUserState
private async overwriteOutput(dependency: Dependency) { private async overwriteOutput(dependency: Dependency) {
// take the latest value from the buffer // take the latest value from the buffer
let buffered: Input; let buffered: Input;
await this.bufferedState.update((state) => { await this.bufferedState.update((state): Input | null => {
buffered = state ?? null; buffered = state ?? null;
return null; return null;
}); });

View File

@@ -345,7 +345,8 @@ export class LegacyPasswordGenerationService implements PasswordGenerationServic
timeout({ timeout({
// timeout after 1 second // timeout after 1 second
each: 1000, each: 1000,
with() { // TODO(PM-22309): Typescript 5.8 update, confirm type
with(): any[] {
return []; return [];
}, },
}), }),
@@ -370,7 +371,8 @@ export class LegacyPasswordGenerationService implements PasswordGenerationServic
timeout({ timeout({
// timeout after 1 second // timeout after 1 second
each: 1000, each: 1000,
with() { // TODO(PM-22309): Typescript 5.8 update, confirm type
with(): any[] {
return []; return [];
}, },
}), }),