UNPKG

@bemedev/basifun

Version:
594 lines 19.7 kB
import { Fn } from '../../globals/types'; import { Keys, NotUndefined, Primitive } from '../common/types'; import { AddString } from '../strings/types'; /** * A type that represents a true object, which is an object that does not have * any iterable properties or the `SymbolConstructor` property. * * @remarks This type is useful to ensure that the object is a plain object * without any special properties. * * @see {@linkcode Ru} for a utility type that represents a true object. * @see {@linkcode SymbolConstructor} for the symbol constructor type. */ /** * TrueObject type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type TrueObject = Ru & { [Symbol.iterator]?: never; }; /** * Alias of {@linkcode TrueObject} */ /** * To type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type To = TrueObject; /** * NOmit type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NOmit<T, K extends keyof T> = Omit<T, K>; /** * DeepOmit type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepOmit<T, K extends Keys> = { [P in Exclude<keyof T, K>]: T[P] extends Fn ? T[P] : T[P] extends object ? DeepOmit<T[P], K> : T[P]; }; /** * ReverseMap type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type ReverseMap<T extends Record<Keys, Keys>> = { [K in keyof T as T[K]]: K; }; /** * DeepReadonly type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepReadonly<T> = T extends Primitive ? T : { readonly [P in keyof T]: T[P] extends Fn ? T[P] : T[P] extends object ? DeepReadonly<T[P]> : T[P]; }; /** * DeepPartial type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepPartial<T> = T extends Primitive ? T : { [P in keyof T]?: T[P] extends Fn ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P]; }; /** * DeepRequired type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepRequired<T extends object | undefined> = NotUndefined<{ [P in keyof T]-?: T[P] extends Fn ? T[P] : T[P] extends object ? DeepRequired<T[P]> : T[P]; }>; /** * NotReadonly type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NotReadonly<T extends object> = { -readonly [P in keyof T]: T[P]; }; /** * DeepNotReadonly type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepNotReadonly<T extends object> = { -readonly [P in keyof T]: T[P] extends Fn ? T[P] : T[P] extends object ? DeepNotReadonly<T[P]> : T[P]; }; /** * ValuesOf type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type ValuesOf<T, U = any> = Extract<T[keyof T], U>; /** * ObjectValuesOf type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type ObjectValuesOf<T> = Exclude<Extract<ValuesOf<T>, object>, Array<any>>; /** * ExpressO type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type ExpressO<T extends object> = { [K in keyof T]: T[K]; }; /** * DeepExpressO type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepExpressO<T extends object> = ExpressO<T> extends infer P1 ? { [K in keyof P1]: P1[K] extends object ? DeepExpressO<P1[K]> : P1[K]; } : never; type _RequiredLow<T extends object> = Required<SubTypeLow<T, undefined>> extends infer P ? { [K in keyof P]: P[K] | undefined; } & NotSubTypeLow<T, undefined> : never; /** * RequiredLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type RequiredLow<T extends object> = ExpressO<_RequiredLow<T>>; /** * DeepRequiredLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepRequiredLow<T extends object> = RequiredLow<T> extends infer P1 ? { [K1 in keyof P1]: Exclude<P1[K1], undefined> extends infer P2 extends object ? DeepRequiredLow<P2> : P1[K1]; } : never; /** * Require type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Require<T, K extends keyof T> = NOmit<T, K> & Required<Pick<T, K>>; /** * RequiredBy type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type RequiredBy<T, U> = Required<PickBy<T, U>> & PickNotBy<T, U>; /** * Prop type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Prop<T, K> = K extends keyof T ? T[K] : never; /** * PickNoInfer type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PickNoInfer<T, S> = Pick<T, Extract<keyof T, S>>; /** * PickBy type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PickBy<T, U> = { [P in keyof T as T[P] extends U ? P : never]: Extract<T[P], U>; }; /** * PickKeysBy type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PickKeysBy<T, U> = keyof PickBy<T, U>; /** * PickNotBy type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PickNotBy<T, U> = { [P in keyof T as T[P] extends U ? never : P]: Exclude<T[P], U>; }; /** * PickKeysNotBy type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PickKeysNotBy<T, U> = keyof PickNotBy<T, U>; /** * OnPropChangedMethods type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type OnPropChangedMethods<T, I extends keyof T = keyof T> = T & { [K in Extract<PickKeysBy<T, (...args: any) => any>, I> & string as AddString<Capitalize<K>, 'on', 'Changed'>]: (cb: (newValue: T[K]) => void) => void; }; /** * PartialUndefiny type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type PartialUndefiny<T> = PickNotBy<T, undefined> & Partial<PickBy<T, undefined>>; /** * Nullify type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Nullify<T> = PickNotBy<T, null> & Partial<PickBy<T, null>>; type _OmitWithoutPartial<T, O extends string> = { [key in keyof Omit<T, O>]: O extends keyof T[key] ? _OmitWithoutPartial<T[key], O> : T[key]; }; type _OmitWithPartial<T, O extends string> = PartialUndefiny<Nullify<_OmitWithoutPartial<T, O>>>; /** * OmitRecursive type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type OmitRecursive<T, O extends string> = { [key in keyof _OmitWithPartial<T, O>]: _OmitWithPartial<T[key], O>; }; /** * Unionize type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Unionize<T extends Record<string, any>> = { [P in keyof T]: { [Q in P]: T[P]; }; }[keyof T]; type WithChildren<T, _omit extends string, _withChildren extends boolean = false> = _withChildren extends true ? T : Omit<T, _omit>; type DefaultK<S extends string, D extends string> = S extends '' ? D : S; /** * _FlatMapByKey type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type _FlatMapByKey<T extends object, _omit extends PickKeysBy<T, object>, _withChildren extends boolean = false, Delimiter extends string = '.', Keys extends string = '', K extends string = keyof T[_omit] & string> = T extends { [Key in _omit]?: any; } ? K extends keyof T[_omit] ? T[_omit][K] extends infer TK extends object ? _FlatMapByKey<TK, _omit, _withChildren, Delimiter, `${Keys}${Delimiter}${K}`> | { [key in DefaultK<Keys, Delimiter>]: WithChildren<T, _omit, _withChildren>; } : { [key in DefaultK<Keys, Delimiter>]: WithChildren<T, _omit, _withChildren>; } : never : { [key in DefaultK<Keys, Delimiter>]: WithChildren<T, _omit, _withChildren>; }; type FilterFlags<Base, Condition> = { [Key in keyof Base]: Base[Key] extends Condition ? Key : never; }; type NotFilterFlags<Base, Condition> = { [Key in keyof Base]: Base[Key] extends Condition ? never : Key; }; type FilterFlagsLow<Base, Condition> = { [Key in keyof Base]: Condition extends Base[Key] ? Key : never; }; type NotFilterFlagsLow<Base, Condition> = { [Key in keyof Base]: Condition extends Base[Key] ? never : Key; }; /** * AllowedNames type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base]; /** * NotAllowedNames type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NotAllowedNames<Base, Condition> = NotFilterFlags<Base, Condition>[keyof Base]; /** * AllowedNamesLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type AllowedNamesLow<Base, Condition> = FilterFlagsLow<Base, Condition>[keyof Base]; /** * NotAllowedNamesLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NotAllowedNamesLow<Base, Condition> = NotFilterFlagsLow<Base, Condition>[keyof Base]; /** * SubType type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type SubType<Base extends object, Condition> = Pick<Base, AllowedNames<Base, Condition>>; /** * DeepSubType type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepSubType<Base extends object, Condition> = { [K in keyof Base as K extends AllowedNames<Base, Condition> ? K : never]: Base[K] extends object ? DeepSubType<Base[K], Condition> : Base[K]; }; /** * NotSubType type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NotSubType<Base extends object, Condition> = Pick<Base, NotAllowedNames<Base, Condition>>; /** * DeepNotSubType type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepNotSubType<Base extends object, Condition> = { [K in keyof Base as K extends NotAllowedNames<Base, Condition> ? K : never]: Base[K] extends object ? DeepNotSubType<Base[K], Condition> : Base[K]; }; /** * SubTypeLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type SubTypeLow<Base extends object, Condition> = Pick<Base, AllowedNamesLow<Base, Condition>>; /** * NotSubTypeLow type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type NotSubTypeLow<Base extends object, Condition> = Pick<Base, NotAllowedNamesLow<Base, Condition>>; interface _Never { [key: Keys]: DeepNever; } /** * DeepNever type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type DeepNever = never | _Never; /** * Dn type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Dn = DeepNever; /** * Neverify type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Neverify<T> = T extends DeepNever ? never : T; /** * Ru type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Ru = Record<Keys, unknown>; /** * Rn type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Rn = Record<Keys, never>; /** * Ra type - Auto-generated expression * * ⚠️ WARNING: This expression is auto-generated and should not be modified. * Any manual changes will be overwritten during the next generation. * * @generated * @readonly * @author chlbri (bri_lvi@icloud.com) */ export type Ra = Record<Keys, any>; export {}; //# sourceMappingURL=types.d.ts.map