/** * Commons decorators types and functions * * @module Common */ /** */ export interface MetaDescriptor { /** * Unique ID */ id: number; /** * Type symbol */ type: symbol; /** * Name of the decorator. */ name: string; /** * Metadata object to which this decorator is applied. */ metadata: DecoratorMetadataObject; } export interface PropertyMetaDescriptor extends MetaDescriptor { /** * Property name of the object the decorator is applied. */ propertyName: keyof This; } export interface ClassMetaDescriptor extends MetaDescriptor { /** * Class name of the decorated class. */ className: string; } export declare function createPropertyMetaDescriptor(type: symbol, name: string, metadata: DecoratorMetadataObject, propertyName: keyof This): PropertyMetaDescriptor; export declare function createClassMetaDescriptor(type: symbol, name: string, metadata: DecoratorMetadataObject, className: string): ClassMetaDescriptor; type RecursiveKeyOf = { [TKey in keyof TObj & (string | number)]: TObj[TKey] extends any[] ? `${TKey}` : TObj[TKey] extends object ? `${TKey}.${RecursiveKeyOf}` : `${TKey}`; }[keyof TObj & (string | number)]; type NumericalString = `${number}`; type RecursiveKeyWithOperations | NumericalString> = T extends U ? T : T extends `${U} + ${infer R}` ? T extends `${infer F} + ${R}` ? `${F} + ${RecursiveKeyWithOperations>}` : never : T extends `${U} - ${infer R}` ? T extends `${infer F} - ${R}` ? `${F} - ${RecursiveKeyWithOperations>}` : never : U; type CommaSeparetedRecursiveKey> = T extends U ? T : T extends `${U},${infer R}` ? T extends `${infer F},${R}` ? `${F},${CommaSeparetedRecursiveKey>}` : never : U; export type StringFormattedRecursiveKeyOf = Args extends RecursiveKeyWithOperations ? Args : RecursiveKeyWithOperations; export type StringFormattedCommaSepRecursiveKeyOf = Args extends CommaSeparetedRecursiveKey ? Args : CommaSeparetedRecursiveKey; export type NumberOrRecursiveKey = number | StringFormattedRecursiveKeyOf; /** * Chained accessor to get the value of `expr` for `obj`. * * @param {any} obj The object to access the value. * @param {string} expr The path of the property to access that can contains small arithmetic expressions. * @returns {any} The resolved property value. * * @throws {ReferenceError} if you attempt to access a non existing property. * */ export declare function recursiveGet(obj: T, expr: RecursiveKeyWithOperations): any; export declare function commaSeparetedRecursiveGet(obj: T, args: CommaSeparetedRecursiveKey): any[]; export {};