apphouse
Version:
Component library for React that uses observable state management and theme-able components.
57 lines (56 loc) • 2.37 kB
TypeScript
import { CSSProperties } from 'glamor';
import { Palette } from '../Palette';
import { Token } from '../Token';
import { CssPropertyStyle, StyleTokenReference } from '../style.interface';
interface ReferencePaletteTokenInfo {
paletteId: string;
paletteMode: string;
colorId: string;
}
/**
* Get palette info from reference
* @param reference Token reference
* @param selectedTheme light | dark
* @returns {
paletteId: string;
paletteMode: string;
colorId: string;
}
*/
export declare const getPaletteInfoFromReferenceKey: (reference: StyleTokenReference, selectedTheme?: 'dark' | 'light') => ReferencePaletteTokenInfo | undefined;
export declare const isValidTokenKey: (tokenStringKey: string) => boolean;
export declare const getPaletteInfoFromStringKey: (stringKey: string, selectedTheme?: 'dark' | 'light') => ReferencePaletteTokenInfo | undefined;
export declare const getTokenInfoFromReferenceKey: (reference: StyleTokenReference) => TokenReferenceInfo | undefined;
interface TokenReferenceInfo {
tokenType: string;
tokenKey: string;
tokenId: string;
}
export declare const getTokenInfoFromStringKey: (tokenReferenceString: string) => TokenReferenceInfo | undefined;
export declare const getIdForTokenFromValue: (type: string, key: string) => string | undefined;
export declare const isValidTokenType: (tokenType: any) => boolean;
export declare const getCssWithThemedTokens: ({ value, lookup, withColorsFromPaletteId, withRawValue }: {
value: CssPropertyStyle[];
lookup: {
[id: string]: string;
};
withColorsFromPaletteId?: string | undefined;
withRawValue?: boolean | undefined;
}) => CSSProperties;
export declare const getValueFromReference: ({ reference, withRaw, lookup, theme }: {
reference?: any;
theme: 'dark' | 'light' | undefined;
withRaw?: boolean | undefined;
lookup: {
[id: string]: string;
};
}) => string | number | undefined;
export declare const getValueFromReferenceString: ({ referenceString, withRaw, tokens, colors, theme }: {
referenceString?: any;
withRaw?: boolean | undefined;
tokens: Record<string, Token>;
colors: Record<string, Palette>;
theme?: 'dark' | 'light' | undefined;
}) => string | number | undefined;
export declare const isColorReferenceString: (referenceString: string) => boolean;
export {};