import type { ScopeVariants } from '../Provider'; import type { TokenType, TokenOptions } from './createToken.h'; /** * @private */ export declare function tokenToString(token: symbol): string; export declare class TokenClass implements TokenType { /** * Индетификатор токена */ name: symbol; /** * Строковое имя токена, переданное в конструктор. Будет использовано в вызове .toString() */ stringName: string; options: TokenOptions; isToken: true; isModernToken: true; constructor(name?: string, options?: TokenOptions); /** * toString будет использоваться для получения идентификатора токена */ toString(): string; } declare const BASE_TOKEN_TYPE = "base token"; declare const MULTI_TOKEN_TYPE = "multi token"; export type BaseTokenInterface = T extends null | undefined ? T : T & { __type?: typeof BASE_TOKEN_TYPE; }; export type MultiTokenInterface = T extends null | undefined ? T : T & { __type?: typeof MULTI_TOKEN_TYPE; }; export type TokenInterface = BaseTokenInterface | MultiTokenInterface; export declare function createToken(name?: string, options?: { scope?: ScopeVariants; }): BaseTokenInterface; export declare function createToken(name: string, options: { multi: true; scope?: ScopeVariants; }): MultiTokenInterface; /** * Helper function to declare a optional token dependency */ export declare function optional>(token: Token): { token: Token; optional: true; }; export type ExtractTokenType> = Token extends TokenInterface ? Type : unknown; declare const secret: unique symbol; type Secret = typeof secret; type Not = T extends true ? false : true; type IsNever = [T] extends [never] ? true : false; type IsAny = [T] extends [Secret] ? Not> : false; export type ExtractDependencyType> = IsAny extends true ? any : [Token] extends [MultiTokenInterface] ? Type[] : Token extends BaseTokenInterface ? Type : unknown; export type OptionalTokenDependency = { token: TokenInterface; optional: boolean; }; export type BaseOptionalTokenDependency = { token: BaseTokenInterface; optional: boolean; }; export type MultiOptionalTokenDependency = { token: MultiTokenInterface; optional: boolean; }; export {}; //# sourceMappingURL=createToken.d.ts.map