Skip to content

type

Type utilities.

Class Description
TypeAsserter A helper that captures a type parameter and provides methods for compile-time exhaustiveness checks.
Type Description
ExactKeys A type that represents the keys of an object as strings and asserts that all keys are present in a list of keys.
ExactMembers A type that represents the members of a type.
ExtractEventMap Derives an event map (\{ eventName: [callbackArgs] \}) from a type exposing an overloaded on(name, callback) method — e.g. Obsidian’s Workspace / Vault / MetadataCache. Each on overload becomes one entry keyed by the event name, with the callback’s parameters as a labeled tuple; the wide on(name: string, …) catch-all overload is dropped. The map auto-tracks upstream overloads (no hand-authoring). It cannot reconstruct genuinely generic overloads, but Obsidian’s event overloads are all concrete string-literal ones.
MaybeReturn A type that represents a return value that may be void.
PropertyValues A type that represents the values of an object.
StringKeys A type that represents the keys of an object as strings.