Merge branch 'master' into show-extension-preferences-in-separate-page

This commit is contained in:
Alex Andreev committed 2022-06-09 14:11:44 +03:00
commit 88cce075ec
48 files changed
+506 -305

No files matched your search

@@ -3,6 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export type UpdateChannelId = "alpha" | "beta" | "latest";
const latestChannel: UpdateChannel = {
@@ -4,12 +4,21 @@
*/
import { getInjectionToken } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx";
import type { JsonValue } from "type-fest";
export interface SyncBox<TValue extends JsonValue> {
type AsJson<T> = T extends string | number | boolean | null
? T
: T extends Function
? never
: T extends Array<infer V>
? AsJson<V>[]
: T extends object
? { [K in keyof T]: AsJson<T[K]> }
: never;
export interface SyncBox<TValue> {
id: string;
value: IComputedValue<TValue>;
set: (value: TValue) => void;
value: IComputedValue<AsJson<TValue>>;
set: (value: AsJson<TValue>) => void;
}
export const syncBoxInjectionToken = getInjectionToken<SyncBox<any>>({