import { type Simplify } from '@knapsack/utils';
import * as s from 'superstruct';
import { type NotTokenReference, type TokenDefinition, type TokenDefinitionComposite, type TokenDefinitionSingular, type TokenReference, type TokenType } from './token-definitions';
import { type TokenKsExtensions, type TokenOrder } from './token-misc';
import { type TokenSrcValue } from './token-src';
/** Used for tokens AND groups */
type TokenDataBothCommon = {
    id: string;
    description?: string;
};
type CreateDataValueForComposite<ValueObj extends Record<string, {
    type: TokenDefinitionSingular['type'];
}>> = {
    [Key in keyof ValueObj]: TokenDefinitionSingular<ValueObj[Key]['type']>['value'];
};
type TokenDataCommon<Info extends {
    /** Basically the ID */
    type: TokenDefinition['type'];
    value: unknown;
}> = TokenDataBothCommon & {
    type: Info['type'];
    value: Info['value'];
    /**
     * Extracted from `$extensions['cloud.knapsack'].token`
     */
    tokenConfig?: TokenKsExtensions['token'];
    /**
     * Tokens that are references by this token
     * @todo will need to change for shadow
     * @example
     * ```
     * [
     *  ['color.primary', 'color.secondary'],
     *  ['spacing.medium']
     * ]
     * ```
     */
    references?: Array<string[]>;
};
type CreateTokenData<Info extends {
    type: TokenDefinition['type'];
    value: unknown;
}> = ({
    kind: 'ref';
    /** Has `{}` removed */
    referencedTokenId: string;
    originalValue: TokenReference;
} & TokenDataCommon<Info>) | ({
    kind: 'static';
    originalValue: NotTokenReference<TokenSrcValue<Info['type']>>;
} & TokenDataCommon<Info>);
type TokenDataSingularRaw = {
    [TokenDef in TokenDefinitionSingular as TokenDef['type']]: Simplify<CreateTokenData<TokenDef>>;
}[TokenDefinitionSingular['type']];
export type TokenDataSingular<TT extends TokenDataSingularRaw['type'] = TokenDataSingularRaw['type']> = Extract<TokenDataSingularRaw, {
    type: TT;
}>;
type TokenDataCompositeRaw = {
    [TType in TokenDefinitionComposite['type']]: Simplify<CreateTokenData<{
        type: TType;
        value: Simplify<CreateDataValueForComposite<TokenDefinitionComposite<TType>['value']>>;
    }>>;
}[TokenDefinitionComposite['type']];
export type TokenDataComposite<TheTokenType extends TokenDataCompositeRaw['type'] = TokenDataCompositeRaw['type']> = Extract<TokenDataCompositeRaw, {
    type: TheTokenType;
}>;
export declare function isTokenDataComposite(tokenData: TokenData): tokenData is TokenDataComposite;
export type TokenData<TheTokenType extends TokenDataSingular['type'] | TokenDataComposite['type'] = TokenDataSingular['type'] | TokenDataComposite['type']> = Extract<TokenDataSingular | TokenDataComposite, {
    type: TheTokenType;
}>;
export type TokenGroupData = Simplify<{
    type?: TokenType;
    /**
     * Extracted from `$extensions['cloud.knapsack'].group`
     */
    groupConfig?: TokenKsExtensions['group'];
    children: TokenOrder;
} & TokenDataBothCommon>;
/**
 * @deprecated Use `TokenValueColorStruct` instead
 */
export declare function isTokenValueColor(value: unknown): value is TokenDefinitionSingular<'color'>['value'];
export declare const TokenValueColorStruct: s.Struct<string, null>;
/**
 * @deprecated Use `TokenValueDimensionStruct` instead
 */
export declare function isTokenValueDimension(value: unknown): value is TokenDefinitionSingular<'dimension'>['value'];
export declare const TokenValueDimensionStruct: s.Struct<`${number}px` | `${number}rem` | `${number}em` | `${number}%`, null>;
/**
 * @deprecated Use `TokenValueDurationStruct` instead
 */
export declare function isTokenValueDuration(value: unknown): value is TokenDefinitionSingular<'duration'>['value'];
export declare const TokenValueDurationStruct: s.Struct<`${number}ms`, null>;
/**
 * @deprecated Use `TokenValueFontWeightStruct` instead
 */
export declare function isTokenValueFontWeight(value: unknown): value is TokenDefinitionSingular<'fontWeight'>['value'];
export declare const TokenValueFontWeightStruct: s.Struct<string | number, null>;
export declare const TokenValueCubicBezierStruct: s.Struct<[number, number, number, number], null>;
/**
 * Determines if it's a "shadow" token value AND totally de-referenced
 */
export declare function isTokenValueShadow(value: unknown): value is Simplify<CreateDataValueForComposite<TokenDefinitionComposite<'shadow'>['value']>>;
export declare const TokenValueStrokeStyleStruct: s.Struct<"solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset" | "inset", null>;
/**
 * Determines if it's a "border" token value AND totally de-referenced
 */
export declare function isTokenValueBorder(value: unknown): value is Simplify<CreateDataValueForComposite<TokenDefinitionComposite<'border'>['value']>>;
/**
 * Determines if it's a "transition" token value AND totally de-referenced
 */
export declare function isTokenValueTransition(value: unknown): value is Simplify<CreateDataValueForComposite<TokenDefinitionComposite<'transition'>['value']>>;
export declare const assertTokenData: (data: unknown) => asserts data is TokenData;
export {};
//# sourceMappingURL=token-data.d.ts.map