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>;
}
type ResetButton<T extends ResetButtonOptions> = Replace<
export type ResetButton<T extends ResetButtonOptions> = Replace<
Clickable<T>,
{
resetDescription: GetComputableTypeWithDefault<T["resetDescription"], Ref<string>>;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -46,7 +46,7 @@ export interface UpgradeOptions {
onPurchase?: VoidFunction;
}
interface BaseUpgrade extends Persistent<boolean> {
export interface BaseUpgrade extends Persistent<boolean> {
id: string;
bought: 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
? S
: 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,
{
[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 String
| typeof Number