export declare namespace EnsoUtils { /** * Removes indexed fields leaving only statically defined. */ type PickIndexed = { [Key in keyof Payload as string extends Debrand ? Key : number extends Debrand ? Key : symbol extends Debrand ? Key : never]: Payload[Key]; }; type IndexedKeys = keyof PickIndexed; /** * Removes indexed fields leaving only statically defined. */ type PickStatic = { [Key in keyof Payload as string extends Debrand ? never : number extends Debrand ? never : symbol extends Debrand ? never : Key]: Payload[Key]; }; type StaticKeys = keyof PickStatic; /** * Resolves true if the given key is statically defined in the given type. */ type IsStaticKey> = Key extends StaticKeys ? true : false; /** * Resolves true if the passed key is a required field of the passed model. */ type IsRequiredKey = IsStaticKey extends true ? Partial> extends Pick ? false : true : false; type PickOptional = { [Key in keyof Payload as IsStaticKey extends true ? Partial> extends Pick ? Key : never : never]: Payload[Key]; }; type OptionalKeys = keyof PickOptional; type IsOptionalKey> = Key extends OptionalKeys ? true : false; /** * Nullish value type. */ type Nullish = Type | null | undefined; type HasNullish = Not>>; /** * Excludes nulish values from the given type. */ type NonNullish = Exclude; /** * Excludes undefined values from the given type. */ type NonUndefined = Exclude; /** * Falsy value type. */ type Falsy = false | 0 | "" | Nullish; type NonFalsy = Exclude; type Static = InstanceType; type NonTuple = Type extends Tuple ? never : Type; type ArrayConstraint = unknown[] | ReadonlyArrayConstraint; type StaticArray = Tuple; type Tuple = [unknown, ...unknown[]] | readonly [unknown, ...unknown[]]; type ReadonlyArrayConstraint = readonly unknown[]; type IsReadonlyArray = Type extends readonly unknown[] ? Type extends unknown[] ? false : true : false; type IndexOfTuple = Exclude extends infer Key ? Key extends `${infer Index extends number}` ? Index : never : never; type Not = Type extends true ? false : true; type And = true extends Type1 & Type2 & Type3 & Type4 & Type5 & Type6 & Type7 & Type8 & Type9 & Type10 ? true : false; type Or = true extends Type1 | Type2 | Type3 | Type4 | Type5 | Type6 | Type7 | Type8 | Type9 | Type10 ? true : false; type IfAnyOr = 0 extends 1 & Type ? IfType : OrType; type AnyOr = IfAnyOr; type IsAny = IfAnyOr; type OnlyAny = IfAnyOr; type IfUnknownOr = IfAnyOr; type UnknownOr = IfUnknownOr; type IsUnknown = IfUnknownOr; type IsNotTop = Type extends {} ? true : false; type ResolveTop = IsUnknown extends true ? never : any; type IsNever = [Type] extends [never] ? true : false; type NeverDefault = [Type] extends [never] ? DefaultType : Type; type IsExtreme = Or, IsUnknown, IsNever>; type CovariantifyProperty = { [Key in keyof Type]: Type[Key]; }; type CovariantifyKeyof = Exclude extends infer Key extends keyof Type ? Key : never; type UnionToIntersection = (Union extends any ? (key: Union) => void : never) extends (key: infer Intersection) => void ? Intersection : never; /** * Resolves union keys. */ type UnionKeys = Type extends Type ? keyof Type : never; /** * Resolves union value. */ type UnionValue> = Type extends { [Key in UnionKey]: unknown; } ? Type[UnionKey] : never; type Primitive = string | number | boolean | undefined | null | symbol | bigint; type BrandedPrimitive = Primitive & AnyBrand; type Branded = Type & { [Key in Symbol]: true; }; /** * Any brand type that can be mixed with string number or symbol to create * opaque primitive. */ type AnyBrand = { [key: keyof any]: any; }; /** * Removes brand from the given type. */ type Debrand = Type extends infer _Brand extends AnyBrand & (infer Debranded extends Primitive) ? Debranded : Type; type StaticImplements = InstanceType; type NonObject = Primitive | BrandedPrimitive; type HasNonObject = Not | Exclude>>; type OnlyObject = Extract, object>; type Transparent = Type extends infer Type ? { [Key in keyof Type]: Type[Key]; } : never; type Expose = Type & {}; type Extends = Extract extends infer RefQualifier ? Not> : never; namespace Union { type Shared = Pick]: IsSharedKey extends true ? Key : never; }[UnionKeys]>; type IsSharedKey = Type extends infer TypeUnion ? Type extends Type ? Key extends keyof TypeUnion ? TypeUnion[Key] extends Type[Key] ? true : false : false : never : never; } } //# sourceMappingURL=utils.d.ts.map