API reference › @evolu/common › Types
TypeScript utility types.
Functions
| Function | Description |
|---|---|
| isPromiseLike | Type guard to check if a value is a PromiseLike. |
Type Aliases
| Type Alias | Description |
|---|---|
| Awaitable | A value that can be awaited. |
| Callback | A function that receives a value and returns nothing. |
| CallbackWithTeardown | A function that receives a value and optionally returns a teardown function. |
| Digit | Single digit 0-9. Useful for template literal type validation. |
| Digit1To23 | Numeric string 1-23. Useful for hours validation. |
| Digit1To51 | Numeric string 1-51. Useful for weeks validation. |
| Digit1To59 | Numeric string 1-59. Useful for minutes, seconds validation. |
| Digit1To6 | Numeric string 1-6. Useful for days validation. |
| Digit1To9 | Digit 1-9. Useful for template literal type validation. |
| Digit1To99 | Numeric string 1-99. Useful for years validation. |
| DistributiveOmit | Removes keys from each member of a union. |
| ExtractType | Extracts members of a discriminated union by their type literal. |
| Int1To100 | Numeric literal 1-100. |
| Int1To99 | Numeric literal 1-99. |
| Literal | String, number, bigint, boolean, undefined, null |
| Mutable | Removes readonly modifier from all properties of a type. |
| NewKeys | Constrains T to only contain keys not present in Existing. |
| NullablePartial | Makes properties optional if they accept null as a value. |
| NumberFromString | Parses a numeric literal type from a string literal. |
| PartialProp | Makes a specific property of an object optional while keeping others unchanged. |
| Predicate | Checks a condition on a value and returns a boolean. |
| PredicateWithIndex | Checks a condition on a value at a given index and returns a boolean. |
| Refinement | A type guard function that refines type A to a narrower type B. |
| RefinementWithIndex | A type guard function that refines type A to a narrower type B at a given index. |
| Simplify | Simplify an intersection type into a single mapped type. |
| UnionToIntersection | Converts a union to an intersection. |
| WidenLiteral | Infers a broader type from a specific literal value type. |