import { Simplify } from '@knapsack/utils';
import { TokenType, TokenDefinitionSingular, TokenDefinitionComposite } from './token-definitions';
type CreateTokenSrcValueInfo<T extends {
    type: TokenType;
    value: unknown;
}> = {
    kind: 'ref';
    /** Has `{}` removed */
    referencedTokenId: string;
    isVarRef?: boolean;
    type: T['type'];
} | {
    kind: 'static';
    type: T['type'];
    value: T['value'];
};
type TokenSrcValueInfoSingularRaw = {
    [TheTokenType in TokenDefinitionSingular as TheTokenType['type']]: Simplify<CreateTokenSrcValueInfo<TheTokenType>>;
}[TokenDefinitionSingular['type']];
type TokenSrcValueInfoSingular<TT extends TokenSrcValueInfoSingularRaw['type'] = TokenSrcValueInfoSingularRaw['type']> = Extract<TokenSrcValueInfoSingularRaw, {
    type: TT;
}>;
type CreateSrcValueInfoForComposite<ValueObj extends Record<string, {
    type: TokenDefinitionSingular['type'];
}>> = {
    [Key in keyof ValueObj]: Simplify<CreateTokenSrcValueInfo<{
        type: ValueObj[Key]['type'];
        value: TokenDefinitionSingular<ValueObj[Key]['type']>['value'];
    }>>;
};
type TokenSrcValueInfoCompositeRaw = {
    [TheTokenType in TokenDefinitionComposite['type']]: Simplify<CreateTokenSrcValueInfo<{
        type: TheTokenType;
        value: Simplify<CreateSrcValueInfoForComposite<TokenDefinitionComposite<TheTokenType>['value']>>;
    }>>;
}[TokenDefinitionComposite['type']];
type TokenSrcValueInfoComposite<TT extends TokenSrcValueInfoCompositeRaw['type'] = TokenSrcValueInfoCompositeRaw['type']> = Extract<TokenSrcValueInfoCompositeRaw, {
    type: TT;
}>;
export type TokenSrcValueInfo<TT extends TokenSrcValueInfoComposite['type'] | TokenSrcValueInfoSingular['type'] = TokenSrcValueInfoComposite['type'] | TokenSrcValueInfoSingular['type'], TheKind extends TokenSrcValueInfoComposite['kind'] | TokenSrcValueInfoSingular['kind'] = TokenSrcValueInfoComposite['kind'] | TokenSrcValueInfoSingular['kind']> = Extract<TokenSrcValueInfoComposite | TokenSrcValueInfoSingular, {
    type: TT;
    kind: TheKind;
}>;
export declare function isTokenSrcValueInfoSingular(tokenSrcValueInfo: TokenSrcValueInfo): tokenSrcValueInfo is TokenSrcValueInfoSingular;
export declare function isTokenSrcValueInfoComposite(tokenSrcValueInfo: TokenSrcValueInfo): tokenSrcValueInfo is TokenSrcValueInfoComposite;
/**
 * A common object that is used to represent a token in the app.
 * Used in functions for editing communication between UI forms, Xstate,
 * and `@knapsack/design-tokens-utils`.
 */
export type TokenInfo<TheTokenType extends TokenSrcValueInfo['type'] = TokenSrcValueInfo['type']> = {
    tokenSrcValueInfo: TokenSrcValueInfo<TheTokenType>;
    tokenId: string;
    description?: string;
};
export {};
//# sourceMappingURL=token-src-value-info.d.ts.map