mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +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:
@@ -45,12 +45,14 @@ export class BufferedState<Input, Output, Dependency> implements SingleUserState
|
||||
map((dependency) => [key.shouldOverwrite(dependency), dependency] as const),
|
||||
);
|
||||
const overwrite$ = combineLatest([hasValue$, overwriteDependency$]).pipe(
|
||||
concatMap(async ([hasValue, [shouldOverwrite, dependency]]) => {
|
||||
if (hasValue && shouldOverwrite) {
|
||||
await this.overwriteOutput(dependency);
|
||||
}
|
||||
return [false, null] as const;
|
||||
}),
|
||||
concatMap(
|
||||
async ([hasValue, [shouldOverwrite, dependency]]): Promise<readonly [false, null]> => {
|
||||
if (hasValue && shouldOverwrite) {
|
||||
await this.overwriteOutput(dependency);
|
||||
}
|
||||
return [false, null] as const;
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
// 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) {
|
||||
// take the latest value from the buffer
|
||||
let buffered: Input;
|
||||
await this.bufferedState.update((state) => {
|
||||
await this.bufferedState.update((state): Input | null => {
|
||||
buffered = state ?? null;
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -345,7 +345,8 @@ export class LegacyPasswordGenerationService implements PasswordGenerationServic
|
||||
timeout({
|
||||
// timeout after 1 second
|
||||
each: 1000,
|
||||
with() {
|
||||
// TODO(PM-22309): Typescript 5.8 update, confirm type
|
||||
with(): any[] {
|
||||
return [];
|
||||
},
|
||||
}),
|
||||
@@ -370,7 +371,8 @@ export class LegacyPasswordGenerationService implements PasswordGenerationServic
|
||||
timeout({
|
||||
// timeout after 1 second
|
||||
each: 1000,
|
||||
with() {
|
||||
// TODO(PM-22309): Typescript 5.8 update, confirm type
|
||||
with(): any[] {
|
||||
return [];
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user