mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
We currently use a callback syntax for abstract services. This syntax isn't completely strict compliant and will fail the strictPropertyInitialization check. We also currently don't get any compile time errors if we forget to implement a function. To that end this PR updates all platform owned services to use the appropriate abstract keyword for non implemented functions. I also updated the fields to be actual functions and not properties.
14 lines
477 B
TypeScript
14 lines
477 B
TypeScript
import { GlobalState } from "./global-state";
|
|
import { KeyDefinition } from "./key-definition";
|
|
|
|
/**
|
|
* A provider for geting an implementation of global state scoped to the given key.
|
|
*/
|
|
export abstract class GlobalStateProvider {
|
|
/**
|
|
* Gets a {@link GlobalState} scoped to the given {@link KeyDefinition}
|
|
* @param keyDefinition - The {@link KeyDefinition} for which you want the state for.
|
|
*/
|
|
abstract get<T>(keyDefinition: KeyDefinition<T>): GlobalState<T>;
|
|
}
|