mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +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),
|
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(
|
||||||
if (hasValue && shouldOverwrite) {
|
async ([hasValue, [shouldOverwrite, dependency]]): Promise<readonly [false, null]> => {
|
||||||
await this.overwriteOutput(dependency);
|
if (hasValue && shouldOverwrite) {
|
||||||
}
|
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;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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 [];
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user