import { Simplify } from '@knapsack/utils';
import { TokenDefinitionComposite, TokenDefinitionSingular, TokenReference, TokenType, TokenDefinition } from './token-definitions';
import { TokenKsExtensions } from './token-misc';
export type TokenSrcCommon<TheType extends TokenType = TokenType> = {
    $type?: TokenDefinition<TheType>['type'];
    $description?: string;
    $extensions?: {
        'cloud.knapsack'?: TokenKsExtensions;
    };
};
export declare function isTokenSrcExtensions(extensionsObj: unknown): extensionsObj is TokenSrcCommon['$extensions'];
type CreateSrcValueForComposite<ValueObj extends Record<string, {
    type: TokenDefinitionSingular['type'];
}>> = {
    [Key in keyof ValueObj]: TokenReference | TokenDefinitionSingular<ValueObj[Key]['type']>['value'];
};
type TokenSrcValueCompositeRaw = {
    [TheTokenType in TokenDefinitionComposite['type']]: Simplify<{
        type: TheTokenType;
        value: Simplify<CreateSrcValueForComposite<TokenDefinitionComposite<TheTokenType>['value']>>;
    }>;
}[TokenDefinitionComposite['type']];
type TokenSrcValueComposite<TT extends TokenSrcValueCompositeRaw['type'] = TokenSrcValueCompositeRaw['type']> = Extract<TokenSrcValueCompositeRaw, {
    type: TT;
}>;
type TokenSrcValueRaw = TokenDefinitionSingular | TokenSrcValueComposite;
export type TokenSrcValue<Type extends TokenDefinitionSingular['type'] | TokenSrcValueComposite['type'] = TokenDefinitionSingular['type'] | TokenSrcValueComposite['type']> = Extract<TokenSrcValueRaw, {
    type: Type;
}>['value'] | TokenReference;
export type TokenSrc<TheType extends TokenDefinitionSingular['type'] | TokenSrcValueComposite['type'] = TokenDefinitionSingular['type'] | TokenSrcValueComposite['type']> = Simplify<{
    $value: TokenSrcValue<TheType>;
} & TokenSrcCommon<TheType>>;
export declare function isTokenSrc(tokenObject: unknown): tokenObject is TokenSrc;
export type TokenSrcGroup = TokenSrcCommon & {
    [key: string]: TokenSrcGroup | TokenSrc | TokenSrcCommon | TokenSrcCommon['$extensions'];
};
export declare function isTokenGroup(tokenObject: unknown): tokenObject is TokenSrcGroup;
export declare function isTokenTypeVarRef(tokenObject: unknown): boolean;
export {};
//# sourceMappingURL=token-src.d.ts.map