Export more types

This commit is contained in:
thepaperpilot 2022-03-08 19:40:51 -06:00
parent a12fae5fae
commit 7524ed3164
19 changed files with 22 additions and 22 deletions

View file

@ -35,7 +35,7 @@ export interface ResetButtonOptions extends ClickableOptions {
canClick?: Computable<boolean>; canClick?: Computable<boolean>;
} }
type ResetButton<T extends ResetButtonOptions> = Replace< export type ResetButton<T extends ResetButtonOptions> = Replace<
Clickable<T>, Clickable<T>,
{ {
resetDescription: GetComputableTypeWithDefault<T["resetDescription"], Ref<string>>; resetDescription: GetComputableTypeWithDefault<T["resetDescription"], Ref<string>>;

View file

@ -1,4 +1,4 @@
interface ThemeVars { export interface ThemeVars {
"--foreground": string; "--foreground": string;
"--background": string; "--background": string;
"--feature-foreground": string; "--feature-foreground": string;

View file

@ -39,7 +39,7 @@ export interface AchievementOptions {
onComplete?: VoidFunction; onComplete?: VoidFunction;
} }
interface BaseAchievement extends Persistent<boolean> { export interface BaseAchievement extends Persistent<boolean> {
id: string; id: string;
earned: Ref<boolean>; earned: Ref<boolean>;
complete: VoidFunction; complete: VoidFunction;

View file

@ -45,7 +45,7 @@ export interface BarOptions {
mark?: Computable<boolean | string>; mark?: Computable<boolean | string>;
} }
interface BaseBar { export interface BaseBar {
id: string; id: string;
type: typeof BarType; type: typeof BarType;
[Component]: typeof BarComponent; [Component]: typeof BarComponent;

View file

@ -167,7 +167,7 @@ export interface BoardOptions {
types: Record<string, NodeTypeOptions>; types: Record<string, NodeTypeOptions>;
} }
interface BaseBoard extends Persistent<BoardData> { export interface BaseBoard extends Persistent<BoardData> {
id: string; id: string;
links: Ref<BoardNodeLink[] | null>; links: Ref<BoardNodeLink[] | null>;
nodes: Ref<BoardNode[]>; nodes: Ref<BoardNode[]>;

View file

@ -26,7 +26,7 @@ import {
export const BuyableType = Symbol("Buyable"); export const BuyableType = Symbol("Buyable");
type BuyableDisplay = export type BuyableDisplay =
| CoercableComponent | CoercableComponent
| { | {
title?: CoercableComponent; title?: CoercableComponent;
@ -48,7 +48,7 @@ export interface BuyableOptions {
onPurchase?: (cost: DecimalSource) => void; onPurchase?: (cost: DecimalSource) => void;
} }
interface BaseBuyable extends Persistent<DecimalSource> { export interface BaseBuyable extends Persistent<DecimalSource> {
id: string; id: string;
amount: Ref<DecimalSource>; amount: Ref<DecimalSource>;
maxed: Ref<boolean>; maxed: Ref<boolean>;

View file

@ -55,7 +55,7 @@ export interface ChallengeOptions {
onEnter?: VoidFunction; onEnter?: VoidFunction;
} }
interface BaseChallenge { export interface BaseChallenge {
id: string; id: string;
completions: PersistentRef<DecimalSource>; completions: PersistentRef<DecimalSource>;
completed: Ref<boolean>; completed: Ref<boolean>;

View file

@ -39,7 +39,7 @@ export interface ClickableOptions {
onHold?: VoidFunction; onHold?: VoidFunction;
} }
interface BaseClickable { export interface BaseClickable {
id: string; id: string;
type: typeof ClickableType; type: typeof ClickableType;
[Component]: typeof ClickableComponent; [Component]: typeof ClickableComponent;

View file

@ -23,7 +23,7 @@ export interface ConversionOptions {
modifyGainAmount?: (gain: DecimalSource) => DecimalSource; modifyGainAmount?: (gain: DecimalSource) => DecimalSource;
} }
interface BaseConversion { export interface BaseConversion {
convert: VoidFunction; convert: VoidFunction;
} }

View file

@ -22,7 +22,7 @@ export interface HotkeyOptions {
onPress: VoidFunction; onPress: VoidFunction;
} }
interface BaseHotkey { export interface BaseHotkey {
type: typeof HotkeyType; type: typeof HotkeyType;
} }

View file

@ -33,7 +33,7 @@ export interface InfoboxOptions {
display: Computable<CoercableComponent>; display: Computable<CoercableComponent>;
} }
interface BaseInfobox extends Persistent<boolean> { export interface BaseInfobox extends Persistent<boolean> {
id: string; id: string;
collapsed: Ref<boolean>; collapsed: Ref<boolean>;
type: typeof InfoboxType; type: typeof InfoboxType;

View file

@ -56,7 +56,7 @@ export interface MilestoneOptions {
onComplete?: VoidFunction; onComplete?: VoidFunction;
} }
interface BaseMilestone extends Persistent<boolean> { export interface BaseMilestone extends Persistent<boolean> {
id: string; id: string;
earned: Ref<boolean>; earned: Ref<boolean>;
type: typeof MilestoneType; type: typeof MilestoneType;

View file

@ -21,7 +21,7 @@ export interface ResetOptions {
onReset?: VoidFunction; onReset?: VoidFunction;
} }
interface BaseReset { export interface BaseReset {
id: string; id: string;
reset: VoidFunction; reset: VoidFunction;
type: typeof ResetType; type: typeof ResetType;

View file

@ -18,7 +18,7 @@ export interface TabOptions {
display: Computable<CoercableComponent>; display: Computable<CoercableComponent>;
} }
interface BaseTab { export interface BaseTab {
id: string; id: string;
type: typeof TabType; type: typeof TabType;
[Component]: typeof TabComponent; [Component]: typeof TabComponent;

View file

@ -34,7 +34,7 @@ export interface TabButtonOptions {
glowColor?: Computable<string>; glowColor?: Computable<string>;
} }
interface BaseTabButton { export interface BaseTabButton {
type: typeof TabButtonType; type: typeof TabButtonType;
[Component]: typeof TabButtonComponent; [Component]: typeof TabButtonComponent;
} }
@ -65,7 +65,7 @@ export interface TabFamilyOptions {
style?: Computable<StyleValue>; style?: Computable<StyleValue>;
} }
interface BaseTabFamily extends Persistent<string> { export interface BaseTabFamily extends Persistent<string> {
id: string; id: string;
activeTab: Ref<GenericTab | CoercableComponent | null>; activeTab: Ref<GenericTab | CoercableComponent | null>;
selected: Ref<string>; selected: Ref<string>;

View file

@ -137,7 +137,7 @@ export interface TreeOptions {
onReset?: (node: GenericTreeNode) => void; onReset?: (node: GenericTreeNode) => void;
} }
interface BaseTree { export interface BaseTree {
id: string; id: string;
links: Ref<Link[]>; links: Ref<Link[]>;
reset: (node: GenericTreeNode) => void; reset: (node: GenericTreeNode) => void;

View file

@ -46,7 +46,7 @@ export interface UpgradeOptions {
onPurchase?: VoidFunction; onPurchase?: VoidFunction;
} }
interface BaseUpgrade extends Persistent<boolean> { export interface BaseUpgrade extends Persistent<boolean> {
id: string; id: string;
bought: Ref<boolean>; bought: Ref<boolean>;
canPurchase: Ref<boolean>; canPurchase: Ref<boolean>;

View file

@ -15,9 +15,9 @@ export type GetComputableType<T> = T extends { [DoNotCache]: true }
export type GetComputableTypeWithDefault<T, S> = undefined extends T export type GetComputableTypeWithDefault<T, S> = undefined extends T
? S ? S
: GetComputableType<NonNullable<T>>; : GetComputableType<NonNullable<T>>;
type UnwrapComputableType<T> = T extends Ref<infer S> ? S : T extends () => infer S ? S : T; export type UnwrapComputableType<T> = T extends Ref<infer S> ? S : T extends () => infer S ? S : T;
type ComputableKeysOf<T> = Pick< export type ComputableKeysOf<T> = Pick<
T, T,
{ {
[K in keyof T]: T[K] extends Computable<unknown> ? K : never; [K in keyof T]: T[K] extends Computable<unknown> ? K : never;

View file

@ -154,7 +154,7 @@ export function setRefValue<T>(ref: Ref<T | Ref<T>>, value: T) {
} }
} }
type PropTypes = export type PropTypes =
| typeof Boolean | typeof Boolean
| typeof String | typeof String
| typeof Number | typeof Number