diff options
Diffstat (limited to 'src/state/cache/types.ts')
-rw-r--r-- | src/state/cache/types.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/state/cache/types.ts b/src/state/cache/types.ts index 8bfcc867c..055f4167e 100644 --- a/src/state/cache/types.ts +++ b/src/state/cache/types.ts @@ -1 +1,7 @@ -export type Shadow<T> = T & {isShadowed: true} +// This isn't a real property, but it prevents T being compatible with Shadow<T>. +declare const shadowTag: unique symbol +export type Shadow<T> = T & {[shadowTag]: true} + +export function castAsShadow<T>(value: T): Shadow<T> { + return value as any as Shadow<T> +} |